TransWikia.com

Use custom font for numbers in linguex examples

TeX - LaTeX Asked by Venkat on December 23, 2020

I have a custom font specifically for numbered lists — it renders the numbers in an enumeration in a nicer way than the standard main font. Once I’ve loaded the font into a new font family which I call numfont (using fontspec), I can use it in enumeration like so:

begin{enumerate}
    item[{numfont 1}] his
    item[{numfont 2}] her
end{enumerate}

Is there a way to do something similar for the numbers in a linguex example? I would prefer something similar in style to how I did it above, rather than changing the font for the numbers universally. The font I have only draws numbers (not alphabets), so I would prefer to use it only in that case.

2 Answers

The best way to do this is to patch into the left and right bracket code of the example formatting. I've used sffamily here in place of your numfont which you don't define.

documentclass{article}
usepackage{linguex}
renewcommand{ExLBr}{(sffamily} % using sffamily as an example
renewcommand{ExRBr}{normalfont)}
begin{document}

ex. This is an example

ex.
a. This is a subexample.
b. This is 

end{document}

output of code

Correct answer by Alan Munn on December 23, 2020

Looks like the most obvious way is the answer (which I should have tried before asking):

ex.[{numfont 1}] Here's your fancy numbering font.

Answered by Venkat on December 23, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP