TransWikia.com

Overriding table alignment for linguistic glossing

TeX - LaTeX Asked by Daniel Harbour on August 10, 2021

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#2end{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}

One Answer

enter image description here

documentclass[12pt]{article}

newcommand{gloss}[2]{begin{tabular}[t]{@{}l@{}}#1#2end{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}

Correct answer by David Carlisle on August 10, 2021

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