PageSourceSearch

https://touying-typ.github.io/assets/js/37963fef.3e27e4fe.js

js touying-typ.github.io collected 2026-10-03 10:07:01 UTC 6,244 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2722],{89997:(e,t,s)=>{s.r(t),s.d(t,{assets:()=>o,contentTitle:()=>a,default:()=>h,frontMatter:()=>i,metadata:()=>l,toc:()=>c});var n=s(85893),r=s(11151);const i={sidebar_position:23,description:"#alternatives is able to show contents sequentially in subslides.",toc_max_heading_level:2},a="alternatives",l={id:"reference/core/alternatives",title:"alternatives",description:"#alternatives is able to show contents sequentially in subslides.",source:"@site/docs/reference/core/alternatives.mdx",sourceDirName:"reference/core",slug:"/reference/core/alternatives",permalink:"/docs/reference/core/alternatives",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:23,frontMatter:{sidebar_position:23,description:"#alternatives is able to show contents sequentially in subslides.",toc_max_heading_level:2},sidebar:"tutorialSidebar",previous:{title:"alternatives-match",permalink:"/docs/reference/core/alternatives-match"},next:{title:"alternatives-fn",permalink:"/docs/reference/core/alternatives-fn"}},o={},c=[{value:"start : <TypeLink></TypeLink> <Default><code>auto</code></Default>",id:"start",level:3},{value:"repeat-last : <TypeLink></TypeLink> <Default><code>true</code></Default>",id:"repeat-last",level:3},{value:"position : <TypeLink></TypeLink> <Default><code>bottom + left</code></Default>",id:"position",level:3},{value:"stretch : <TypeLink></TypeLink> <Default><code>false</code></Default>",id:"stretch",level:3},{value:"at : <TypeLink></TypeLink> | <TypeLink></TypeLink> <Default><code>none</code></Default>",id:"at",level:3}];function d(e){const t={a:"a",code:"code",h1:"h1",h3:"h3",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components},{Default:s,Param:i,Parameters:a,Signature:l,SignatureName:o,SignatureParam:c,SourceLink:d,TypeLink:h}=t;return s||p("Default",!0),i||p("Param",!0),a||p("Parameters",!0),l||p("Signature",!0),o||p("SignatureName",!0),c||p("SignatureParam",!0),d||p("SourceLink",!0),h||p("TypeLink",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"alternatives",children:"alternatives"}),"\n",(0,n.jsx)(l,{children:(0,n.jsxs)("code",{children:[(0,n.jsx)(o,{children:"alternatives"}),"(",(0,n.jsxs)(c,{children:[(0,n.jsx)(t.a,{href:"#start",children:"start: auto"}),", "]}),(0,n.jsxs)(c,{children:[(0,n.jsx)(t.a,{href:"#repeat-last",children:"repeat-last: true"}),", "]}),(0,n.jsxs)(c,{children:[(0,n.jsx)(t.a,{href:"#position",children:"position: bottom + left"}),", "]}),(0,n.jsxs)(c,{children:[(0,n.jsx)(t.a,{href:"#stretch",children:"stretch: false"}),", "]}),(0,n.jsxs)(c,{children:[(0,n.jsx)(t.a,{href:"#at",children:"at: none"}),", "]}),(0,n.jsx)(c,{children:(0,n.jsx)(t.a,{href:"#args",children:"..args"})}),")",(0,n.jsx)(d,{href:"https://github.com/touying-typ/touying/blob/main/src/core.typ#L1979"})]})}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.code,{children:"#alternatives"})," is able to show contents sequentially in subslides."]}),"\n",(0,n.jsxs)(t.p,{children:["Example: ",(0,n.jsx)(t.code,{children:"#alternatives[Ann][Bob][Christopher]"}),' will show "Ann" in the first subslide, "Bob" in the second subslide, and "Christopher" in the third subslide.']}),"\n",(0,n.jsxs)(t.p,{children:["You can also use waypoint labels via the ",(0,n.jsx)(t.code,{children:"at"})," parameter:"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:"#alternatives(at: (<first>, <second>))[Content A][Content B]\n"})}),"\n",(0,n.jsxs)(a,{children:[(0,n.jsxs)(t.h3,{id:"start",children:["start : ",(0,n.jsx)(h,{type:"int"})," ",(0,n.jsx)(s,{children:(0,n.jsx)(t.code,{children:"auto"})})]}),(0,n.jsx)(i,{children:(0,n.jsxs)(t.p,{children:["The starting subslide number. Default is ",(0,n.jsx)(t.code,{children:"auto"}),"."]})}),(0,n.jsxs)(t.h3,{id:"repeat-last",children:["repeat-last : ",(0,n.jsx)(h,{type:"bool"})," ",(0,n.jsx)(s,{children:(0,n.jsx)(t.code,{children:"true"})})]}),(0,n.jsx)(i,{children:(0,n.jsxs)(t.p,{children:["Whether the last alternative should persist on all remaining subslides. Default is ",(0,n.jsx)(t.code,{children:"true"}),"."]})}),(0,n.jsxs)(t.h3,{id:"position",children:["position : ",(0,n.jsx)(h,{type:"alignment"})," ",(0,n.jsx)(s,{children:(0,n.jsx)(t.code,{children:"bottom + left"})})]}),(0,n.jsx)(i,{children:(0,n.jsxs)(t.p,{children:["The alignment of alternatives within the reserved space. Default is ",(0,n.jsx)(t.code,{children:"bottom + left"}),"."]})}),(0,n.jsxs)(t.h3,{id:"stretch",children:["stretch : ",(0,n.jsx)(h,{type:"bool"})," ",(0,n.jsx)(s,{children:(0,n.jsx)(t.code,{children:"false"})})]}),(0,n.jsx)(i,{children:(0,n.jsxs)(t.p,{children:["Whether to stretch all alternatives to the maximum width and height. Default is ",(0,n.jsx)(t.code,{children:"false"}),". Important: If you use a zero-length content like a context expression, you should set ",(0,n.jsx)(t.code,{children:"stretch: false"}),"."]})}),(0,n.jsxs)(t.h3,{id:"at",children:["at : ",(0,n.jsx)(h,{type:"none"})," | ",(0,n.jsx)(h,{type:"array"})," ",(0,n.jsx)(s,{children:(0,n.jsx)(t.code,{children:"none"})})]}),(0,n.jsx)(i,{children:(0,n.jsxs)(t.p,{children:["An array of waypoint labels (or waypoint markers like ",(0,n.jsx)(t.code,{children:"get-first(<label>)"}),") or subslide specs, one per body. When provided, each body is mapped to the corresponding waypoint range. This is an alternative to the sequential ",(0,n.jsx)(t.code,{children:"start"}),"-based numbering."]})})]}),"\n",(0,n.jsxs)(t.p,{children:[(0,n.jsx)(t.strong,{children:"Returns:"})," ",(0,n.jsx)(h,{type:"content"})]})]})}function h(e={}){const{wrapper:t}={...(0,r.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(d,{...e})}):d(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,s)=>{s.d(t,{Z:()=>l,a:()=>a});var n=s(67294);const r={},i=n.createContext(r);function a(e){const t=n.useContext(i);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:a(e.components),n.createElement(i.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.