1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[5149],{14084:(e,n,o)=>{o.r(n),o.d(n,{assets:()=>a,contentTitle:()=>s,default:()=>d,frontMatter:()=>i,metadata:()=>c,toc:()=>u});var t=o(85893),r=o(11151);const i={sidebar_position:6},s="Theorion",c={id:"integration/theorion",title:"Theorion",description:'Touying can work properly with the Theorion package, you can directly use the theorion package. Additionally, you can use #set heading(numbering: "1.1") to set numbering for sections and subsections.',source:"@site/docs/integration/theorion.md",sourceDirName:"integration",slug:"/integration/theorion",permalink:"/docs/integration/theorion",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/en/integration/theorion.md",tags:[],version:"current",sidebarPosition:6,frontMatter:{sidebar_position:6},sidebar:"tutorialSidebar",previous:{title:"Codly",permalink:"/docs/integration/codly"},next:{title:"Themes",permalink:"/docs/category/themes"}},a={},u=[{value:"Why <code>frozen-counters</code> is Required",id:"why-frozen-counters-is-required",level:2},{value:"Multiple Counter Types",id:"multiple-counter-types",level:2},{value:"Cosmos Styles",id:"cosmos-styles",level:2}];function h(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",p:"p",pre:"pre",strong:"strong",...(0,r.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"theorion",children:"Theorion"}),"\n",(0,t.jsxs)(n.p,{children:["Touying can work properly with the ",(0,t.jsx)(n.a,{href:"https://github.com/OrangeX4/typst-theorion",children:"Theorion"})," package, you can directly use the ",(0,t.jsx)(n.a,{href:"https://github.com/OrangeX4/typst-theorion",children:"theorion"})," package. Additionally, you can use ",(0,t.jsx)(n.code,{children:'#set heading(numbering: "1.1")'})," to set numbering for sections and subsections."]}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsxs)(n.strong,{children:["Note: To make animation commands like ",(0,t.jsx)(n.code,{children:"#pause"})," work properly with theorion, you need to use ",(0,t.jsx)(n.code,{children:"config-common(frozen-counters: (theorem-counter,))"})," to bind counters that need to be frozen."]})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:'#import "@preview/touying:0.7.4": *\n#import themes.university: *\n#import "@preview/numbly:0.1.0": numbly\n#import "@preview/theorion:0.6.0": *\n#import cosmos.clouds: *\n#show: show-theorion\n\n#show: university-theme.with(\n aspect-ratio: "16-9",\n config-common(frozen-counters: (theorem-counter,)), // freeze theorem counter for animation\n)\n\n#set heading(numbering: numbly("{1}.", default: "1.1"))\n\n= Theorems\n\n== Prime numbers\n\n#definition[\n A natural number is called a #highlight[_prime number_] if it is greater\n than 1 and cannot be written as the product of two smaller natural numbers.\n]\n#example[\n The numbers $2$, $3$, and $17$ are prime.\n @cor_largest_prime shows that this list is not exhaustive!\n]\n\n#pause\n\n#theorem(title: "Euclid")[\n There are infinitely many primes.\n]\n\n#pagebreak(weak: true)\n\n#proof[\n Suppose to the contrary that $p_1, p_2, dots, p_n$ is a finite enumeration\n of all primes. Set $P = p_1 p_2 dots p_n$. Since $P + 1$ is not in our list,\n it cannot be prime. Thus, some prime factor $p_j$ divides $P + 1$. Since\n $p_j$ also divides $P$, it must divide the difference $(P + 1) - P = 1$, a\n contradiction.\n]\n\n#corollary[\n There is no largest prime number.\n] <cor_largest_prime>\n#corollary[\n There are infinitely many composite numbers.\n]\n\n#theorem[\n There are arbitrarily long stretches of composite numbers.\n]\n\n#proof[\n For any $n > 2$, consider $\n n! + 2, quad n! + 3, quad ..., quad n! + n\n $\n]\n'})}),"\n",(0,t.jsx)(n.img,{alt:"Touying example output",src:o(8612).Z+"",width:"3440",height:"2937"}),"\n",(0,t.jsxs)(n.h2,{id:"why-frozen-counters-is-required",children:["Why ",(0,t.jsx)(n.code,{children:"frozen-counters"})," is Required"]}),"\n",(0,t.jsxs)(n.p,{children:["Touying renders each subslide by re-evaluating slide content. Without ",(0,t.jsx)(n.code,{children:"frozen-counters"}),", Theorion's internal ",(0,t.jsx)(n.code,{children:"theorem-counter"})," would increment on every subslide, causing theorem numbers to jump unexpectedly."]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.code,{children:"config-common(frozen-counters: (theorem-counter,))"})," tells Touying to capture the counter value at the start of each slide and restore it before rendering each subslide, so theorem numbers remain consistent across animation steps."]}),"\n",(0,t.jsx)(n.h2,{id:"multiple-counter-types",children:"Multiple Counter Types"}),"\n",(0,t.jsx)(n.p,{children:"If you also have figure counters that should be frozen:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"config-common(frozen-counters: (theorem-counter, counter(figure.where(kind: image))))\n"})}),"\n",(0,t.jsx)(n.h2,{id:"cosmos-styles",children:"Cosmos Styles"}),"\n",(0,t.jsxs)(n.p,{children:["Theorion ships with several visual styles. The example above uses ",(0,t.jsx)(n.code,{children:"cosmos.clouds"}),". Others include ",(0,t.jsx)(n.code,{children:"cosmos.fancy"}),", ",(0,t.jsx)(n.code,{children:"cosmos.aurora"}),", and more. See the ",(0,t.jsx)(n.a,{href:"https://github.com/OrangeX4/typst-theorion",children:"Theorion documentation"})," for details."]})]})}function d(e={}){const{wrapper:n}={...(0,r.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(h,{...e})}):h(e)}},8612:(e,n,o)=>{o.d(n,{Z:()=>t});const t=o.p+"assets/images/239a88ad-9c7e58b46968298f11e6edf86163f944.png"},11151:(e,n,o)=>{o.d(n,{Z:()=>c,a:()=>s});var t=o(67294);const r={},i=t.createContext(r);function s(e){const n=t.useContext(i);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),t.createElement(i.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.