2

I use a package called typgloss to automatically put into small capitals linguistic glosses that are in uppercase.

The problem is that it works when there is only one line to gloss, but does not work when there are to lines to gloss. Do you have a solution to that please

I am using linguex along with cgloss. The typgloss package is here : https://github.com/tpellard/typgloss

Here is the minimal code:

\documentclass{article}

\usepackage{linguex, cgloss}
\usepackage{typgloss}

\begin{document}

\ex.
\a.
\gll      à   pjě    =lè     kǔ\\ 
         AFF hare =INDF3.SG  die\\
         \glt `Hare died.'\\
\b.
\glll      à   pjě    =lè       kǔ\\  
           à   pjě    =lV        kǔ\\
           AFF hare =INDF3.SG  die\\
           \glt `Hare died.'\\





\end{document}

1 Answer 1

1

This is a nice little package. The author didn't add support for three line glosses, but it's easy to do.

Code explanation:

The cgloss (and cgloss4e) packages define macros corresponding to a word within a glossed line: \eachwordone, \eachwordtwo and \eachwordthree. The typgloss package adds a wrapper \grlbl to those macros which then does a regex replacement of uppercase characters with the small caps, and formats them according to the chosen \eachword...style (where ... is one, two in the original code.) I simply added the third line wrapper and corresponding style.

\documentclass{article}
\usepackage{linguex, cgloss}
\usepackage{typgloss}
\newcommand{\eachwordthreestyle}{}
\renewcommand{\eachwordthree}{\eachwordthreestyle\grlbl}

\begin{document}

\ex.
\a.
\gll      à   pjě    =lè     kǔ\\ 
         AFF hare =INDF3.SG  die\\
         \glt `Hare died.'\\
\b.
\glll      à   pjě    =lè       kǔ\\  
           à   pjě    =lV        kǔ\\
           AFF hare =INDF3.SG  die\\
           \glt `Hare died.'\\

\end{document}

Note that the way typgloss works, it doesn't catch single letter abbreviations like the V in your lV gloss in the second line of example (1b). If you want this kind of abbreviation to also be turned into small caps you need to surround the single letter in {}.

output of code

4
  • Waou ! That's fantastic. Thanks. It works now. Could you please explain the lines you added? Jun 20, 2022 at 16:03
  • @SiluéLacina I've added an explanation now.
    – Alan Munn
    Jun 20, 2022 at 16:10
  • @SiluéLacina I've also created a pull request on the repo to make this change part of the package.
    – Alan Munn
    Jun 20, 2022 at 17:04
  • Thanks ! It is kind. Jun 21, 2022 at 11:24

You must log in to answer this question.

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