2

ExPex offers \exdisplay to create linguistic examples without numbers (usually in combination with \noexno to prevent the counter being incremented).

However, according to the manual (pg. 71), indenting examples via \textoffset is not possible with \exdisplay. Is there another way to get a 'default' indentation whenever \exdisplay is used? I've used \hspace{} repeatedly (per line) as a workaround, but it is cumbersome and also prevents the use of \\ as a line break.

Here are some examples depicting the issue, the current workaround/desired output and the inability to use textoffset:

enter image description here

Minimal Reproducible Example (MRE)

\documentclass{article}

\usepackage{expex}

\begin{document}
\noindent
Example undesired output (note the lack of indent):
\exdisplay\noexno
John gave people homes\\
John gave homes people
\xe
Example desired output (indented):
\exdisplay\noexno
\hspace{4em}John gave people homes

\hspace{4em}John gave homes people
\xe
Using \texttt{textoffset} does not work:
\exdisplay[textoffset=4em]\noexno
John gave people homes\\
John gave homes people
\xe

\end{document}

1 Answer 1

2

A workaround is to use a phantom label with exno. In this case you also don't need to switch off the counter increment because a label defined with the exno argument does not change the counter.

\documentclass{article}

\usepackage{expex}

\begin{document}
\noindent
Normal numbered example:
\ex
John gave people homes\\
John gave homes people
\xe
Example desired output (indented):
\ex[exno=\phantom{(X)},exnoformat=X]
John gave people homes\\
John gave homes people
\xe
Resume normal numbering:
\ex
John gave people homes\\
John gave homes people
\xe
\end{document}

If you want you can make the syntax a bit simpler by defining a macro:

\documentclass{article}
\usepackage{expex}
\def\mydisplay{\ex[exno=\phantom{(X)},exnoformat=X]}
\begin{document}
% ...
\mydisplay
John gave people homes\\
John gave homes people
\xe
%...
\end{document}

enter image description here

3
  • Thank you, this is exactly what I was after. The addition of the macro makes for a clean solution too. Commented Mar 29 at 21:13
  • 1
    @KyleF.Hartzenberg it's not very clean conceptually, with a fake invisible example number - it would have been nicer to actually have a real indent. However, given the small amount of code needed for this workaround and the large amount of digging in the package source code that would be required to implement a clean solution I guess this isn't too bad :)
    – Marijn
    Commented Mar 29 at 21:40
  • Indeed! I was about to go delving, but you saved me the effort!
    – Alan Munn
    Commented Mar 29 at 21:47

You must log in to answer this question.

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