1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[3843],{99128:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>o,default:()=>h,frontMatter:()=>s,metadata:()=>a,toc:()=>c});var i=n(85893),r=n(11151);const s={sidebar_position:53,description:"Get the page width and height from the slide configuration.",toc_max_heading_level:2},o="get-page-dimensions",a={id:"reference/utils/get-page-dimensions",title:"get-page-dimensions",description:"Get the page width and height from the slide configuration.",source:"@site/docs/reference/utils/get-page-dimensions.mdx",sourceDirName:"reference/utils",slug:"/reference/utils/get-page-dimensions",permalink:"/docs/reference/utils/get-page-dimensions",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:53,frontMatter:{sidebar_position:53,description:"Get the page width and height from the slide configuration.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"page-args-from-aspect-ratio",permalink:"/docs/reference/utils/page-args-from-aspect-ratio"},next:{title:"i18n-outline-title",permalink:"/docs/reference/utils/i18n-outline-title"}},d={},c=[{value:"self : <TypeLink></TypeLink>",id:"self",level:3}];function l(e){const t={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",strong:"strong",...(0,r.a)(),...e.components},{Param:n,Parameters:s,Signature:o,SignatureName:a,SignatureParam:d,SourceLink:c,TypeLink:l}=t;return n||p("Param",!0),s||p("Parameters",!0),o||p("Signature",!0),a||p("SignatureName",!0),d||p("SignatureParam",!0),c||p("SourceLink",!0),l||p("TypeLink",!0),(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t.h1,{id:"get-page-dimensions",children:"get-page-dimensions"}),"\n",(0,i.jsx)(o,{children:(0,i.jsxs)("code",{children:[(0,i.jsx)(a,{children:"get-page-dimensions"}),"(",(0,i.jsx)(d,{children:(0,i.jsx)(t.a,{href:"#self",children:"self"})}),")",(0,i.jsx)(c,{href:"https://github.com/touying-typ/touying/blob/main/src/utils.typ#L2697"})]})}),"\n",(0,i.jsx)(t.p,{children:"Get the page width and height from the slide configuration."}),"\n",(0,i.jsxs)(t.p,{children:["Returns a tuple ",(0,i.jsx)(t.code,{children:"(width, height)"}),". If the page has explicit ",(0,i.jsx)(t.code,{children:"width"}),"/",(0,i.jsx)(t.code,{children:"height"}),"\nkeys those are used directly; otherwise dimensions are derived from the\n",(0,i.jsx)(t.code,{children:"paper"})," key. The built-in Typst presentation paper sizes\n(",(0,i.jsx)(t.code,{children:'"presentation-16-9"'})," and ",(0,i.jsx)(t.code,{children:'"presentation-4-3"'}),") are recognised; for any\nother paper name the 16-9 default dimensions (841.89pt \xd7 473.56pt) are used\nas a fallback."]}),"\n",(0,i.jsxs)(s,{children:[(0,i.jsxs)(t.h3,{id:"self",children:["self : ",(0,i.jsx)(l,{type:"dictionary"})]}),(0,i.jsx)(n,{children:(0,i.jsx)(t.p,{children:"The current slide self dictionary."})})]}),"\n",(0,i.jsxs)(t.p,{children:[(0,i.jsx)(t.strong,{children:"Returns:"})," ",(0,i.jsx)(l,{type:"array"})]})]})}function h(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,i.jsx)(t,{...e,children:(0,i.jsx)(l,{...e})}):l(e)}function p(e,t){throw new Error("Expected "+(t?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11151:(e,t,n)=>{n.d(t,{Z:()=>a,a:()=>o});var i=n(67294);const r={},s=i.createContext(r);function o(e){const t=i.useContext(s);return i.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function a(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:o(e.components),i.createElement(s.Provider,{value:t},e.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.