PageSourceSearch

https://touying-typ.github.io/assets/js/f9dcd2cf.7be08da8.js

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

1"use strict";(self.webpackChunkdocs=self.webpackChunkdocs||[]).push([[2932],{1126:(e,t,o)=>{o.r(t),o.d(t,{assets:()=>l,contentTitle:()=>r,default:()=>d,frontMatter:()=>s,metadata:()=>c,toc:()=>a});var n=o(85893),i=o(11151);const s={sidebar_position:7},r="Custom Theme",c={id:"themes/custom",title:"Custom Theme",description:"If none of the built-in themes quite fits your needs, you have two options:",source:"@site/docs/themes/custom.md",sourceDirName:"themes",slug:"/themes/custom",permalink:"/docs/themes/custom",draft:!1,unlisted:!1,editUrl:"https://github.com/touying-typ/touying/tree/main/docs/en/themes/custom.md",tags:[],version:"current",sidebarPosition:7,frontMatter:{sidebar_position:7},sidebar:"tutorialSidebar",previous:{title:"Stargazer Theme",permalink:"/docs/themes/stargazer"},next:{title:"External Tools",permalink:"/docs/category/external-tools"}},l={},a=[{value:"Quick Modifications",id:"quick-modifications",level:2},{value:"Copying a Theme Locally",id:"copying-a-theme-locally",level:2}];function h(e){const t={a:"a",code:"code",h1:"h1",h2:"h2",img:"img",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",...(0,i.a)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(t.h1,{id:"custom-theme",children:"Custom Theme"}),"\n",(0,n.jsx)(t.p,{children:"If none of the built-in themes quite fits your needs, you have two options:"}),"\n",(0,n.jsxs)(t.ol,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Extend an existing theme"})," \u2014 copy a theme file locally and modify it."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Build a new theme from scratch"})," \u2014 implement your own ",(0,n.jsx)(t.code,{children:"xxx-theme"})," function."]}),"\n"]}),"\n",(0,n.jsxs)(t.p,{children:["Both approaches are described in detail in the ",(0,n.jsx)(t.a,{href:"/docs/tutorials/build-your-own-theme",children:"Build Your Own Theme"})," tutorial."]}),"\n",(0,n.jsx)(t.h2,{id:"quick-modifications",children:"Quick Modifications"}),"\n",(0,n.jsx)(t.p,{children:"For minor adjustments to an existing theme, you do not need to create a separate theme file. You can override individual settings inline:"}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.7.4": *\n#import themes.metropolis: *\n\n#show: metropolis-theme.with(\n  aspect-ratio: "16-9",\n  // Override the primary color\n  config-colors(primary: rgb("#1a6b8a")),\n  // Change the footer content\n  footer: self => self.info.author,\n  config-info(\n    title: [My Presentation],\n    author: [Author Name],\n    date: datetime.today(),\n  ),\n)\n\n#title-slide()\n\n= Section\n\n== Slide\n\nContent with the custom color.\n'})}),"\n",(0,n.jsx)(t.img,{alt:"Touying example output",src:o(66557).Z+"",width:"3440",height:"1966"}),"\n",(0,n.jsx)(t.h2,{id:"copying-a-theme-locally",children:"Copying a Theme Locally"}),"\n",(0,n.jsx)(t.p,{children:"To make deeper structural changes, copy the theme source file to your project:"}),"\n",(0,n.jsxs)(t.ol,{children:["\n",(0,n.jsxs)(t.li,{children:["Download the relevant file from ",(0,n.jsx)(t.code,{children:"themes/"})," in the Touying repository (e.g., ",(0,n.jsx)(t.code,{children:"themes/metropolis.typ"}),")."]}),"\n",(0,n.jsxs)(t.li,{children:["Change the import at the top from ",(0,n.jsx)(t.code,{children:'#import "../src/exports.typ": *'})," to ",(0,n.jsx)(t.code,{children:'#import "@preview/touying:0.7.4": *'}),"."]}),"\n",(0,n.jsx)(t.li,{children:"Import the local copy instead of the built-in theme."}),"\n"]}),"\n",(0,n.jsx)(t.pre,{children:(0,n.jsx)(t.code,{className:"language-typst",children:'#import "@preview/touying:0.7.4": *\n#import "metropolis.typ": *   // your local copy\n\n#show: metropolis-theme.with(\n  aspect-ratio: "16-9",\n  config-info(title: [Title]),\n)\n'})}),"\n",(0,n.jsxs)(t.p,{children:["You can now freely edit ",(0,n.jsx)(t.code,{children:"metropolis.typ"})," without affecting other projects."]})]})}function d(e={}){const{wrapper:t}={...(0,i.a)(),...e.components};return t?(0,n.jsx)(t,{...e,children:(0,n.jsx)(h,{...e})}):h(e)}},66557:(e,t,o)=>{o.d(t,{Z:()=>n});const n=o.p+"assets/images/402aee98-69f59286551b3d023900481c61e92856.png"},11151:(e,t,o)=>{o.d(t,{Z:()=>c,a:()=>r});var n=o(67294);const i={},s=n.createContext(i);function r(e){const t=n.useContext(s);return n.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}function c(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:r(e.components),n.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.