Wandmalfarbe / pandoc-latex-template

A pandoc LaTeX template to convert markdown files to PDF or LaTeX.
BSD 3-Clause "New" or "Revised" License
6.01k stars 957 forks source link

Problem with babel lang in 2.1.0 #312

Closed eumesmamente closed 1 year ago

eumesmamente commented 1 year ago

With pandoc 2.8 I have the following problem:

pandoc cinema.md -o cinema_aula.pdf --from markdown+raw_tex --template ./eisvogel.latex  --filter pandoc-latex-environment --listings --number-sections -Vsecnumdepth=3 -V lang=gl-ES

Error producing PDF.
! Package babel Error: You haven't specified a language option.

See the babel package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.478 ...ry to proceed from here, type x to quit.}

I am using galician language. With a previous version it worked without problems with -V lang=gl-ES but now I have tried with galician, gl, in the command line and with lang: galician, lang:gl, lang: gl-ES in YAML but the problem persists. A bug or am I doing something wrong ?

Wandmalfarbe commented 1 year ago

In the upstream repository, there were some changes related to the document language:

I merged these changes into Eisvogel version 2.1.0. Are you using the latest Eisvogel version? Are you using the latest Pandoc version?

I can't reproduce your issue. Maybe you can attach the complete reproduction? My reproduction is attached and compiles just fine. The file output/document-eisvogel.tex confirms that Galician is used (in lines 108 and 126).

issue-312-language-galician.zip

eumesmamente commented 1 year ago

I reproduced de error again whith files from your zip...

./pandoc2-19-2 document.md -o document.md.pdf --from markdown+raw_tex --template ./default-2.19.2.latex  --filter pandoc-latex-environment --listings --number-sections -Vsecnumdepth=3 -V lang=gl-ES
Error producing PDF.
! Package babel Error: You haven't specified a language option.

See the babel package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.478 ...ry to proceed from here, type x to quit.}

./pandoc2-19-2 document.md -o document.md.pdf --from markdown+raw_tex --template ./eisvogel-2.1.0.tex  --filter pandoc-latex-environment --listings --number-sections -Vsecnumdepth=3 -V lang=gl-ES
Error producing PDF.
! Package babel Error: You haven't specified a language option.

See the babel package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.478 ...ry to proceed from here, type x to quit.}

Perhaps the problem is my old latex versión because Iḿ using unbuntu 18.04. Opening your latex generated file from zip with a latex editor I have dthe same issue when trying to generate a pdf:

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode

(/home/user/.cache/.fr-HgbA5K/issue-312-language-galician/output/.document-eisvogel.tex.swp
LaTeX2e <2017-04-15>
Babel <3.18> and hyphenation patterns for 11 language(s) loaded.
...
/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty
(/usr/share/texlive/texmf-dist/tex/generic/babel/switch.def)

/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty:478: Package babel Error: You haven't specified a language option.

See the babel package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.478 ...ry to proceed from here, type x to quit.}

/usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty:478:  ==> Fatal error
 occurred, no output PDF file produced!
Wandmalfarbe commented 1 year ago

I see that you get the error with the pandoc default template and with Eisvogel. So this looks like an outdated LaTeX distribution. Can you update to the lastest version and try again?

eumesmamente commented 1 year ago

No problem on ubuntu 20.04. Thanks.

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode

(/home/user/Documentos/issue-312-language-galician/issue-312-language-galician/output/.document-default.tex.swp
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
...
Output written on /home/user/.cache/gummi/.document-default.tex.pdf (2 pages,
 177288 bytes).
Transcript written on /home/user/.cache/gummi/.document-default.tex.log.