1

I'm using glossaries to generate acronyms. In preable I load the package:

\usepackage[toc,acronym]{glossaries} 
\makeglossaries

Then I print acronyms:

\printglossary[type=\acronymtype,title=Acronyms, style=index]

But for the page range of acronyms I get double dash, like that:

enter image description here

I need one dash only.

Here is an MWE. The problem is related to polyglossia and greek language setup.

\documentclass[a4paper,draft]{article} 

% setup greek
\usepackage{polyglossia}
\usepackage{fontspec}
\setmainlanguage{greek}
\setotherlanguages{english}
\setmainfont{Times New Roman}
\newfontfamily\greekfont{Times New Roman}
\newfontfamily\greekfontsf{Times New Roman}

\usepackage[toc,acronym]{glossaries}
\makeglossaries
\newacronym{iss}{ISS}{International Space Station}


\begin{document}
\tableofcontents

\newpage
\printglossary[type=\acronymtype,title=Acronyms, style=index]

\newpage
\gls{iss}
\newpage
\gls{iss}
\newpage
\gls{iss}
\newpage
\gls{iss}
\newpage

\end{document}
3
  • What you want is an en-dash, which is what two input hyphens resolves to. You don't show the input for this page span, and I haven't been successful in trying to copy and paste what is shown, so I can't check to see what is there. I suspect that there is already a Unicode dash as at least one of the "dashes", so this would be an input coding issue. May 3, 2020 at 18:52
  • You'll see the same effect when you just type -- in your document. Normally TeX would turn that into an en-dash. But it doesn't in your setup. Add [Ligatures=TeX] to your font definition calls \newfontfamily\greekfont[Ligatures=TeX]{Times New Roman} (see e.g. tex.stackexchange.com/q/147934/35864).
    – moewe
    May 4, 2020 at 6:46
  • Thank you! [Ligatures=TeX] was the solution!
    – Leonidas
    May 4, 2020 at 17:45

1 Answer 1

4

The same issue can be reproduced in

\documentclass[a4paper,draft]{article}

% setup greek
\usepackage{polyglossia}
\usepackage{fontspec}
\setmainlanguage{greek}
\setotherlanguages{english}
\setmainfont{Times New Roman}
\newfontfamily\greekfont{Times New Roman}
\newfontfamily\greekfontsf{Times New Roman}

\begin{document}
Lorem -- ipsum
\end{document}

when compiled with LuaLaTeX or XeLaTeX that MWE produces

Lorem -- ipsum

The underlying issue here is that traditionally the en-dash is produced by a ligature of two hyphens -- in TeX.

But in the fonts loaded with fontspec that is not usually the case (if you type -- with those fonts in other programs [that don't apply automatic substitutions], you really get just --).

fontspec allows users to access these traditional TeX ligatures with the font option Ligatures=TeX (as far as I understand these ligatures are not implemented as ligatures at the font level but via other means). The option Ligatures=TeX is automatically applied for \setmainfont, \setsansfont and \setmonofont, but not for fonts defined via \newfontfamily.

So you can resolve the issue by explicitly selecting Ligatures=TeX in \newfontfamily

\newfontfamily\greekfont[Ligatures=TeX]{Times New Roman}

In the MWE

\documentclass[a4paper,draft]{article}

% setup greek
\usepackage{polyglossia}
\usepackage{fontspec}
\setmainlanguage{greek}
\setotherlanguages{english}
\setmainfont{Times New Roman}
\newfontfamily\greekfont[Ligatures=TeX]{Times New Roman}

\usepackage[toc,acronym]{glossaries}
\makeglossaries
\newacronym{iss}{ISS}{International Space Station}


\begin{document}
\tableofcontents

Lorem -- ipsum

\newpage
\printglossary[type=\acronymtype,title=Acronyms, style=index]

\newpage
\gls{iss}
\newpage
\gls{iss}
\newpage
\gls{iss}
\newpage
\gls{iss}
\newpage

\end{document}

ISS  International Space Station. 3–6

See also Fontspec and Ligatures.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .