Open r0polach opened 3 years ago
I can confirm this, tested on Ubuntu 20.04. The error happens with pdflatex and lualatex, but not with xelatex. I think we're using babel with the former two and polyglossia with the latter, so this all points to a weird interaction between babel support for Czech. Call pandoc with --pdf-engine=xelatex
as a workaround.
Not sure if there is anything that can be done in pandoc. Could you raise the issue with the babel maintainers?
Interestingly, I get a different error when using TeXlive 2020:
! Missing \endcsname inserted.
<to be read again>
\unhbox
l.27 ... `\-one}{{}{1}{Chapter One}{section*.1}{}}
I also sometimes see different error message, depending probably on "how much" the code block is out of the page...
Unfortunatelly I cannot use xelatex, because I have important macro in lua, so I need lualatex...
Closing this now, as this seems to be a babel issue. I'd be happy to reopen if there is something that could be done in pandoc to work around it.
Could you please point me where I should fill a report about that?
I'm not sure, but https://github.com/latex3/babel would probably be the right place.
See also https://www.ctan.org/pkg/babel-czech
As described in https://github.com/latex3/babel/issues/132#issuecomment-845069695 and following comments, there are some workarounds. I am not sure, but maybe something could be incorporated in pandoc itself, so not all users affected by this are pushed to investigate the error solution for themselves individually?
Thanks @r0polach. Reopening while we investigate the proposed solutions.
We already have code that disables all language-specific shorthands in the default template. This is relatively recent, though. Have you tested with the latest version of pandoc?
Somehow that hadn't occur to me. I tested now, and everything works fine with the current development version.
Actually, I forgot that I had previously put a `\shorthandoff{-}`{=latex}
in the file that I used for testing. Without this, it still fails.
I like the solution you came up with @r0polach. It could be added to the default template, but it seems a bit too specific for that.
\usepackage{ifthen}
\ifthenelse{\equal{\language}{czech}}{\AtBeginDocument{\shorthandoff{-}}}{}%
This is an unfortunate situation, but I'm still not sure if this should be fixed in pandoc.
So, am I to understand that this code doesn't in fact get rid of all language-specific shorthands?
% get rid of language-specific shorthands (see #6817):
\let\LanguageShortHands\languageshorthands
\def\languageshorthands#1{}
That's my understanding as well.
I think we need the advice of a babel expert -- there must be a way to globally turn off language-specific shorthands. (I've posted on the linked babel thread.)
pandoc 2.11.4 for windows (x86_64), miktex 21.1 (x64)
When I run
pandoc test_input.txt -o test_output.pdf -f markdown --listings
on the attached file test_input.txt, I got following error:test_input.txt
It is caused by combination of two facts:
lang
iscs
.If I remove
lang: "cs"
or if the text flow does not push the listing on the edge of the page, then everything would be ok.