# Spacing in align environment

I am familiar with the \flushright and \hfill commands for positioning text to the far right of the page. However throughout my document I am using the terms (x\rightarrow\infty) on many lines and I wish to send them all to the far right of the page so that they line up nicely. Any ideas?

• Could you post a minimal (non)working example so that we can see exactly what you want to do? – Bernard Mar 21 '15 at 21:44
• Hi is this what you mean ? \begin{align*} g(x)&\sim x^\rho\ell(x)\qquad(x\rightarrow\infty)\end{align*} – Wenty Mar 21 '15 at 21:52
• And i am trying to get the (x\rightarrow\infty) to the far right of the page – Wenty Mar 21 '15 at 21:53

If you're using unnumbered equation-like environments, as would seem to be the case, you could use (abuse?!) the \tag{$...$} and \tag*{$...$} macros to place the x\to\infty material at the far-right edge of the line. The first macro, \tag, surrounds its argument in parentheses, making it look a little bit like a substitute equation number; the second macro, \tag*, does not provide parentheses.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
g(x)&\sim x^\rho\ell(x) \tag{$x\to\infty$}\\
g(x)&\sim x^\rho\ell(x) \tag*{$x\to\infty$}
\end{align*}
\end{document}


Here is a solution with the flalign* environment and the mathllap command (from mathtools). I also propose a second way of writing, which is better, in my opinion.

\documentclass[12pt,a4paper,bothsides]{article}
\usepackage[utf8]{inputenc}
\usepackage[showframe, nomarginpar]{geometry}
\usepackage{mathtools}

\begin{document}
\begin{flalign*}
& & g(x)&\sim x^\rho\ell(x) & & \mathllap{(x\rightarrow\infty)}
\end{flalign*}

$g(x)\sim_{\infty} x^\rho\ell(x)$%

\end{document}


• hmmm im having problems getting the mathtools package? – Wenty Mar 21 '15 at 22:35
• Which distribution do you have installed? Is it old? There have been some substantial modifications on the organisation of this package last summer. – Bernard Mar 21 '15 at 22:39
• I have Latex 3 if thats what you mean? and im getting this message "Not a local package repository" – Wenty Mar 21 '15 at 22:51
• No,, latex3 has nothing to see here. What I mean is: do you have TeX Live, MiKTeX, MacTeX? – Bernard Mar 21 '15 at 22:53
• I'm afraid you will have to do some calculations by yourself? Take a look at the description of the heightrounded option of the geometry package (§ 5.3, p.8 of the documentation). – Bernard Mar 22 '15 at 0:58