Feat: add code function

This commit is contained in:
2025-04-14 10:15:25 +08:00
parent 9315fd36fd
commit 5a290913a2
2 changed files with 10 additions and 6 deletions

1
functions/code.typ Normal file
View File

@@ -0,0 +1 @@
#let code = raw.with(block: true)

View File

@@ -1,4 +1,6 @@
#let document( #import "functions/code.typ": code
#let default(
title: "This is a title", title: "This is a title",
authors: (( authors: ((
name: "Yi-Ting Shih", name: "Yi-Ting Shih",
@@ -32,12 +34,13 @@
numbering: "1." numbering: "1."
) )
// Raw default
show raw: set text(
font: "Consolas",
size: 8pt,
)
// Code section default // Code section default
show raw: self => { show raw.where(block: true): self => {
set text(
font: "Consolas",
size: 8pt
)
block( block(
fill: luma(240), fill: luma(240),
inset: 8pt, inset: 8pt,