diff --git a/.vscode/settings.json b/.vscode/settings.json index ec66279..fb81f7e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -20,6 +20,7 @@ "nixfmt", "nixos", "nixpkgs", + "noto", "opentype", "pagebreak", "pinit", @@ -42,7 +43,6 @@ "editor.defaultFormatter": "myriad-dreamin.tinymist" }, "tinymist.formatterMode": "typstyle", - "tinymist.exportPdf": "onSave", "[jsonc]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/devenv.nix b/devenv.nix index bc056f4..bf2f3e9 100644 --- a/devenv.nix +++ b/devenv.nix @@ -3,8 +3,8 @@ let fontsOverlay = import ( builtins.fetchTarball { - url = "https://github.com/pompydev/nix-google-fonts-overlay/archive/dfb84823efeb84314f8186cb2014edf05136b527.tar.gz"; - sha256 = "sha256:01cpfyzd4xl3a462jyn2xn22hn6i1my1svyag7926r3r2vmck24y"; + url = "https://github.com/pompydev/nix-google-fonts-overlay/archive/fc0690302d895d6813a51bcd918442f7dc9db49a.tar.gz"; + sha256 = "sha256:1mvhxl20vbccwzcr55ghlxnr8fnanbzh3jy7l4k2mzin4vmz4qan"; } ); in @@ -15,13 +15,16 @@ in nixd nixfmt-rfc-style + # fonts font-awesome_6 + google-fonts-noto-serif + google-fonts-noto-serif-kr ]; scripts.compile.exec = '' find src/ -name '*.typ' | while read file; do echo "Compiling $file" - typst compile --root . "$file" + typst compile --ignore-system-fonts --root . "$file" done echo Done! ''; @@ -31,6 +34,8 @@ in enable = true; fontPaths = [ "${pkgs.font-awesome_6}/share/fonts/opentype" + "${pkgs.google-fonts-noto-serif}/share/fonts/truetype" + "${pkgs.google-fonts-noto-serif-kr}/share/fonts/truetype" ]; }; } diff --git a/src/_lib/const.typ b/src/_lib/const.typ new file mode 100644 index 0000000..e6fb249 --- /dev/null +++ b/src/_lib/const.typ @@ -0,0 +1,5 @@ +#let page_width = 90mm +#let page_height = 140mm +#let page_margin = 5mm +#let default_font = ("Noto Serif", "Noto Serif KR") +#let default_font_size = 10pt diff --git a/src/chem/chem.typ b/src/chem/chem.typ index cc7858c..bdab97e 100644 --- a/src/chem/chem.typ +++ b/src/chem/chem.typ @@ -1,11 +1,13 @@ +#import "../_lib/const.typ": * #import "../_lib/cover.typ": cover #set page( - width: 90mm, - height: 140mm, - margin: 5mm, + width: page_width, + height: page_height, + margin: page_margin, numbering: "1", ) +#set text(font: default_font, size: default_font_size) #set list(marker: "•") #cover(name: "Chemistry", slug: "math") diff --git a/src/cs/cs.typ b/src/cs/cs.typ index 2d9451e..460a698 100644 --- a/src/cs/cs.typ +++ b/src/cs/cs.typ @@ -1,11 +1,13 @@ +#import "../_lib/const.typ": * #import "../_lib/cover.typ": cover #set page( - width: 90mm, - height: 140mm, - margin: 5mm, + width: page_width, + height: page_height, + margin: page_margin, numbering: "1", ) +#set text(font: default_font, size: default_font_size) #set list(marker: "•") #cover(name: "Computer Science", slug: "cs") diff --git a/src/ee/ee.typ b/src/ee/ee.typ index 8504c86..b71ab12 100644 --- a/src/ee/ee.typ +++ b/src/ee/ee.typ @@ -1,11 +1,13 @@ +#import "../_lib/const.typ": * #import "../_lib/cover.typ": cover #set page( - width: 90mm, - height: 140mm, - margin: 5mm, + width: page_width, + height: page_height, + margin: page_margin, numbering: "1", ) +#set text(font: default_font, size: default_font_size) #set list(marker: "•") #cover(name: "Electrical Engineering", slug: "ee") diff --git a/src/math/math.typ b/src/math/math.typ index 0a343f2..6ba4d74 100644 --- a/src/math/math.typ +++ b/src/math/math.typ @@ -1,14 +1,16 @@ +#import "../_lib/const.typ": * #import "../_lib/cover.typ": cover #import "@preview/fletcher:0.5.7" #import fletcher: diagram, node, edge #import "@preview/pinit:0.2.2": * #set page( - width: 90mm, - height: 140mm, - margin: 5mm, + width: page_width, + height: page_height, + margin: page_margin, numbering: "1", ) +#set text(font: default_font, size: default_font_size) #set list(marker: "•") #cover(name: "Mathematics", slug: "math") diff --git a/src/neuro/neuro.typ b/src/neuro/neuro.typ index b3b9f3b..ef6702f 100644 --- a/src/neuro/neuro.typ +++ b/src/neuro/neuro.typ @@ -1,11 +1,13 @@ +#import "../_lib/const.typ": * #import "../_lib/cover.typ": cover #set page( - width: 90mm, - height: 140mm, - margin: 5mm, + width: page_width, + height: page_height, + margin: page_margin, numbering: "1", ) +#set text(font: default_font, size: default_font_size) #set list(marker: "•") #cover(name: "Neuroscience", slug: "neuro") diff --git a/src/phy/phy.typ b/src/phy/phy.typ index dadcbd8..45a1c1c 100644 --- a/src/phy/phy.typ +++ b/src/phy/phy.typ @@ -1,11 +1,13 @@ +#import "../_lib/const.typ": * #import "../_lib/cover.typ": cover #set page( - width: 90mm, - height: 140mm, - margin: 5mm, + width: page_width, + height: page_height, + margin: page_margin, numbering: "1", ) +#set text(font: default_font, size: default_font_size) #set list(marker: "•") #cover(name: "Physics", slug: "phy")