PageSourceSearch

https://touying-typ.github.io/assets/js/5a57e638.1c63aa9e.js

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

1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2143],{38811:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>d,contentTitle:()=>l,default:()=>h,frontMatter:()=>o,metadata:()=>r,toc:()=>a});var t=i(85893),s=i(11151);const o={sidebar_position:1},l="Simple Theme",r={id:"themes/simple",title:"Simple Theme",description:"This theme originates from Polylux, created by Andreas Kr\xf6pelin.",source:"@site/docs/themes/simple.md",sourceDirName:"themes",slug:"/themes/simple",permalink:"/docs/themes/simple",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/en/themes/simple.md",tags:[],version:"current",sidebarPosition:1,frontMatter:{sidebar_position:1},sidebar:"tutorialSidebar",previous:{title:"Themes",permalink:"/docs/category/themes"},next:{title:"Metropolis Theme",permalink:"/docs/themes/metropolis"}},d={},a=[{value:"Initialization",id:"initialization",level:2},{value:"Slide Function Family",id:"slide-function-family",level:2},{value:"Example",id:"example",level:2}];function c(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",hr:"hr",img:"img",li:"li",p:"p",pre:"pre",ul:"ul",...(0,s.a)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.h1,{id:"simple-theme",children:"Simple Theme"}),"\n",(0,t.jsxs)(n.p,{children:["This theme originates from ",(0,t.jsx)(n.a,{href:"https://polylux.dev/book/themes/gallery/simple.html",children:"Polylux"}),", created by Andreas Kr\xf6pelin."]}),"\n",(0,t.jsx)(n.p,{children:"Considered a relatively straightforward theme, you can use it to create simple slides and freely incorporate features you like."}),"\n",(0,t.jsx)(n.h2,{id:"initialization",children:"Initialization"}),"\n",(0,t.jsx)(n.p,{children:"You can initialize it using the following code:"}),"\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.simple: *\n\n#show: simple-theme.with(\n  aspect-ratio: "16-9",\n  footer: [Simple slides],\n)\n'})}),"\n",(0,t.jsxs)(n.p,{children:["The ",(0,t.jsx)(n.code,{children:"simple-theme"})," function accepts the following parameters:"]}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"aspect-ratio"}),': The aspect ratio of the slides, which can be "16-9" or "4-3", with a default of "16-9".']}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"header"}),": The content displayed in the header, with a default of ",(0,t.jsx)(n.code,{children:"utils.display-current-heading(sett
1ing: utils.fit-to-width.with(grow: false, 100%))"}),". You can also pass a function like ",(0,t.jsx)(n.code,{children:"self => self.info.title"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"header-right"}),": The content displayed on the right side of the header, with a default of ",(0,t.jsx)(n.code,{children:"self => self.info.logo"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer"}),": The content displayed in the footer, with a default of ",(0,t.jsx)(n.code,{children:"none"}),". You can also pass a function like ",(0,t.jsx)(n.code,{children:"self => self.info.author"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"footer-right"}),": The content displayed on the right side of the footer, with a default of ",(0,t.jsx)(n.code,{children:'context utils.slide-counter.display() + " / " + utils.last-slide-number'}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"primary"}),": The primary color of the theme, with a default of ",(0,t.jsx)(n.code,{children:"aqua.darken(50%)"}),"."]}),"\n",(0,t.jsxs)(n.li,{children:[(0,t.jsx)(n.code,{children:"subslide-preamble"}),": By default, it adds the subsection title to the current slide."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"slide-function-family",children:"Slide Function Family"}),"\n",(0,t.jsx)(n.p,{children:"The Simple theme provides a variety of custom slide functions:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#centered-slide(section: ..)[\n  ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["A slide with content centered, and the ",(0,t.jsx)(n.code,{children:"section"})," parameter can be used to create a new section."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#title-slide[\n  ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Similar to ",(0,t.jsx)(n.code,{children:"centered-slide"}),", this is provided for consistency with Polylux syntax."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#slide(\n  config: (:),\n  repeat: auto,\n  setting: body => body,\n  composer: cols,\n)[\n  ...\n]\n"})}),"\n",(0,t.jsx)(n.p,{children:"A default slide with headers and footers, where the header corresponds to the current section, and the footer is what you set."}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-typst",children:"#focus-slide(foreground: ..., background: ...)[\n  ...\n]\n"})}),"\n",(0,t.jsxs)(n.p,{children:["Used to draw attention, it optionally accepts a foreground color (defaulting to ",(0,t.jsx)(n.code,{children:"white"}),") and a background color (defaulting to ",(0,t.jsx)(n.code,{children:"auto"}),", i.e., ",(0,t.jsx)(n.code,{children:"self.colors.primary"}),")."]}),"\n",(0,t.jsx)(n.h2,{id:"example",children:"Example"}),"\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.simple: *\n\n#show: simple-theme.with(\n  aspect-ratio: "16-9",\n  footer: [Simple slides],\n)\n\n#title-slide[\n  = Keep it simple!\n  #v(2em)\n\n  Alpha #footnote[Uni Augsburg] #h(1em)\n  Bravo #footnote[Uni Bayreuth] #h(1em)\n  Charlie #footnote[Uni Chemnitz] #h(1em)\n\n  July 23\n]\n\n== First slide\n\n#lorem(20)\n\n#focus-slide[\n  _Focus!_\n\n  This is very important.\n]\n\n= Let\'s start a new section!\n\n== Dynamic slide\n\nDid you know that...\n\n#pause\n\n...you can see the current section at the top of the slide?\n'})}),"\n",(0,t.jsx)(n.img,{alt:"Touying example output",src:i(83352).Z+"",width:"3440",height:"2937"})]})}function h(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},83352:(e,n,i)=>{i.d(n,{Z:()=>t});const t=i.p+"assets/images/13662f16-3fa83b3693372fb028d3394b4fc77a03.png"},11151:(e,n,i)=>{i.d(n,{Z:()=>r,a:()=>l});var t=i(67294);const s={},o=t.createContext(s);function l(e){const n=t.useContext(o);return t.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function r(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:l(e.components),t.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.