Open thomasWeise opened 2 years ago
@thomasWeise I meet the same problem with you, did you solve it ?
Hi. Sorry, I do not know how to solve it :-( If you find a solution, please post it here ... because I don't know why it doesn't work
Can you try to replace the figureTitle
entry with this header-includes
in the metadata :
header-includes:
- |
```{=latex}
\AtBeginDocument{%
\addto\captionsenglish{\renewcommand{\figurename}{图}}
}
```
So your "book.md" should look like this :
---
CJKmainfont: Noto Sans CJK SC
header-includes:
- |
```{=latex}
\AtBeginDocument{%
\addto\captionsenglish{\renewcommand{\figurename}{图}}
}
```
...
![Somefigure](fig.png){#fig:fig}
@fig:fig
\AtBeginDocument{% \addto\captionsenglish{\renewcommand{\figurename}{图}} }
Thank you very much, it work. I add the code into templates file directly.
Great! It also works for me. To fix the same issue also for tables, I do
\AtBeginDocument{%
\addto\captionsenglish{\renewcommand{\figurename}{图}}%
\addto\captionsenglish{\renewcommand{\tablename}{表}}%
}%
This workaround solves the problem.
This will work as metadata define:
\AtBeginDocument{%
\addto\captionsenglish{\renewcommand{\figurename}{$figureTitle$}}
\addto\captionsenglish{\renewcommand{\tablename}{$tableTitle$}}
}
I am sorry to disturb your work. First of all, let me thank you for publishing the very nice
eisvogel.tex
template, which I am using very happily.It seems that
figureTitle
andtableTitle
may be ignored under XeLaTeX builds. I have two builds, one in German and one in Chinese. For both,figureTitle
andtableTitle
work completely fine when rendering to HTML, so it does not seem to be a core pandoc issue. When building topdf
using theeisvogel.tex
template, I have to select theXeLaTeX
pipeline for the Chinese version while using the default engine for the German one. The German version renders completely fine and produces a pdf where the figure and table captions contain the German words. The Chinese version, however, produces a pdf where the figure and table captions are the English terms "Figure" and "Table", respectively.Maybe I am doing something wrong here?
I have attached for you an archive with all three cases discussed above (xelatex + eisvogel: does not use proper figure caption, latex + eisvogel: uses proper figure captions, xelatex without eisvolge: uses proper figure caption):
problem_with_xelatex_and_captions.zip
(Side note: If
figureTitle
andtableTitle
actually do not work, maybelistingTitle
probably won't work either, but I did not test that yet.)Many thanks for your help. Thomas.
P.S.:
I first thought that this was an issue with
pandoc-crossref
, but it seems not to be the case, as the figure captions work well if I do not useeisvogel.tex
.