Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localization of toc-title and "figure" not working #1765

Closed
nylki opened this issue Nov 15, 2014 · 9 comments
Closed

localization of toc-title and "figure" not working #1765

nylki opened this issue Nov 15, 2014 · 9 comments

Comments

@nylki
Copy link

nylki commented Nov 15, 2014

Although I have set mainlang=german (or ngerman), the table of contents still renders as Contents instead of Inhaltsverzeichnis
Same for figures (figure instead of Abbildung)
I am using xelatex as latex engine. Is there anything I am missing?
Can I overwrite the strings in the template if it doesn't work natively?

thanks! :)

@jgm
Copy link
Owner

jgm commented Nov 16, 2014

+++ Tom Brewe [Nov 15 14 10:34 ]:

Although I have set mainlang=german (or ngerman), the table of contents still renders as Contents instead of Inhaltsverzeichnis
Same for figures (figure instead of Abbildung)
I am using xelatex as latex engine. Is there anything I am missing?
Can I overwrite the strings in the template if it doesn't work natively?

There is nothing in the template that says "Contents" -- that is
generated by xelatex itself. This seems to be a LaTeX issue; I am
not sure what is going on. (I assume you're using an up-to-date
version of pandoc?)

Try creating a simple latex file (pandoc -s -t latex -o my.tex --toc)
and then compiling it manually with xelatex. If the latex looks right
to you, and the answer isn't revealed by xelatex's error log, then
you might try on tex stack exchange.

@ousia
Copy link
Contributor

ousia commented Nov 16, 2014

Titles in other languages than English are translated by the babel package.

From default.latex:

\ifxetex
\usepackage{polyglossia}
\setmainlanguage{$mainlang$}
\else
\usepackage[shorthands=off,$lang$]{babel}
\fi

I think this is the reason why label localization doesn’t work with XeLaTeX.

BTW, @jgm, could you take a look at #1755?

@nylki
Copy link
Author

nylki commented Nov 16, 2014

I am using the version in the fedora repository, pandoc 1.12.3.3.
I just tested to export a simple markdown file as .tex and then compiling with pdflatex and xelatex manually. I think the issue was using -V mainlang=german instead of -V lang=german.
It works now, i think I changed to sometime to mainlang because lang wasn't working for other reasons. However I am closing this. thx for your help anyways!

@nylki nylki closed this as completed Nov 16, 2014
@ousia
Copy link
Contributor

ousia commented Nov 16, 2014

@nylki, my fault. I mixed packages.

But the weird thing is that \setmainlanguage for polyglossia seems to be defined by $mainlang, not by $lang. And this was changed long time ago (in 2012).

@jgm
Copy link
Owner

jgm commented Nov 17, 2014

+++ Pablo Rodríguez [Nov 16 14 04:41 ]:

@nylki, my fault. I mixed packages.

But the weird thing is that \setmainlanguage for polyglossia seems to be defined by $mainlang, not by $lang. And this was changed long time ago (in 2012).

This is strange indeed. I wonder if he's using a custom template,
perhaps without realizing it (if it's in ~/.pandoc/templates)?

@vladipus
Copy link
Contributor

I still don't get it. How should Contents and Figures be localized when using --latex-engine=xelatex ?

@jgm
Copy link
Owner

jgm commented May 18, 2016

@vladipus try setting lang: fr-FR or whatever language you want (use the standard codes) in your document's metadata. Pandoc has switched over to using standard language codes since this issue was last commented.

@nylki
Copy link
Author

nylki commented May 18, 2016

@vladipus to complement @jgm's comment, you would set the lang via -V, for example:
pandoc --latex-engine=xelatex yourfile.md -o yourfile.pdf -V lang=de --toc

@vladipus
Copy link
Contributor

Seems like this thingy is also mandatory for Cyrillics to work: https://github.com/jgm/pandoc-templates/pull/198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants