3

The text of examples is too close to the example number with example numbers having three or more digits. The problem relates to the use of the Brill font, as it disappears with other fonts.

enter image description here

Here's a MWE:

\documentclass{memoir}
\usepackage{mathastext}
\usepackage[no-math]{fontspec}
\setmainfont{Brill} 
\usepackage{linguex}

\begin{document} 

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\setcounter{ExNo}{49}

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\setcounter{ExNo}{99}

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\end{document} 

2 Answers2

3

It's a bug in linguex that, for strange reasons, wants to use the minimum width of digits, instead of the maximum!

With a font such as Brill, where the minimal width digit is 1, this spoils all computations for the label width. So I redefine \minimalwidth to be really \maximalwidth.

\documentclass{memoir}

\usepackage[no-math]{fontspec}
\setmainfont{Brill}

\usepackage{mathastext}
\usepackage{linguex}

\usepackage{etoolbox}
\patchcmd{\minimalwidth}{<}{>}{}{}% it should be maximal width!

\AtBeginDocument{%
  \settowidth{\Exlabelwidth}{(000)}%
}

\begin{document} 

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\setcounter{ExNo}{49}

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\setcounter{ExNo}{99}

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\end{document} 

Note that mathastext should go after setting the main font.

enter image description here

You may prefer a different solution, using fixed width digits in the context of \ex (but this will change all numbers in the context).

\documentclass{memoir}

\usepackage[no-math]{fontspec}
\setmainfont{Brill}

\usepackage{mathastext}
\usepackage{linguex}

\usepackage{etoolbox}
\preto{\listdecl}{\addfontfeatures{Numbers=Monospaced}}

\AtBeginDocument{%
  \settowidth{\Exlabelwidth}{(000)}%
}

\begin{document} 

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\setcounter{ExNo}{49}

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\setcounter{ExNo}{99}

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\end{document} 

enter image description here

egreg
  • 1,121,712
0

Maybe you just need to add RawFeature=+tnum when loading the font

\documentclass{memoir}
\usepackage{mathastext}
\usepackage[no-math]{fontspec}
\setmainfont[RawFeature=+tnum]{Brill} 
\usepackage{linguex}

\begin{document}

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\setcounter{ExNo}{49}

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\setcounter{ExNo}{99}

\ex. [$_S$ [$_{NP}$ Bartoli] [$_{VP}$ zoent Pavarotti]]

\end{document}

tnum

Ludenticus
  • 1,910