LyXLanguage change in TOC/Listing

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Azergoth
Posts: 17
Joined: Thu Apr 16, 2015 10:12 am

Language change in TOC/Listing

Post by Azergoth »

Hi everyone!

I have a problem with the language of that titles of my listing.
I have inserted some lists as follows:

*Contents
*List of Figures
*Nomenclature
*List of Figures (FOR TESTING PURPOSES)

When I compile, everything works fine, excepted that the Nomenclature (title) appears in French ("Liste de Symboles").

In Lyx, if y select the 4 items and change the language, let's say to Dutch, everything changes correctly EXCEPTED the nomenclature, which STAYS in French!
I have tried to remove and to re add the Nomenclature, but it did not work.
I have also tried to apply "Language > Reset", but it did not work either.

Any idea how I could solve this?
Thanks :-)

I'm using LyX Version 2.1.3 on Mac

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Language change in TOC/Listing

Post by Johannes_B »

It is very likely that the name for the nomenclature is hard-coded in you preamble. Please search for nomname. If you cannot find that string, please make your document as minimal as possible, but still showing the issue and provide the lyx-file as well as the exported LaTeX-file.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Azergoth
Posts: 17
Joined: Thu Apr 16, 2015 10:12 am

Re: Language change in TOC/Listing

Post by Azergoth »

Thanks for your reply :-)

The temporary solution was to write it manually in the LaTeX preamble.

I located the problem, and it comes from the abstracts in 3 different languages (Dutch, English and French).

I'll attach a LyX and pdf to illustrate the problem.
(NB: I'm writing in Dutch)
This is the structure:
1) Dutch abstract, English abstract, French abstract

2) TOC (Inhoudshopgave, correct in Dutch), List of Figures (Lijst van afbeeldingen, also correct), Nomenclature (NOT correct!)

3) Some text
Attachments
Nom.pdf
pdf
(311.85 KiB) Downloaded 459 times
Nom.lyx
Lyx file
(5.06 KiB) Downloaded 462 times
Azergoth
Posts: 17
Joined: Thu Apr 16, 2015 10:12 am

Re: Language change in TOC/Listing

Post by Azergoth »

No clue?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Language change in TOC/Listing

Post by Johannes_B »

Apparently all our LyX helpers are on vacation.

I don't have an up to date LyX and cannot open the file, looking at it as plain text, i am pretty sure that your are switching to french for the abstract, but never back to dutch. That would mean that the hyphenation patterns in your whole document are wrong as well.
Can you export the file to LaTeX, so i can be sure about what i am saying?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Azergoth
Posts: 17
Joined: Thu Apr 16, 2015 10:12 am

Re: Language change in TOC/Listing

Post by Azergoth »

I added the .tex file.

It is true, I'm switching from Dutch to English, and then to French, but then I'm switching back to Dutch.
The firs two objects of TOC (Contents "Inhoudsopgave" and List of figures "Lijst van Afbeeldingen") are displayed correctly.
Attachments
Nom.lyx
(5.06 KiB) Downloaded 398 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Language change in TOC/Listing

Post by Johannes_B »

That is the LyX file once more ;-)


I suspect that the Names for ToC and LoF are hardcoded as well in your preamble. What does \languagename written in an ERT-box give mid-document?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Azergoth
Posts: 17
Joined: Thu Apr 16, 2015 10:12 am

Re: Language change in TOC/Listing

Post by Azergoth »

Ah crap :lol:

There it is ;-)
Attachments
Nom.tex
(2.71 KiB) Downloaded 467 times
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Language change in TOC/Listing

Post by Johannes_B »

LyX puts the languages as global options, so packages can pick it up. Package nomencl does no the french translation, but not the dutch translation.

Currently, the definitions for a language look like the following. Please contribute the dutch translation to the package by mailing them to the package maintainer.

Code: Select all

\DeclareOption{english}{%
  \def\eqdeclaration#1{, see equation\nobreakspace(#1)}%
  \def\pagedeclaration#1{, page\nobreakspace#1}%
  \def\nomname{Nomenclature}}
\DeclareOption{french}{%
  \def\eqdeclaration#1{, voir \'equation\nobreakspace(#1)}%
  \def\pagedeclaration#1{, page\nobreakspace#1}%
  \def\nomname{Liste des symboles}}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Azergoth
Posts: 17
Joined: Thu Apr 16, 2015 10:12 am

Re: Language change in TOC/Listing

Post by Azergoth »

Ok, thanks, I understand!

Now I also understand why I didn't see the error previously. Without the french abstract, Lyx used the English version of "nomenclature", which was also fine in Dutch ;-)
Post Reply