module E = Colitur_render.Escape let check = Alcotest.(check string) let test_latex () = check "ampersand" "\\&" (E.apply E.Latex "&"); check "percent" "\\%" (E.apply E.Latex "%"); check "underscore" "\\_" (E.apply E.Latex "_"); check "braces" "\\{\\}" (E.apply E.Latex "{}"); check "backslash first" "\\textbackslash{}" (E.apply E.Latex "\\"); (* A real feast name that would otherwise break a .tex build. *) check "real name" "Ss.mi Nominis Iesu \\& Mari\xc3\xa6" (E.apply E.Latex "Ss.mi Nominis Iesu & Mari\xc3\xa6") (* Typst's markup metacharacters, verified against the installed `typst` 0.14.2 binary rather than trusted from a spec list: a probe document escaping each one individually, `typst compile`'d and `pdftotext`'d back, confirmed the literal character survives (and, separately, that the UNescaped form really does something else -- #box[..] consumes a bare '#', *x* renders bold, @word errors "cannot reference text", a bare