# How to control horizontal placement of shortintertext

My example is as following:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}

In our next class, we will test
\begin{alignat*}{1}
H_{0}: & \beta_{2}>0\\
& \beta_{3}+\beta_{4}\ge 0
\shortintertext{versus}
H_{1}: & \beta_{2}\le 0\\
& \beta_{3}<0
\end{alignat*}

\end{document}


Yielding

For me the "versus" is too far to the left. I would like it to be closer to the H_0 and H_1. What are my options for controlling? I would prefer not to hard code a length but to use a flexible solution (in case I change inequality and make much longer). Perhaps it could be best to not use \shortintertext and instead make it a row?

• I would make this a row, and in your case, put it between the two systems of inequalities horizontally. – Mariano Suárez-Álvarez Sep 19 '14 at 19:27
• Strictly speaking there is no error, if you realize that you place text inside \shortintertext placed in the same position, aligned to the left would have a normal paragraph. Therefore it is correct, but it may not be what you want. – Aradnix Sep 19 '14 at 19:27
• Options for controlling? See What commands are there for horizontal spacing? – Werner Sep 19 '14 at 19:46
• Either begin the content of \shortintertext with \hspace*{\parindent} or write before the equation: \noindent In our class, we will test. – Bernard Sep 19 '14 at 19:47
• @Bernard None of the two solutions make any sense, though. The first one depicts that a new paragraph starts at versus. The second one depicts that the whole thing doesn't start with a new paragraph, and FWIW, OP wants it to start a new paragraph. – yo' Sep 19 '14 at 19:52

You can insert \hspace{<some length of your choice>} before "versus". In the example below, this length is set at 3cm. You may obviously alter this choice to suit your taste.

Three additional comments/suggestions: (i) mathtools loads amsmath by default -- no need to load amsmath separately; (ii) the environment {alignat*}[1] is equivalent to align*; the spacing around : following H_0 and H_1 isn't great -- I suggest you use \colon instead of :. (For a longer discussion of the third subject, I suggest you consult the posting Equation alignment creating unwanted space.)

\documentclass{article}
\begin{document}
In our next class, we will test
\begin{align*}
H_{0}\colon & \beta_{2}>0\\
& \beta_{3}+\beta_{4}\ge 0
\shortintertext{\hspace{3cm}versus}
H_{1}\colon & \beta_{2}\le 0\\
& \beta_{3}<0
\end{align*}
\end{document}

• Thank you especially for your extra comments. I am learning a lot and appreciate the explaining. – Xu Wang Sep 21 '14 at 16:03

You have two basic options: Either you treat versus as a standard paragraph text, and then it's position is completely correct (just try it with couple standard paragraphs before and after and you'll see it doesn't stand out at all).

Or you treat it as a part of the display equation, but then it shouldn't get a line on its own:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document}

In our next class, we will test
\begin{align*}
H_{0} :{}
& \beta_{2}>0 \\
& \beta_{3}+\beta_{4}\ge 0
\\[\medskipamount]

• If "versus" is supposed to be on the same line as H_1, shouldn't "In our next class, we will test" be on the same line as H_0? – Mico Sep 19 '14 at 20:02
• @Mico If I wrote Let us have \begin{align} f(1) &= blabla, \\ f(2) &= blabla, \\ \text{and}\quad f(3) &= blabla. \end{align}, would you consider the position of the and improper? I think this is fine, versus -- like and fall into the preposition/conjuction category, and positioning it there is IMHO fine, and it has nothing to do with the introductory text up there. – yo' Sep 19 '14 at 20:14