PageSourceSearch

https://touying-typ.github.io/assets/js/afc470bc.94960937.js

js touying-typ.github.io collected 2026-10-03 10:06:40 UTC 6,153 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[1954],{23819:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>c,contentTitle:()=>s,default:()=>d,frontMatter:()=>o,metadata:()=>a,toc:()=>l});var r=i(85893),t=i(11151);const o={sidebar_position:6,description:"The configuration of the page layout.",toc_max_heading_level:2},s="config-page",a={id:"reference/configs/config-page",title:"config-page",description:"The configuration of the page layout.",source:"@site/docs/reference/configs/config-page.mdx",sourceDirName:"reference/configs",slug:"/reference/configs/config-page",permalink:"/docs/reference/configs/config-page",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6,description:"The configuration of the page layout.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"config-colors",permalink:"/docs/reference/configs/config-colors"},next:{title:"default-config",permalink:"/docs/reference/configs/default-config"}},c={},l=[{value:"paper : <TypeLink></TypeLink>",id:"paper",level:3},{value:"header : <TypeLink></TypeLink>",id:"header",level:3},{value:"footer : <TypeLink></TypeLink>",id:"footer",level:3},{value:"fill : <TypeLink></TypeLink>",id:"fill",level:3},{value:"margin : <TypeLink></TypeLink> | <TypeLink></TypeLink>",id:"margin",level:3},{value:"numbering : <TypeLink></TypeLink> | <TypeLink></TypeLink>",id:"numbering",level:3}];function h(e){const n={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,t.a)(),...e.components},{Param:i,Parameters:o,Signature:s,SignatureName:a,SignatureParam:c,SourceLink:l,TypeLink:h}=n;return i||p("Param",!0),o||p("Parameters",!0),s||p("Signature",!0),a||p("SignatureName",!0),c||p("SignatureParam",!0),l||p("SourceLink",!0),h||p("TypeLink",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"config-page",children:"config-page"}),"\n",(0,r.jsx)(s,{children:(0,r.jsxs)("code",{children:[(0,r.jsx)(a,{children:"config-page"}),"(",(0,r.jsxs)(c,{children:[(0,r.jsx)(n.a,{href:"#paper",children:"paper"}),", "]}),(0,r.jsxs)(c,{children:[(0,r.jsx)(n.a,{href:"#header",children:"header"}),", "]}),(0,r.jsxs)(c,{children:[(0,r.jsx)(n.a,{href:"#footer",children:"footer"}),", "]}),(0,r.jsxs)(c,{children:[(0,r.jsx)(n.a,{href:"#fill",children:"fill"}),", "]}),(0,r.jsxs)(c,{children:[(0,r.jsx)(n.a,{href:"#margin",children:"margin"}),", "]}),(0,r.jsxs)(c,{children:[(0,r.jsx)(n.a,{href:"#numbering",children:"numbering"}),", "]}),(0,r.jsx)(c,{children:(0,r.jsx)(n.a,{href:"#args",children:"..args"})}),")",(0,r.jsx)(l,{href:"https://github.com/touying-typ/touying/blob/main/src/configs.typ#L709"})]})}),"\n",(0,r.jsx)(n.p,{children:"The configuration of the page layout."}),"\n",(0,r.jsxs)(n.p,{children:["It is equivalent to the ",(0,r.jsx)(n.code,{children:"#set page()"})," rule in Touying."]}),"\n",(0,r.jsx)(n.p,{children:"Example:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-typst",children:'config-page(\n  paper: "presentation-16-9",\n  header: none,\n  footer: none,\n  fill: rgb("#ffffff"),\n  margin: (x: 3em, y: 2.8em),\n)\n'})}),"\n",(0,r.jsxs)(o,{children:[(0,r.jsxs)(n.h3,{id:"paper",children:["paper : ",(0,r.jsx)(h,{type:"str"})]}),(0,r.jsx)(i,{children:(0,r.jsxs)(n.p,{children:["A standard paper size to set width and height. The default value is ",(0,r.jsx)(n.code,{children:'"presentation-16-9"'}),". You can also use ",(0,r.jsx)(n.code,{children:"aspect-ratio"})," to set the aspect ratio of the paper."]})}),(0,r.jsxs)(n.h3,{id:"header",children:["header : ",(0,r.jsx)(h,{type:"content"})]}),(0,r.jsx)(i,{children:(0,r.jsx)(n.p,{children:"The page's header. Fills the top margin of each page."})}),(0,r.jsxs)(n.h3,{id:"footer",children:["footer : ",(0,r.jsx)(h,{type:"content"})]}),(0,r.jsx)(i,{children:(0,r.jsx)(n.p,{children:"The page's footer. Fills the bottom margin of each page."})}),(0,r.jsxs)(n.h3,{id:"fill",children:["fill : ",(0,r.jsx)(h,{type:"color"})]}),(0,r.jsx)(i,{children:(0,r.jsxs)(n.p,{children:["The background color of the page. The default value is ",(0,r.jsx)(n.code,{children:'rgb("#ffffff")'}),"."]})}),(0,r.jsxs)(n.h3,{id:"margin",children:["margin : ",(0,r.jsx)(h,{type:"length"})," | ",(0,r.jsx)(h,{type:"dictionary"})]}),(0,r.jsx)(i,{children:(0,r.jsxs)(n.p,{children:["The margin of the page. The default value is ",(0,r.jsx)(n.code,{children:"(x: 3em, y: 2.8em)"}),". - A single length: The same margin on all sides. - A dictionary: With a dictionary, the margins can be set individually. The dictionary can contain the following keys in order of precedence: - top: The top margin. - right: The right margin. - bottom: The bottom margin. - left: The left margin. - inside: The margin at the inner side of the page (where the binding is). - outside: The margin at the outer side of the page (opposite to the binding). - x: The horizontal margins. - y: The vertical margins. - rest: The margins on all sides except those for which the dictionary explicitly sets a size."]})}),(0,r.jsxs)(n.h3,{id:"numbering",children:["numbering : ",(0,r.jsx)(h,{type:"str"})," | ",(0,r.jsx)(h,{type:"function"})]}),(0,r.jsx)(i,{children:(0,r.jsxs)(n.p,{children:["The numbering style of the page. The default value is ",(0,r.jsx)(n.code,{children:'"1"'}),". The values for left and right are mutually exclusive with the values for inside and outside."]})})]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Returns:"})," ",(0,r.jsx)(h,{type:"dictionary"})]})]})}function d(e={}){const{wrapper:n}={...(0,t.a)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}function p(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}},11151:(e,n,i)=>{i.d(n,{Z:()=>a,a:()=>s});var r=i(67294);const t={},o=r.createContext(t);function s(e){const n=r.useContext(o);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:s(e.components),r.createElement(o.Provider,{value:n},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.