You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to write an article in two languages simultaneously using babel. I need to define some acronyms that usually have a definition in both languages but use the same short acronym. I have defined the following command to switch between languages quickly:
Using TeX Live for windows with acro version 61762 (3.7), babel version 62203 (3.73). Compiling with pdflatex and biber.
1st issue: Trying to use command withing foreign-babel does not get expanded
Example that does not work:
\DeclareAcronym{gpu}{
short = GPU ,
long = {\langsubs{graphics processing unit}{unitat de procés gràfic}} ,
long-plural-form = {\langsubs{}{unitats de procés gràfic}} ,
foreign = {\langsubs{}{graphics processing unit}},
foreign-babel = {\langsubs{}{english}} ,
}
Error output:
c:/Users/creep/OneDrive/.tfg/build/main.tex:43: Package babel Error: You haven't defined the language '\langsubs {}{english}' yet.
(babel) Perhaps you misspelled it or your installation
(babel) is not complete.
See the babel package documentation for explanation.
Type H <return> for immediate help.
...
Expected outcome
I would expect that ACRO could expand the command like the other commands do just fine, since babel can't recognize \langsubs {}{english}.
2nd issue: Empty foreign makes empty parentheses
Commenting out the foreign-babel and compiling with english, outputs the following document:
Expected outcome
I would expect that the parentheses that show (english: ) should not appear in this case. This should be similat to setting plural = ,. Disabling list/locale/display in acsetup just shows () after the long acronym.
Workaround
Works fine, but it's a bit long:
\langsubs{
\DeclareAcronym{gpu}{
short = GPU ,
long = graphics processing unit ,
}
}{
\DeclareAcronym{gpu}{
short = GPU ,
long = unitat de procés gràfic ,
long-plural-form = unitats de procés gràfic ,
foreign = graphics processing unit ,
foreign-babel = english ,
}
}
The pdf output of the previous example:
The text was updated successfully, but these errors were encountered:
I have an idea for the second issue: use babel's \iflanguage to check if foreign is different that the document's main language. If true, display foreign, otherwise hide it.
Example:
\DeclareAcronym{gpio}{
short = GPIO ,
long = general-purpose inputs/output ,
foreign = entrada/sortida per a un ús general ,
foreign-babel = english ,
}
This seems counterintuitive since it would display if the document's language id different than english "general-purpose inputs/output (GPIO, english: entrada/sortida per a un ús general)" but this is similar to how Wikipedia articles display the foreign meaning.
I'm trying to write an article in two languages simultaneously using
babel
. I need to define some acronyms that usually have a definition in both languages but use the sameshort
acronym. I have defined the following command to switch between languages quickly:My
acsetup
contains:Using TeX Live for windows with
acro
version 61762 (3.7),babel
version 62203 (3.73). Compiling with pdflatex and biber.1st issue: Trying to use command withing
foreign-babel
does not get expandedExample that does not work:
Error output:
Expected outcome
I would expect that ACRO could expand the command like the other commands do just fine, since babel can't recognize
\langsubs {}{english}
.2nd issue: Empty
foreign
makes empty parenthesesCommenting out the
foreign-babel
and compiling withenglish
, outputs the following document:Expected outcome
I would expect that the parentheses that show
(english: )
should not appear in this case. This should be similat to settingplural = ,
. Disablinglist/locale/display
inacsetup
just shows()
after the long acronym.Workaround
Works fine, but it's a bit long:
The pdf output of the previous example:
The text was updated successfully, but these errors were encountered: