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",
authors: ((
name: "Yi-Ting Shih",
@@ -32,12 +34,13 @@
numbering: "1."
)
// Code section default
show raw: self => {
set text(
// Raw default
show raw: set text(
font: "Consolas",
size: 8pt
size: 8pt,
)
// Code section default
show raw.where(block: true): self => {
block(
fill: luma(240),
inset: 8pt,