# gb4e: phantom, spacing

In order to provide my interlinear examples with a preamble line providing context, I use \pream and \pglt from gb4e: remove extra space below preamble/header lines.

This works perfectly fine, unless I want to include acceptability judgments. Obviously, I cannot use the inherent judgment function of gb4e, as this would put the judgment before the context and not before the first line. As a workaround, I thought of putting the judgment in the first line of the example itself and use {} in the second line for an empty morpheme gloss. However, this gives a weird spacing in the translation line, even with \hphantom. Does anyone have a solution to this problem?

\documentclass{scrbook}
\usepackage{gb4e}
\usepackage{lipsum}
\newcommand{\pream}[1]{#1:\\[-4.5ex]} % for preamble lines, supplies a colon and removes some vertical space
\newcommand{\pglt}{\vspace*{-2ex}\glt} % for use in examples that have a preamble
\begin{document}

The judgement function of gb4e does not yield an acceptable result with $\backslash$ pream:
\begin{exe}
\ex[\#]{\pream{Context: Somebody has arrived late.}
\gll Ich bin schon da\\
\pglt \lq I am here already.'}
\end{exe}

Putting the judgement in the example line yields unacceptable spacing in the gloss line, even with $\backslash$ hphantom:
\begin{exe}
\ex \pream{Context: Somebody has arrived late.}
\gll \# Ich bin schon da\\
\pglt \lq I am here already.'
\ex \pream{Context: Somebody has arrived late.}
\gll \# Ich bin schon da\\
\pglt \hphantom{\#} \lq I am here already.'
\end{exe}
\end{document}


• So to be clear you are looking for what result exactly? May 5 '16 at 14:04
• To have the acceptability judgement beofre the source language line and the translation line alined with the text and the morpheme gloss line, instead of being to the right of them. May 5 '16 at 14:17
• You could "brute force" that line anywhere on the page. But perhaps you might wait for a user of this package to provide a solution that would be more elegant. Maybe this might help: tex.stackexchange.com/questions/115591/… You want the "I"'s lined up with normal spacing between? May 5 '16 at 14:19
• Basically, yes. The texts used here are just for illustratory purposes. May 5 '16 at 14:24
• By brute force, this is what I meant: tex.stackexchange.com/a/306771/90087 It is the one and only time that I have had the pleasure of being accused of creating a "pure hack". It did seem to work though. May 5 '16 at 14:37

## gb4e

The solution to this problem is the same as the solution provided by alexis to a question about how to put judgment marks in front of the translation line: you can use \llap. See that answer for more explanation of how this works.

In the example below I defined \context instead of \pream, which adds "Context:" and doesn't have final colon.

\documentclass{scrbook}
\usepackage{gb4e}
\newcommand{\context}[1]{Context: #1\\[-4.5ex]} % for context lines, supplies Context: and removes some vertical space
\newcommand{\cglt}{\vspace*{-2ex}\glt} % for use in examples that have a context
\begin{document}

\begin{exe}
\ex{\context{Somebody has arrived late.}
\gll \llap{\#}Ich bin schon da\\
\cglt \lq I am here already.'}
\end{exe}

\end{document}


## expex

As mentioned in my other answer that you referenced in your question, expex provides preamble support out of the box, and the \ljudge command can be placed on any line.

\documentclass{scrbook}

\usepackage{expex}
\lingset{ % sets expex options
everygla=, % top line of gloss is not italics
belowglpreambleskip=-0.5ex, % removes some vertical space between the preamble and gloss lines
aboveglftskip=-0.5ex, % removes some vertical space between the gloss and free translation lines
everyglpreamble={Context:\ }, % puts the Context: at the beginning of each preamble; you could define this locally to a lingstyle if you want this for some but not all examples
}

\begin{document}

\ex
\begingl
\glpreamble Somebody has arrived late. //
\gla\ljudge{\#}Ich bin schon da //
\glb I am already there //
\glft \lq I am here already.' //
\endgl
\xe

\end{document}


• \makebox[0pt][r]{\#} is preferable: as you surely know, \llap doesn't start horizontal mode, so used in other contexts can produce surprising results. May 5 '16 at 17:55
• @egreg, yes, you're right that \llap isn't generalizable to all use cases (including after a blank line or in math mode). But these interlinear examples are a quite controlled environment, and as a linguist I've never seen these left-shifted judgment marks outside of that environment. Perhaps the best solution is to define a new command: \newcommand{\ljudge}[1]{\makebox[0pt][r]{#1}}. May 6 '16 at 15:19
• @JasonZentz The new command strategy is definitely the best. May 6 '16 at 15:30