3

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}
  • Use hfil like: \ex \hfil This sentence is short. – user11232 Oct 12 '14 at 4:59
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}
|improve this answer|||||
  • \hspace*{\fill} won't disappear. Using \null is not the best option, as it is an undocumented command. – egreg Aug 6 '15 at 16:25

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.