4

I'm writing an article with several short example sentences. The document as a whole would look better if my example sentences were horizontally centered rather than left-aligned. Of course, I still need the labels on the left. How can I achieve this? Here's a simple MWE:

\documentclass{article}
\usepackage{gb4e}
\begin{document}
\begin{exe}
  \ex This sentence is short.
\end{exe}
\end{document}
2
  • 1
    Use hfil like: \ex \hfil This sentence is short.
    – user11232
    Commented Oct 12, 2014 at 4:59
  • Works like a charm with Philex and Forest. Commented Mar 24, 2022 at 22:43

1 Answer 1

2

You need to use \hfill and \hfill\null:

enter image description here

Notes:

  • The showframe package was used just to show the page margins. It is not needed in your actual use case.

Code:

\documentclass{article}
\usepackage{showframe}
\usepackage{gb4e}
\begin{document}
\begin{exe}
  \ex \hfill This sentence is short.\hfill\null
\end{exe}
\end{document}
1
  • \hspace*{\fill} won't disappear. Using \null is not the best option, as it is an undocumented command.
    – egreg
    Commented Aug 6, 2015 at 16:25

You must log in to answer this question.

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