Dne čtvrtek 20. října 2022 v 10:06:23 UTC+2 uživatel Bastien Dumont napsal:
I don't understand either the rationale for \pandocSpace and \pandocLinebreak. Since Markdown and TeX agree on handling simple line breaks and repeated spaces like single spaces, in what cases would it be useful?
I was going to give an example of a Word document with the text Hello␣␣␣world! and show that it would produce the output Hello \pandocSpace{}\pandocSpace{}\pandocSpace{}world!, which would allow us to preserve the repeated spaces. Howover, running pandoc -i example.docx -t pandoc-to-markdown.lua produces Hello\pandocSpace{}world! as the output. This indicates that not only Markdown and TeX fold repeated spaces, but Pandoc's AST in general does. In that case, it seems reasonable to replace \pandocSpace{} with ␣ and \pandocLineBreak{} with ⤶ in the TeX output as John also suggested.
Thanks to the package xkeyval, the key-value argument could be handled quite easily in all formats that include Plain TeX.