jgm / pandoc

Universal markup converter
https://pandoc.org
Other
33.21k stars 3.3k forks source link

Generated ConTeXt fails to compile due to undefined control sequence startenumerate #7711

Closed vedranmiletic closed 2 years ago

vedranmiletic commented 2 years ago

Explain the problem.

Consider the following document.md:

1. a
1. b

Pandoc 2.16.1 generates the following ConTeXt

$ pandoc --to context -o document.tex document.md
\startenumerate[n,packed][stopper=.]
\item
  a
\item
  b
\stopenumerate

This fails to compile:

$ context document.tex 

resolvers       | formats | executing runner 'run luametatex format': /home/vedranmiletic/context/tex/texmf-linux-64/bin/luametatex --jobname="./document.tex" --fmt=/home/vedranmiletic/context/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.fmt --lua=/home/vedranmiletic/context/tex/texmf-cache/luametatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luametatex/cont-en.lui  --c:currentrun=1 --c:fulljobname="./document.tex" --c:input="./document.tex" --c:kindofrun=1 --c:maxnofruns=9 --c:texmfbinpath="/home/vedranmiletic/context/tex/texmf-linux-64/bin"
system          > 
system          > ConTeXt  ver: 2021.11.22 22:32 LMTX  fmt: 2021.11.23  int: english/english
system          > 
system          > 'cont-new.mkxl' loaded
open source     > level 1, order 1, name '/home/vedranmiletic/context/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system          > beware: some patches loaded from cont-new.mkiv
close source    > level 1, order 1, name '/home/vedranmiletic/context/tex/texmf-context/tex/context/base/mkxl/cont-new.mkxl'
system          > files > jobname './document', input './document.tex', result './document'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
open source     > level 1, order 2, name './document.tex'
tex error       > tex error on line 1 in file ./document.tex: Undefined control sequence \undefined 

<line 3.1> 
    \startenumerate
    [n,packed][stopper=.]

1 >>  \startenumerate[n,packed][stopper=.]
2     \item
3       a
4     \item
5       b
6     \stopenumerate
7     
The control sequence at the end of the top line of your error message was never
\def'ed. You can just continue as I'll forget about whatever was undefined.
mtx-context     | fatal error: return code: 256

Pandoc 2.9.2.1 generated the following:

\startitemize[n,packed][stopper=.]
\item
  a
\item
  b
\stopitemize

Pandoc version?

Pandoc 2.16.1 is downloaded from GitHub releases, 2.9.2.1 from Debian repos.

tarleb commented 2 years ago

The code that's necessary for this to work is in the default template. Use the --standalone (or -s) flag to make pandoc embed the converted document into the template, and use pandoc -D context to see the raw template.

See #5016 for more info on the change.

vedranmiletic commented 2 years ago

Yup, that's it. Thanks for your help.