[Therion] Tex and language ?
Bruce Mutton
bruce at tomo.co.nz
Fri Sep 29 07:36:47 CEST 2017
I have also handled French/English maps by writing duplicate tex-map blocks of code, then toggling with two small changes.
# language en_UK
# copy LayoutExperimentalHeaderPlan
language fr
copy LayoutExperimentalHeaderPlan-fr
I imagine that what you are doing is similar. The user impact is OK, but I dislike this approach as it is wasteful writing and maintaining nearly identical blocks of code (especially for three or more languages). Mistakes and getting them out of sync is inevitable.
I would really like to have access to a tex 'language variable' in the manner you describe.
Bruce
-----Original Message-----
From: Therion [mailto:therion-bounces at speleo.sk] On Behalf Of Xavier Robert via Therion
Sent: Friday, 29 September 2017 11:56 AM
To: Therion <therion at speleo.sk>
Cc: Xavier Robert <xavier.robert at univ-grenoble-alpes.fr>
Subject: [Therion] Tex and language ?
Hi all,
I am currently working on maps that can be in french or in spanish.
The thing is that I wrote some tex macros to add items in the header, like « Synthèse : X Y ». Inside a code tex-map/endcode block, I define the term « synthèse » as : \newtoks\thsynth \thsynth={Synthèse }. This is the french word. All my macros are in a config file placed in a parent folder.
In that case, each time I change the language to spanish with the therion « language es » command that I use in my thconfig files, I also need to change the definition of \thsynth in my code tex-map/endcode block to \newtoks\thsynth \thsynth={Síntesis}.
Is there a way to add a condition on the language in the code tex-map/endcode block to avoid changing manually the config file?
In fact, I am looking for something like:
code tex-map
\if {language variable = es} \newtoks\thsynth \thsynth={Síntesis}
\elsif {language variable = fr} \newtoks\thsynth \thsynth={Synthèse }
\else \newtoks\thsynth \thsynth={Synthesys}
\fi
endcode
Thanks a lot for you lights,
Cheers,
Xavier
_______________________________________________
Therion mailing list
Therion at speleo.sk
https://mailman.speleo.sk/listinfo/therion
More information about the Therion
mailing list