2

A linguistics publisher wants me to switch from morpheme-by-morpheme alignment:

morpheme-by-morpheme alignment

to word-by-word alignment:

word-by-word alignment

I have been using the tabular environment for glossing. For the purposes of this question, let’s pretend I have been using two commands, \gloss and \glom. Both take two arguments and build them into a left-aligned table, with one under the other (the second under the first). The two commands differ in that \gloss leaves a space after the table it builds, but \glom gobbles the space and puts a hyphen after both its arguments. (See MWE below.)

Can I redefine these commands so that they align as the publisher wants? I probably don’t need a full solution. Knowing how to redefine \gloss so as to close up the space between teuer- and er (and the space between herb- and tea) will probably be enough.

\documentclass[12pt]{article}

\newcommand{\gloss}[2]{\begin{tabular}[t]{@{}l@{}}#1\\#2\end{tabular} }
\newcommand{\glom}[2]{\begin{tabular}[t]{@{}l@{}}#1-\\#2-\end{tabular}\ignorespaces}

\begin{document}

\glom{teuer}{expensive}
\gloss{er}{\textsc{m.sg.nom}}
\glom{Kr\"auter}{herb}
\gloss{tee}{tea}

\end{document}
4
  • 2
    Are there too many glosses to reformat them to work with one of the many glossing packages (expex, linguex, gb4e, covington, maybe more)? Alternative comment: Why would you gloss like that in the first place?
    – schoekling
    Apr 7, 2021 at 10:56
  • My gripe with all glossing programs is that you can't do a search-and-replace for a single foreign-English pair. E.g., in a b c \\ d e f, you can't replace the pair b-e with b-g. expex is the only one that has version where you input pairwise (i.e., a-d, b-e, c-f), but I’ve found tabular environment to offer some further advantages—until now! This probably would have been easily fixable in expex. Apr 7, 2021 at 11:19
  • I was just about to suggest using expex's nlevel glosses, but it seems you already knew about those. Now I am curious, what advantages do tabulars have? I cant' think of anything \lingset couldn't do.
    – schoekling
    Apr 7, 2021 at 11:24
  • I left it that way in my answer but beware that space in \gloss could cause a spurious extra white line at the end of a paragraph if it just happens to fall at the end, you should probably use \ignorespaces after it. Apr 7, 2021 at 11:25

1 Answer 1

5

enter image description here

\documentclass[12pt]{article}

\newcommand{\gloss}[2]{\begin{tabular}[t]{@{}l@{}}#1\\#2\end{tabular} }
\newcommand{\glom}[5]{#3{#1-#4}{#2-#5}}

\begin{document}

\glom{teuer}{expensive}
\gloss{er}{\textsc{m.sg.nom}}
\glom{Kr\"auter}{herb}
\gloss{tee}{tea}

\end{document}
2
  • A nice facet of this solution is that it still works if you add an extra morpheme (e.g., \glom{er}{more} after \glom{teuer}{expensive}). Why I’m not a fan of most off-the-shelf example packages: see my comment on the original question. (expex in one of its versions is the exception.) Apr 7, 2021 at 11:29
  • 1
    @DanielHarbour yes that's why I re-inserted #3 rather than use \gloss Apr 7, 2021 at 11:30

You must log in to answer this question.

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