From b254c23c56a113bdcdb89f1f7917352baaa1cf0a Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 27 Sep 2026 20:40:20 -0400 Subject: typst output --typist & --pdf that makes the pdf typst provides a new pdf build path replacing latex as the primary pdf builder. --typst (--typ) writes the .typ; --pdf writes the .typ and compiles it by spawning `typst compile`. (--pdf is redefined, being typst to pdf rather than latex). --latex is unchanged and writes the .tex; One .typ per document-language (not one per paper size). The paper and the orientation are read from sys.inputs with a default, so the same file compiles to every paper --set-papersize asks for, the pdfs keep their original names. Spine's paper names (derived from what suited latex) and typst's are different vocabularies and are mapped; a paper typst does not have is named and skipped. With the flag --pdf spine invokes a typesetter to generate the pdf output directly, which is new (the latex path writes a .tex and leaves xelatex to the caller). If typst is not available on the machine it is reported absent, naming the binary and printing the command, and the run continues, the .typ is written. Several useful features of an object-centric pdf are easily met, usually being a few lines each. - The object number goes in the margin as one `place` at a coordinate inside the object's own block, carrying the label every citation points at. - A note is a real footnote at the point of reference, with the document's own number and one link back to the object. - The table of contents locates by object number rather than by page, so it holds true across every paper and every setting. That typst compiles silently across the sample set means every internal link in every document resolves (--pdf over the collection with two paper sizes gives 144 pdfs, none skipped and none failed, each the page size its name claims and each tagged). paths: .typ, pdf named in same way as .tex based built pdfs so site linkage works either way flake.nix: added a typst dev shell, for .typ pdf typesetter - dsh-typst-pdf providing a pdf typsetter for spine's .typ. - dsh-latex-pdf provides xelatex for .tex which can still be written. (assisted by Claude-Code) --- flake.nix | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index c4f97f0..897fbd7 100644 --- a/flake.nix +++ b/flake.nix @@ -211,6 +211,17 @@ jing ]; }; + dsh-typst-pdf = mkDevShell { + pkgs = pkgs-nix; + name = "spine-${version} dev shell for latex & pdf output"; + compiler = pkgs-nix.ldc; + extraPackages = with pkgs-nix; [ + typst + #typstyle + #typst-live + #typstwriter + ]; + }; dsh-latex-pdf = mkDevShell { pkgs = pkgs-nix; name = "spine-${version} dev shell for latex & pdf output"; @@ -232,7 +243,7 @@ litecli visidata sqlitebrowser - #letos + letos dbeaver-bin ]; }; @@ -261,6 +272,7 @@ html-tidy # the scroll html, which epubcheck never sees # pdf poppler-utils # pdfinfo, pdftotext + typst #texliveFull # NOT texlive.combined.scheme-full: deprecated, file # what a file is ]; @@ -274,6 +286,7 @@ # re-execs itself into a nix shell that has them sqlite-interactive # readline cli; base sqlite has none #datasette # serves an .ocda.db as a browsable, queryable web page with a json api, one command, no configuration + letos epubcheck diffoscope # diffs two epubs, two odts or two pdfs by content rather (than as bytes) (useful when output moves and cmp only says "differ") unzip # containers: every one spine writes is a zip @@ -286,7 +299,8 @@ #jing # pdf poppler-utils # pdfinfo, pdftotext - texliveFull # NOT texlive.combined.scheme-full: deprecated, + typst + #texliveFull # NOT texlive.combined.scheme-full: deprecated, file # what a file is coreutils # sha256sum and numfmt guaranteed, for checking a digests.txt line by hand po4a -- cgit v1.2.3