diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..f8414f0 --- /dev/null +++ b/404.html @@ -0,0 +1,3 @@ + +
Once upon a time in a far away land all chapters began with these.
+ + + + + + + ++ Download: + ( source + | pdf + ) +
+ +\begin[papersize=a6]{document} +\nofolios +\use[module=packages.dropcaps] +\set[parameter=document.parskip,value=2bs] +\set[parameter=document.lskip,value=5en] +\set[parameter=document.rskip,value=5en] + +\dropcap[lines=2]{T}his paragraph has a pretty plain initial or drop cap. +It uses the default document font. +You didn’t really expect more detail with such a generic font choice, right? +This may be exactly what you want, especially with modern typesetting styles which tend towards the minimalist. + +\dropcap[lines=2,join=true]{\kern[width=-0.9en]“N}\font[features=+smcp]{ever say never,}” the saying goes. +Someday your dropcap may include leading punctuation \em{and} a hanging indent. +No worries. +All you have to do is guess and fudge. + +\dropcap[lines=3,join=true,standoff=1em]{A}nother paragraph shows off a different line count. +Also it uses a stand-off effect in lines following the opening. +This helps highlight the fact that the initial letter belongs to the first word. +The first line of text will be flush against the drop cap. +Each additional line spanned with be indented with an extra space. + +\end{document} ++ +
sile -o dropcaps-sile.pdf dropcaps-sile.sil
+ + Download: + ( source + | pdf + ) +
+ +#set page( + paper: "a6", +) +#set par( + justify: true, +) + +#import "@preview/droplet:0.1.0": dropcap + +#dropcap( + justify: true, + hanging-indent: 0pt, +)[ + This paragraph has a pretty plain initial or drop cap. + It uses the default document font. + You didn't really expect more detail with such a generic font choice, right? + This may be exactly what you want, especially with modern typesetting styles which tend towards the minimalist. +] + +// Letter workaround per https://github.com/EpicEricEE/typst-plugins/issues/2 +#dropcap( + justify: true, + hanging-indent: 0pt, + transform: letter => [#place(dx: -0.4em, sym.quote.l)#letter] +)[ + N#smallcaps[ever say never]," the saying goes. + Someday your dropcap may include leading punctuation _and_ a hanging indent. + No worries. + All you have to do is guess and fudge. +] + +#dropcap( + height: 3, + justify: true, + hanging-indent: 1em, +)[ + Another paragraph shows off a different line count. + Also it uses a stand-off effect in lines following the opening. + This helps highlight the fact that the initial letter belongs to the first word. + The first line of text will be flush against the drop cap. + Each additional line spanned with be indented with an extra space. +] ++ +
typst compile dropcaps-typst.typ dropcaps-typst.pdf
+ + Download: + ( source + | pdf + ) +
+ +\documentclass{article} +\usepackage[paperheight=148.5mm,paperwidth=105mm]{geometry} +\setlength{\parskip}{2\baselineskip} +\pagenumbering{gobble} +\usepackage{type1cm} +\usepackage{lettrine} +\begin{document} + +\lettrine[nindent=0sp]{T}{}his paragraph has a pretty plain initial or drop cap. +It uses the default document font. +You didn't really expect more detail with such a generic font choice, right? +This may be exactly what you want, especially with modern typesetting styles which tend towards the minimalist. + +\lettrine[lhang=.4,nindent=0sp]{``N}{ever say never,}'' the saying goes. +Someday your dropcap may include leading punctuation {and} a hanging indent. +No worries. +All you have to do is guess and fudge. + +\lettrine[lines=3,nindent=1em]{A}{}nother paragraph shows off a different line count. +Also it uses a stand-off effect in lines following the opening. +This helps highlight the fact that the initial letter belongs to the first word. +The first line of text will be flush against the drop cap. +Each additional line spanned with be indented with an extra space. + +\end{document} ++ +
xelatex -interaction=batchmode -halt-on-error -jobname data/dropcaps-xelatex dropcaps-xelatex.tex
+ + Download: + ( source + | pdf + ) +
+ +.PRINTSTYLE TYPESET +.PAGEWIDTH 297.675p +.PAGELENGTH 419.58p +.L_MARGIN 40p +.R_MARGIN 40p +.T_MARGIN 40p +.DROPCAP T 2 +his paragraph has a pretty plain initial or drop cap. +It uses the default document font. +You didn't really expect more detail with such a generic font choice, right? +This may be exactly what you want, especially with modern typesetting styles which tend towards the minimalist. + +.DROPCAP \*[FWD -.58m]``N 2 +.SMALLCAPS +ever say never\c +.SMALLCAPS OFF +,'' the saying goes. +Someday your dropcap may include leading punctuation +.FT I +and +.FT R +a hanging indent. +No worries. +All you have to do is guess and fudge. + +.DROPCAP_GUTTER 1m +.DROPCAP A 3 +\*[FWD -1m]nother paragraph shows off a different line count. +Also it uses a stand-off effect in lines following the opening. +This helps highlight the fact that the initial letter belongs to the first word. +The first line of text will be flush against the drop cap. +Each additional line spanned with be indented with an extra space. ++ +
groff -mom -T pdf dropcaps-groff.mom > dropcaps-groff.pdf
+ Hello World
+ diff --git a/hello-world-pagedjs.pdf b/hello-world-pagedjs.pdf new file mode 100644 index 0000000..e3bfd15 Binary files /dev/null and b/hello-world-pagedjs.pdf differ diff --git a/hello-world-satysfi.avif b/hello-world-satysfi.avif new file mode 100644 index 0000000..5939f1c Binary files /dev/null and b/hello-world-satysfi.avif differ diff --git a/hello-world-satysfi.pdf b/hello-world-satysfi.pdf new file mode 100644 index 0000000..bc70bdb Binary files /dev/null and b/hello-world-satysfi.pdf differ diff --git a/hello-world-satysfi.saty b/hello-world-satysfi.saty new file mode 100644 index 0000000..d404abd --- /dev/null +++ b/hello-world-satysfi.saty @@ -0,0 +1,8 @@ +@require: stdjareport + +document(| + title = {}; + author = {}; +|) '< + +p{Hello World} +> diff --git a/hello-world-sile.avif b/hello-world-sile.avif new file mode 100644 index 0000000..8565178 Binary files /dev/null and b/hello-world-sile.avif differ diff --git a/hello-world-sile.pdf b/hello-world-sile.pdf new file mode 100644 index 0000000..a58cddd Binary files /dev/null and b/hello-world-sile.pdf differ diff --git a/hello-world-sile.sil b/hello-world-sile.sil new file mode 100644 index 0000000..db38d74 --- /dev/null +++ b/hello-world-sile.sil @@ -0,0 +1,3 @@ +\begin{document} +Hello World +\end{document} diff --git a/hello-world-typst.avif b/hello-world-typst.avif new file mode 100644 index 0000000..75b9816 Binary files /dev/null and b/hello-world-typst.avif differ diff --git a/hello-world-typst.pdf b/hello-world-typst.pdf new file mode 100644 index 0000000..8acd3a6 Binary files /dev/null and b/hello-world-typst.pdf differ diff --git a/hello-world-typst.typ b/hello-world-typst.typ new file mode 100644 index 0000000..17d3f06 --- /dev/null +++ b/hello-world-typst.typ @@ -0,0 +1,3 @@ +#set page (numbering: "1") + +Hello World diff --git a/hello-world-weasyprint.avif b/hello-world-weasyprint.avif new file mode 100644 index 0000000..8a9994e Binary files /dev/null and b/hello-world-weasyprint.avif differ diff --git a/hello-world-weasyprint.html b/hello-world-weasyprint.html new file mode 100644 index 0000000..96a0f94 --- /dev/null +++ b/hello-world-weasyprint.html @@ -0,0 +1,12 @@ + + + + +Hello World
+ diff --git a/hello-world-weasyprint.pdf b/hello-world-weasyprint.pdf new file mode 100644 index 0000000..5bec127 Binary files /dev/null and b/hello-world-weasyprint.pdf differ diff --git a/hello-world-xelatex.avif b/hello-world-xelatex.avif new file mode 100644 index 0000000..58dd127 Binary files /dev/null and b/hello-world-xelatex.avif differ diff --git a/hello-world-xelatex.pdf b/hello-world-xelatex.pdf new file mode 100644 index 0000000..8768e2f Binary files /dev/null and b/hello-world-xelatex.pdf differ diff --git a/hello-world-xelatex.tex b/hello-world-xelatex.tex new file mode 100644 index 0000000..d27547b --- /dev/null +++ b/hello-world-xelatex.tex @@ -0,0 +1,4 @@ +\documentclass{article} +\begin{document} +Hello World +\end{document} diff --git a/hello-world/index.html b/hello-world/index.html new file mode 100644 index 0000000..8c4a3e8 --- /dev/null +++ b/hello-world/index.html @@ -0,0 +1,451 @@ + + + + +Just the simplest way to get a phrase onto a numbered page.
+The page size, font face, margins, and everything else should be the defaults. +The only non-default addition to the minimal way to get text on a page is adding a folio in the simplest way possible. +The position of the folio may vary depending on defaults, but if an explicit position is required use bottom center.
+ + + + + + + +A Rosetta stone for typesetting engines.
+This project's goal is to provide a chrestomathy for typesetting similar to what Rosetta Code does for programming languages. +The samples here are designed to compare and/or contrast the approaches taken to various typesetting situations by different typesetting engines.
+The emphasis is less on document markup languages, programming languages, or actual content and more on the way layout and orthographic features are achieved. +Sometimes similar input will produce very different outputs. +Sometimes similar output is achieved with very different inputs. +Some engines are more suited to tackling specific problems that others.
+New samples are always welcome, including for any single engine. +Adding support for current samples in additional engines is also welcome. +Improvements to the current samples may be considered if they are more idiomatic or useful as examples. +Alternative samples from the current engines may also be considered if they demonstrate some contrast or similarity with a different engine.
+Contributions may be submitted as as pull requests to the GitHub project.
+All input samples are rendered remotely in CI and used to create the static site. +Contributions may be made just by editing or adding input samples.
+If you do want to test render them locally you can build the site just like it is done in CI.
+The only thing required to build the samples in this repository locally is a working nix
installation (not the OS, just the package manager).
+Once you have a working nix
executable, building the examples can be done with:
$ nix-shell --pure --run 'make all'
+
+To generate the static version of the website and serve it locally for testing, try:
+$ nix-shell --pure --run 'make serve'
+
+This will print out a localhost address for you to browse to and stay running serving the current version of the site.
+Some resources will automatically update and refresh while the sever is running.
+For the rendered examples running make all
in another terminal should update the images and the site will refresh.
Compare the baseline alignment of integrals.
+aka. What's up must come down.
+ + + + + + + ++ Download: + ( source + | pdf + ) +
+ +\begin{document} +\use[module=packages.math] +\set[parameter=math.font.family,value=Libertinus Math] + +\begin[mode=display]{math} + \sum_{k=0}^\infty \int_{0}^\infty e^{-kx^2}\,\mo{d}x +\end{math} + +\end{document} ++ +
sile -o integral-alignment-sile.pdf integral-alignment-sile.sil
+ + Download: + ( source + | pdf + ) +
+ +\documentclass{article} +\usepackage{unicode-math} +\setmathfont{Libertinus Math} + +\begin{document} + \[ + \sum_{k=0}^\infty \int_0^\infty e^{-kx^2}\,\symup{d}x + \] +\end{document} ++ +
xelatex -interaction=batchmode -halt-on-error -jobname data/integral-alignment-xelatex integral-alignment-xelatex.tex
+ + An A7 page with 1cm margins and 1cm paragraph indentation. +
+ diff --git a/page-geometry-pagedjs.pdf b/page-geometry-pagedjs.pdf new file mode 100644 index 0000000..8e0d99f Binary files /dev/null and b/page-geometry-pagedjs.pdf differ diff --git a/page-geometry-sile.avif b/page-geometry-sile.avif new file mode 100644 index 0000000..13e0e39 Binary files /dev/null and b/page-geometry-sile.avif differ diff --git a/page-geometry-sile.pdf b/page-geometry-sile.pdf new file mode 100644 index 0000000..adf25a4 Binary files /dev/null and b/page-geometry-sile.pdf differ diff --git a/page-geometry-sile.sil b/page-geometry-sile.sil new file mode 100644 index 0000000..1ac3dbd --- /dev/null +++ b/page-geometry-sile.sil @@ -0,0 +1,8 @@ +\begin[papersize=a7]{document} +\nofolios +\begin[first-content-frame=content]{pagetemplate} +\frame[id=content,left=1cm,right=right(page)-1cm,top=1cm,bottom=bottom(page)-1cm] +\end{pagetemplate} +\set[parameter=document.parindent,value=1cm] +An A7 page with 1cm margins and 1cm paragraph indentation. +\end{document} diff --git a/page-geometry-typst.avif b/page-geometry-typst.avif new file mode 100644 index 0000000..252feea Binary files /dev/null and b/page-geometry-typst.avif differ diff --git a/page-geometry-typst.pdf b/page-geometry-typst.pdf new file mode 100644 index 0000000..c57b9ae Binary files /dev/null and b/page-geometry-typst.pdf differ diff --git a/page-geometry-typst.typ b/page-geometry-typst.typ new file mode 100644 index 0000000..5992ce6 --- /dev/null +++ b/page-geometry-typst.typ @@ -0,0 +1,12 @@ +#set page( + paper: "a7", + margin: 1cm, +) +#set par( + first-line-indent: 1cm, + justify: true, +) +// Note the manual glue node here is a hack around first +// paragraph in block not respecting first-line-indent: +// https://github.com/typst/typst/issues/311 +#h(1cm)An A7 page with 1cm margins and 1cm paragraph indentation. diff --git a/page-geometry-xelatex.avif b/page-geometry-xelatex.avif new file mode 100644 index 0000000..b4ac27a Binary files /dev/null and b/page-geometry-xelatex.avif differ diff --git a/page-geometry-xelatex.pdf b/page-geometry-xelatex.pdf new file mode 100644 index 0000000..9e8c2fa Binary files /dev/null and b/page-geometry-xelatex.pdf differ diff --git a/page-geometry-xelatex.tex b/page-geometry-xelatex.tex new file mode 100644 index 0000000..0a27ecc --- /dev/null +++ b/page-geometry-xelatex.tex @@ -0,0 +1,8 @@ +\documentclass{article} +\usepackage[paperheight=105mm,paperwidth=74mm,margin=1cm]{geometry} +\pagenumbering{gobble} +\usepackage{indentfirst} +\setlength{\parindent}{1cm} +\begin{document} +An A7 page with 1cm margins and 1cm paragraph indentation. +\end{document} diff --git a/page-geometry/index.html b/page-geometry/index.html new file mode 100644 index 0000000..b1ff03e --- /dev/null +++ b/page-geometry/index.html @@ -0,0 +1,397 @@ + + + + +An A7 page with 1cm margins and 1cm paragraph indentation.
+ + + + + + + ++ Download: + ( source + | pdf + ) +
+ +\begin[papersize=a7]{document} +\nofolios +\begin[first-content-frame=content]{pagetemplate} +\frame[id=content,left=1cm,right=right(page)-1cm,top=1cm,bottom=bottom(page)-1cm] +\end{pagetemplate} +\set[parameter=document.parindent,value=1cm] +An A7 page with 1cm margins and 1cm paragraph indentation. +\end{document} ++ +
sile -o page-geometry-sile.pdf page-geometry-sile.sil
+ + Download: + ( source + | pdf + ) +
+ +#set page( + paper: "a7", + margin: 1cm, +) +#set par( + first-line-indent: 1cm, + justify: true, +) +// Note the manual glue node here is a hack around first +// paragraph in block not respecting first-line-indent: +// https://github.com/typst/typst/issues/311 +#h(1cm)An A7 page with 1cm margins and 1cm paragraph indentation. ++ +
typst compile page-geometry-typst.typ page-geometry-typst.pdf
+ + Download: + ( source + | pdf + ) +
+ +\documentclass{article} +\usepackage[paperheight=105mm,paperwidth=74mm,margin=1cm]{geometry} +\pagenumbering{gobble} +\usepackage{indentfirst} +\setlength{\parindent}{1cm} +\begin{document} +An A7 page with 1cm margins and 1cm paragraph indentation. +\end{document} ++ +
xelatex -interaction=batchmode -halt-on-error -jobname data/page-geometry-xelatex page-geometry-xelatex.tex
+ + Download: + ( source + | pdf + ) +
+ +<html> + <head> + <style> + @page { + size: A7; + /* Work around a bug in paged.js, if bleed is not specified the + paper size doesn't fully take effect: + https://gitlab.coko.foundation/pagedjs/pagedjs/-/issues/450 */ + bleed: 0; + margin: 1cm; + } + p { + text-indent: 1cm; + text-align: justify; + } + </style> + </head> + <p> + An A7 page with 1cm margins and 1cm paragraph indentation. + </p> +</html> ++ +
pagedjs-cli -i page-geometry-pagedjs.html -o page-geometry-pagedjs.pdf
+ Assorted ways of entering and rendering the troublesome prime symbol.
+One issue is in math mode. +A typesetter has to account for how different fonts position their prime symbols.
+Another problem crops up in text where quotes marks get used for things like feet and inch units in lengths or minute and second units in lattitude and longitude cordinates. +It should be possible to not trigger smart quotes in these cases.
+ + + + + + + ++ Download: + ( source + | pdf + ) +
+ +#set page( + paper: "a7", + margin: 4mm, +) +#set text( + font: "Libertinus Serif", + size: 12pt, +) +#show par: set block(spacing: 1em) +#show math.equation: set block(spacing: .8em) +#show math.equation: set par(leading: .4em) + +Math mode manners: + +#[ + #show math.equation: set text(font: "STIX Two Math", size: 16pt) + $ + f(x) &= x^2 + 1 \ + f'(x) &= 2 x + $ +] + +#[ + #show math.equation: set text(font: "Libertinus Math", size: 16pt) + $ + f(x) &= x^2 + 1 \ + f'(x) &= 2 x + $ +] + +Prose poses problems: + +60*10'16"N 24*55'52"E (plain)\ +60°10′16″N 24°55′52″E (unicode)\ +60#[#sym.degree]10#[#sym.prime]16#[#sym.prime.double]N 24#[#sym.degree]55#[#sym.prime]52#[#sym.prime.double]E (native)\ ++ +
typst compile prime-symbol-typst.typ prime-symbol-typst.pdf
+ + Download: + ( source + | pdf + ) +
+ +\begin[papersize=a7]{document} +\nofolios +\neverindent +\font[family=Libertinus Serif,size=12pt] +\use[module=packages.math] +\set[parameter=math.font.size,value=16] + +Math mode manners: + +\set[parameter=math.font.family,value=STIX Two Math] +\begin[mode=display]{math} + \table[columnalign=right left]{ + f(x) &= x^2 + 1 \\ + f\prime(x) &= 2x + } +\end{math} + +\set[parameter=math.font.family,value=Libertinus Math] +\begin[mode=display]{math} + \table[columnalign=right left]{ + f(x) &= x^2 + 1 \\ + f\prime(x) &= 2x + } +\end{math} + +Prose poses problems: +\medskip + +\begin{raggedright} + 60*10'16"N 24*55'52"E (plain)\break + 60°10′16″N 24°55′52″E (unicode)\break + 60°10′16″N 24°55′52″E (native) +\end{raggedright} + +\end{document} ++ +
sile -o prime-symbol-sile.pdf prime-symbol-sile.sil
+ + Download: + ( source + | pdf + ) +
+ +\documentclass{article} +\usepackage[paperheight=105mm,paperwidth=74mm,margin=4mm]{geometry} +\pagenumbering{gobble} +\setlength{\parindent}{0pt} +\usepackage{libertinus} +\usepackage{fontspec} +\usepackage{relsize} +\usepackage{unicode-math} +\begin{document} +\fontsize{12}{16} +\selectfont + +Math mode manners: +\setmathfont{STIX Two Math} +\[\mathlarger{\begin{aligned} + f(x) & = x^{2} + 1 \\ + f\prime(x) & = 2x +\end{aligned}}\] + +\setmathfont{Libertinus Math} +\[\mathlarger{\begin{aligned} + f(x) & = x^{2} + 1 \\ + f\prime(x) & = 2x +\end{aligned}}\] + +Prose poses problems: +\smallskip + +\raggedright{ + 60*10'16"N 24*55'52"E (plain)\break + 60°10′16″N 24°55′52″E (unicode)\break + 60\textdegree{}10\ensuremath{\prime}16\ensuremath{\dprime}N 24\textdegree{}55\ensuremath{\prime}52\ensuremath{\dprime}E (native) +} + +\end{document} ++ +
xelatex -interaction=batchmode -halt-on-error -jobname data/prime-symbol-xelatex prime-symbol-xelatex.tex
+ + Download: + ( source + | pdf + ) +
+ +.nr HM .4cm +.nr PO .4cm +.nr LL 6.2cm +.nr PI 0 +.nr PS 12p +.nr VS 18p +\# TODO convert OpenType fonts to something groff can use +.fam P +.LP +Math mode manners: +.LG +.LG +.EQ C +f(x) mark = x sup 2 + 1 +.EN +.LG +.LG +.EQ C +f'(x) lineup = 2x +.EN +\# TODO complete prime input test with two fonts +.LP +Prose poses problems: +.LP +60*10'16"N 24*55'52"E (plain) +.br +60°10′16″N 24°55′52″E (unicode) +.br +60\[de]10\[fm]16\[sd]N 24\[de]55\[fm]52\[sd]E (native) ++ +
groff -ms -e -P-pA7 -T pdf prime-symbol-groff.ms > prime-symbol-groff.pdf
+