tpellard / typgloss

A LaTeX package to typeset linguistic abbreviations and syntactic annotations in interlinear glossed examples
13 stars 4 forks source link

Cannot distinguish an uppercase word from gloss abbreviation #2

Closed mkpoli closed 2 years ago

mkpoli commented 3 years ago

Hello! Thank you for creating this package, it feels really convenient to use!

Issue

However, I met the problem when I tried to write HAVE capitalised (to indicate that it's an auxiliary verb as in the following image), but I found that there is no way to differentiate between a gloss abbreviation and a full uppercase word. Other than HAVE or BE, although probably not so frequent, I think that it can happen when there is an abbreviation such as IPA or ASL ....

image

The following code will (apparently) yield "Glossary entry `have' has not been defined" error.

\usepackage[mcolblock]{leipzig}
\usepackage{gb4e}
\usepackage{typgloss}
\newleipzig{ptv}{ptv}{partitive}
\begin{document}
  \begin{exe}
    \ex
      \gll Mario ha comprato del cioccolato.\\
           Mario HAVE.3SG buy-PTCP.PRF PTV chocolate\\
      \glt Mario bought chocolate.
  \end{exe}
\end{document}

Expected

I would prefer a command indicating a word is not a gloss:

  \begin{exe}
    \ex
      \gll Mario ha comprato del cioccolato.\\
           Mario \notgloss{HAVE}.3SG buy-PTCP.PRF PTV chocolate\\
      \glt Mario bought chocolate.
  \end{exe}
amunn commented 2 years ago

@mkpoli Why do you think this should be solved by typgloss? Since you're using HAVE as a gloss symbol, it makes sense simply to define it using the leipzig methods:

e.g. \newleipzig{have}{HAVE}{HAVE} or something similar.

Then typegloss will format it correctly. (If you want it to be small caps, then use have as the second argument.)

mkpoli commented 2 years ago

@amunn Thanks! I forgot why I didn't realise that just simply add an abbreviation is enough. Anyway, \newleipzig surely works perfectly by using capitalised letter in the second parameter for real uppercase, and lower case for small capital.

A full working example for later reference:

\documentclass{article}

\usepackage[mcolblock]{leipzig}
\usepackage{gb4e}
\usepackage{typgloss}

\makeglossaries

\newleipzig{ptv}{ptv}{partitive}

\newleipzig{have}{HAVE}{perfect auxiliary verb} % Uppercase for HAVE
\newleipzig{be}{be}{copula verb} % Small Capital for BE

\leipzigdesccapitalizetrue
\begin{document}
\begin{exe}
  \ex
  \gll Mario ha comprato del cioccolato.\\
  Mario HAVE.3SG buy-PTCP.PRF PTV chocolate\\
  \glt Mario bought chocolate.
  \ex
  \gll Mario non è il cioccolato\\
  Mario NEG BE.3SG the chocolate\\
  \glt Mario is not chocolate.
\end{exe}
\printglosses
\end{document}\\

image