I need to translate some reserved word of paragraph environment to my own language; like Chapter, Table of Content, Example, Bibliography, and some more. How do I achieve that? I'm using LyX in Linux. Book document class.
1 Answers
The general answer to this question is found in How to change the name of document elements like "Figure", "Contents", "Bibliography", "Appendix", etc.?, the relevant commands from that question can be added to the preamble, in Document --> Settings --> LaTeX preamble.
There are, however, a couple of things that need to be taken into account in LyX, if babel is used in the document:
Loading order
When LyX generates the complete preamble for the LaTeX file, it loads babel after the custom commands added by the user, in the document settings. As a result, if one adds e.g. \addto\captionsenglish{... it won't work, because those are commands defined by babel.
To circumvent this problem, one can use \AtBeginDocument to postpone the redefinitions to the position of \begin{document}, i.e. after the preamble, as mentioned in How to change bibliography to webography in lyx 2.0.2?. Hence, instead of e.g.
\addto\captionsenglish{%
...
}
use
\AtBeginDocument{%
\addto\captionsenglish{%
...
}}
I suppose that adding \usepackage{babel} to the Document --> Settings --> LaTeX preamble before the redefinitions is another option, but then babel is loaded twice.
Language name
In some cases, at least for Indonesian, the language name used in the LaTeX code is not the same as specified in the LyX document settings. When choosing Indonesian in the document settings, the name passed to babel is bahasa. This can be checked by looking at the complete source code generated by LyX, and checking the optional arguments for the document class, which is in the first line of code. With the default settings for the book class, and Indonesian as language, that line looks like
\documentclass[oneside,bahasa]{book}
Therefore, instead of
\AtBeginDocument{%
\addto\captionsindonesian{%
...
}}
you need
\AtBeginDocument{%
\addto\captionsbahasa{%
...
}}
- 206,688
Bable). – Daniel Jun 14 '13 at 09:10\documentclass[bahasa]{..., i.e. the name of the language used bybabelisbahasa, not Indonesian.\addto\captionsbahasashould work. – Torbjørn T. Jun 18 '13 at 05:51