1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[6154],{50082:(n,e,t)=>{t.r(e),t.d(e,{assets:()=>r,contentTitle:()=>a,default:()=>d,frontMatter:()=>s,metadata:()=>p,toc:()=>l});var i=t(85893),o=t(11151);const s={sidebar_position:1},a="Pinit",p={id:"integration/pinit",title:"Pinit",description:'Pinit package provides the ability to perform absolute positioning based on the page and relative positioning based on "pins," making it convenient to implement arrow pointing and explanatory effects for slides.',source:"@site/docs/integration/pinit.md",sourceDirName:"integration",slug:"/integration/pinit",permalink:"/docs/integration/pinit",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/en/integration/pinit.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Package Integration",permalink:"/docs/category/package-integration"},next:{title:"MiTeX",permalink:"/docs/integration/mitex"}},r={},l=[{value:"Simple Example",id:"simple-example",level:2},{value:"Complex Example",id:"complex-example",level:2}];function c(n){const e={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",...(0,o.a)(),...n.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(e.h1,{id:"pinit",children:"Pinit"}),"\n",(0,i.jsxs)(e.p,{children:[(0,i.jsx)(e.a,{href:"https://github.com/OrangeX4/typst-pinit/",children:"Pinit"}),' package provides the ability to perform absolute positioning based on the page and relative positioning based on "pins," making it convenient to implement arrow pointing and explanatory effects for slides.']}),"\n",(0,i.jsx)(e.h2,{id:"simple-example",children:"Simple Example"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typst",children:'#import "@preview/pinit:0.2.2": *\n\n#set text(size: 24pt)\n\nA simple #pin(1)highlighted text#pin(2).\n\n#pinit-highlight(1, 2)\n\n#pinit-point-from(2)[It is simple.]\n'})}),"\n",(0,i.jsx)(e.img,{alt:"Touying example output",src:t(3261).Z+"",width:"1191",height:"1684"}),"\n",(0,i.jsxs)(e.p,{children:["Another ",(0,i.jsx)(e.a,{href:"https://github.com/OrangeX4/typst-pinit/blob/main/examples/equation-desc.typ",children:"example"}),":"]}),"\n",(0,i.jsx)(e.p,{children:(0,i.jsx)(e.img,{src:"https://github.com/touying-typ/touying/assets/34951714/9b4a6b50-fcfd-497d-9649-ae1f7762ee3f",alt:"image"})}),"\n",(0,i.jsx)(e.h2,{id:"complex-example",children:"Complex Example"}),"\n",(0,i.jsx)(e.p,{children:"An example of shared usage with Touying:"}),"\n",(0,i.jsx)(e.pre,{children:(0,i.jsx)(e.code,{className:"language-typst",children:'#import "@preview/touying:0.7.4": *\n#import themes.default: *\n#import "@preview/pinit:0.2.2": *\n\n#set text(size: 20pt, font: "Calibri", ligatures: false)\n#show heading: set text(weight: "regular")\n#show heading: set block(above: 1.4em, below: 1em)\n#show heading.where(level: 1): set text(size: 1.5em)\n\n// Useful functions\n#let crimson = rgb("#c00000")\n#let greybox(..args, body) = rect(fill: luma(95%), stroke: 0.5pt, inset: 0pt, outset: 10pt, ..args, body)\n#let redbold(body) = {\n set text(fill: crimson, weight: "bold")\n body\n}\n#let blueit(body) = {\n set text(fill: blue)\n body\n}\n\n#show: default-theme.with(aspect-ratio: "4-3")\n\n// Main body\n#slide[\n #set heading(offset: 0)\n\n = Asymptotic Notation: $O$\n\n Use #pin("h1")asymptotic notations#pin("h2") to describe asymptotic efficiency of algorithms.\n (Ignore constant coefficients and lower-order terms.)\n\n #pause\n\n #greybox[\n Given a function $g(n)$, we denote by $O(g(n))$ the following *set of functions*:\n #redbold(${f(n): "exists" c > 0 "and" n_0 > 0, "such that" f(n) <= c dot g(n) "for all" n >= n_0}$)\n ]\n\n #pinit-highlight("h1", "h2")\n\n #pause\n\n $f(n) = O(g(n))$: #pin(1)$f(n)$ is *asymptotically smaller* than $g(n)$.#pin(2)\n\n #pause\n\n $f(n) redbold(in) O(g(n))$: $f(n)$ is *asymptotically* #redbold[at most] $g(n)$.\n\n #only("4-", pinit-line(stroke: 3pt + crimson, start-dy: -0.25em, end-dy: -0.25em, 1, 2))\n\n #pause\n\n #block[Insertion Sort as an #pin("r1")example#pin("r2"):]\n\n - Best Case: $T(n) approx c n + c\' n - c\'\'$ #pin(3)\n - Worst case: $T(n) approx c n + (c\' \\/ 2) n^2 - c\'\'$ #pin(4)\n\n #pinit-rect("r1", "r2")\n\n #pause\n\n #pinit-place(3, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]
1]\n #pinit-place(4, dx: 15pt, dy: -15pt)[#redbold[$T(n) = O(n)$]]\n\n #pause\n\n #blueit[Q: Is $n^(3) = O(n^2)$#pin("que")? How to prove your answer#pin("ans")?]\n\n #pause\n\n #pinit-point-to("que", fill: crimson, redbold[No.])\n #pinit-point-from("ans", body-dx: -150pt)[\n Show that the equation $(3/2)^n >= c$ \\\n has infinitely many solutions for $n$.\n ]\n]\n'})}),"\n",(0,i.jsx)(e.img,{alt:"Touying example output",src:t(6480).Z+"",width:"3246",height:"4884"})]})}function d(n={}){const{wrapper:e}={...(0,o.a)(),...n.components};return e?(0,i.jsx)(e,{...n,children:(0,i.jsx)(c,{...n})}):c(n)}},3261:(n,e,t)=>{t.d(e,{Z:()=>i});const i=t.p+"assets/images/420830ad-40318a0977a57cf6418d960b9f54ebaa.png"},6480:(n,e,t)=>{t.d(e,{Z:()=>i});const i=t.p+"assets/images/a96e5222-5f9350b61c58e6ba0c3a775a4dc4b738.png"},11151:(n,e,t)=>{t.d(e,{Z:()=>p,a:()=>a});var i=t(67294);const o={},s=i.createContext(o);function a(n){const e=i.useContext(s);return i.useMemo((function(){return"function"==typeof n?n(e):{...e,...n}}),[e,n])}function p(n){let e;return e=n.disableParentContext?"function"==typeof n.components?n.components(o):n.components||o:a(n.components),i.createElement(s.Provider,{value:e},n.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.