Wandmalfarbe / pandoc-latex-template

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

Change name for figures and alike according to language #375

Open L4ckadaisy opened 8 months ago

L4ckadaisy commented 8 months ago

I can't figure out how to effectively change the language of my exported document, so that all elements are actually in the selected language.
If I set lang: it in the properties, I get \babelprovide[main,import]{italian} in the tex file, which I assume means that the language has been correctly set.

What I don't understand is why, despite this, i also find

\AtBeginDocument{%
\renewcommand*\figurename{Figure}
\renewcommand*\tablename{Table}
}
\AtBeginDocument{%
\renewcommand*\listfigurename{List of Figures}
\renewcommand*\listtablename{List of Tables}

which forces the naming of figures and tables to be set to the original english. I seem to gather that this output comes from the {caption} package. If I delete these lines from the .tex exported file and compile that, the name for the figure changes correctly according to the set language (in my case "Figura", in italian, and not "Figure" anymore).

What is forcing this renewcommand, and how can I prevent it?

Thank you in advance

L4ckadaisy commented 8 months ago

Nevermind, I figured out it wasn't due to {caption} but rather pandoc-crossref. Here I found the solution.