LaTeX reader and writer: add support for soft hypens

The `\-` command is parsed as a soft hyphen character; likewise, the
character is written as that command when outputting LaTeX.
This commit is contained in:
Albert Krewinkel
2025-08-06 12:08:29 -07:00
committed by John MacFarlane
parent 0b140a9a98
commit 48e59436ec
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -281,6 +281,7 @@ charCommands = M.fromList
, ("_", lit "_")
, ("{", lit "{")
, ("}", lit "}")
, ("-", lit "\x00ad") -- soft hyphen
, ("qed", lit "\a0\x25FB")
, ("lq", return (str ""))
, ("rq", return (str ""))
+1
View File
@@ -134,6 +134,7 @@ stringToLaTeX context zs = do
']' -> emits "{]}" -- optional arguments
'\'' -> emitcseq "\\textquotesingle"
'\160' -> emits "~"
'\x00AD' -> emits "\\-" -- shy hyphen
'\x200B' -> emits "\\hspace{0pt}" -- zero-width space
'\x202F' -> emits "\\,"
'\x2026' | ligatures -> emitcseq "\\ldots"