1

EDIT: added an example from the original document as requested by @kmbkrkn (see below)
I use linguex for linguistic glossing and have a question similar to Words not vertically aligned in gb4e glosses when underlined. I tried experimenting with different macros which enable me to add something below one or more characters of a word on the first glossing line (mostly just a \cdot below a vowel, at times something a bit wider) and so far usage of \stackrel gave the best results. However, this height change affects the vertical alignment of the next (glossing) line badly. I tried some suggestions with \smash, but could not find the solution so far (and don't want to try to change anything in the linguex.sty as the document should be as portable as possible)...

The part a. of the example uses the \stackrel within a macro for "affected" words only (\stb=\somethingbelow); as the height differences result in worse chaos, I wrap all "non-affected" words in a similar stackrel-macro (\ntb=\nothingbelow) in the part b. The results are more readable, but far from a perfect alignment.

Any ideas? It would be great if I'd only need to make changes to my \stb / \ntb macros...

\documentclass[11pt]{article}
\usepackage{stackrel}
\usepackage{linguex}
\usepackage{geometry}
\geometry{a4paper}

\begin{document}

\newcommand{\somethingthenbelow}[2]{% 2 args
$\stackrel[\textrm{#2}]{}{\textrm{#1}}$%
} % \somethingthenbelow
\def\stb{\somethingthenbelow}

\newcommand{\nothingbelow}[1]{% 1 arg
$\stackrel[\textrm{}]{}{\textrm{#1}}$%
} % \nothingbelow
\def\ntb{\nothingbelow}

% glossing vertical alignment test:
\ex.
\ag. some gl\stb{o}{$\cdot$}ssing with c\stb{e}{\scriptsize$\cdot\,k$}rtain height alignment problems\\
Some Glossing w. some altitude alignment probs\\
`It's about some glossing with certain height alignment problems!'
%
\bg. \ntb{some} gl\stb{o}{$\cdot$}ssing \ntb{with} c\stb{e}{\scriptsize$\cdot\,k$}rtain \ntb{height} \ntb{alignment} \ntb{problems}\\
Some Glossing w. some altitude alignment probs\\
`It's about some glossing with certain height alignment problems!'
%
\cg. \ntb{some} gl\stb{o}{$\cdot$}ssing \ntb{with} c\stb{e}{\scriptsize$\cdot\,k$}rtain \ntb{height} \ntb{alignment} \ntb{problems}\\
capital LETTERS don't make IT any BETTER\\
`It's about some glossing with certain height alignment problems!'
\par
% test.
\end{document}

vertical DISalignment


EDIT: an example form the original document
It doesn't look much more different than what I try to typeset so far... excerpt form the original PDF
It has single \cdot marks under single letters and an additional k-reference to the first word (Òzó).

  • As both gb4e and linguex use a version of the cgloss-package for glossing, the solution you linked to does work if you adapt it for two-line glossing (\usepackage{etoolbox} \patchcmd{\gll}{\twosent}{\linespread{2}\twosent}{}{}), but this leaves you with a large amount of space between the two lines. What is the purpose of those subscripts anyway? – kmbkrkn Nov 24 '17 at 10:40
  • er... thanks, @kmbkrkn ! I am not sure how to implement this... I am still quite new to digging deeper into macros and styles... subscripts? I am not really familiar with the contents, I am not the author, just a humble TeXer whose task is to create (lost, 15 years old) LaTeX source from a PDF :( – Digi Nov 27 '17 at 3:34
  • I did not write an answer because what I suggested leaves you with an unbearable amount of white space between the first and second lines of glossing. Put the code following code somewhere after \usepackage{linguex} and before \begin{document}: \usepackage{etoolbox} \patchcmd{\gll}{\twosent}{\linespread{2}\twosent}{}{}. The vertical alignment of the second line should look okay (if not, increase the value for linespread), but there's ample space above the second line of the gloss. (By the way: newcommand should be invoked before \begin{document}.) – kmbkrkn Nov 27 '17 at 16:06
  • As for the second qart of my last comment: I'm trying to figure out what you are trying to achieve with the subscript ·k etc. in your glossed examples. It might be easier altogether to use diacritics or even an additional gloss line (\glllinstead of \gll) both of which do not interfere with the height of a line. So if you could provide one example from the file you are supposed to recreate, that might make it easier for me to suggest a solution. – kmbkrkn Nov 27 '17 at 16:11
  • Thanks, @kmbkrkn, I added the original sample. As I am not the author, please don't ask me much about its meaning, I'm just a "dumb typesetter" ;-) – Digi Jan 6 '18 at 7:10
1

The original source is really badly typeset. The language example is from Èdó, (a language spoken in Nigeria) whose orthography includes both Ọ/̣o and Ẹ/̣e, (I've rendered these as code because the regular font on the site doesn't display them correctly) along with tone marks on all vowels. The underdots are sometimes written using underlines instead, but this is not really proper orthography. Use XeLaTeX and a font that supports proper combining characters to get the underdot. I've used Gentium Plus which is a free font from SIL, available here.

Using linguex

\documentclass{article}
\usepackage{linguex}
\renewcommand\glt{} % removes extra vertical space from translation line
\usepackage{fontspec}
\setmainfont{Gentium Plus}
% Make _ active everywhere load last
\catcode`_=\active
\def_#1{\ifmmode\sb{#1}\else$\sb{#1}$\fi}

\begin{document}
\exg. Òzó_{k} gbọ́ọ́ ívìn Ọ́_{k} bòló ọ́kà\\
        Ozo plant coconut he peel korn\\
    \glt ‘Ozo planted coconut and [he] peeled the corn’

\end{document}

Using gb4e

\documentclass{article}
\usepackage{gb4e}
\renewcommand\glt{} % removes extra vertical space from translation line
\usepackage{fontspec}
\setmainfont{Gentium Plus}
\begin{document}
\begin{exe}
\ex\gll Òzó_{k} gbọ́ọ́ ívìn Ọ́_{k} bòló ọ́kà\\
        Ozo plant coconut he peel korn\\
    \glt ‘Ozo planted coconut and [he] peeled the corn’
\end{exe}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.