I use the glossaries package for acronyms of different languages. The problem I face now is that when my main text is e.g. german and I have an english acronym used for the first time within the text it sometimes happen that the hyphenation of the long form is wrong.
Is there a way to state the language on a per-acronym basis like the langid
field in biblatex?
Edit:
MWE 1 (main language ngerman, and english acronym). In this MWE you see that the word Application
gets hyphenated as Applicati-on
which is wrong. Correct hyphenation would be Ap•pli•ca•tion
. One workaround would be to write \newacronym{am}{AM}{\foreignlanguage{english}{Application Management}}
. However, this is a bit bothersome.
\documentclass[a4paper]{article}
\usepackage[english,ngerman]{babel}
\usepackage{glossaries}
\makeglossaries
\setacronymstyle{long-short}
\newacronym{am}{AM}{Application Management}
\begin{document}
\rule{0.82\textwidth}{1pt} \gls{am}.
\printglossaries
\end{document}
MWE 2 (main language English, and English acronym). Here no hyphenation occurs, which is a bit strange, because an overfull hbox is the result. My expectation was that the word would be hyphenated as Applica-tion
. However, this is better than a wrong hyphenation, because it is obvious and visible.
\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage{glossaries}
\makeglossaries
\setacronymstyle{long-short}
\newacronym{am}{AM}{Application Management}
\begin{document}
\rule{0.82\textwidth}{1pt} \gls{am}.
\printglossaries
\end{document}
\newacronym{am}{AM}{\foreignlanguage{english}{Application Management}}
newacronym{am}{AM}{Application Management}{english}
would be nice.\newcommand\newforeignacronym[5][]{\newacronym[#1]{#2}{#3}{\foreignlanguage{#5}{#4}}}
and then\newforeignacronym{am}{AM}{Application Management}{english}
. You can name your new command whatever you like in order to make it short.