# How to align equations in align* like align, but without numbers?

Sorry if the question is worded a bit weirdly, but basically, I like how the text looks when it's centered nicely using align, but I don't like the equation numbering on the right hand side of it. I tried using align*, but it ended up shifting everything over to the right hand side. Here's what I have right now:

\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb,amsfonts,graphicx,pifont,enumitem}

\begin{gather*}
(a-b) = nyx \\
\text{Because } yx \text{ is still some variable, we will denote it with } x \text{ to make our life easier.} \\
\begin{align}
& \Rightarrow (a-b) = nx \\
& \Rightarrow n \,|\, (a-b) \\
& \Rightarrow a \equiv b \Mod{n}
\end{align}
\end{gather*}


This gives me something that lines up nicely, but has numbers on the right hand side. What can I do to get rid of the equation numbers?

• Welcome to TeX.SX! So you want to remove the equation numbers without using align*? – TeXnician May 9 '18 at 6:12
• You can use \nonumber to specify non-numbers in each split equation used in align environment. – Mishra S May 9 '18 at 6:55
• the only difference between align* and align is that it omits the numbers, if the alignment changed to the right then you had an error but hard to say as you did not show that code, perhaps you forgot the & on each line. – David Carlisle May 9 '18 at 6:59
• you can not nest align or align* inside gather* all three are top level environments that start display math alignments. – David Carlisle May 9 '18 at 7:00
• @DavidCarlisle Erm... "The chief exception is that align and most of its variants can be used inside the gather environment." Which always baffled me :-) – campa May 9 '18 at 8:59

This is not an answer but may help others to find out what you really want. \begin{document} and \end{document} were missing, and \Mod not defined. Perhaps more importantly I do not understand what you mean with your statement on align*. There was IMHO no need for gather and no need to write the text in such a complicated way.

\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,amsthm,amssymb,amsfonts,graphicx,pifont,enumitem}
\begin{document}
\paragraph{Suggestions by @daleif and @DavidCarlisle}:
$(a-b) = nyx$
Because $yx$ is still some variable, we will denote it with $x$ to make our life
easier.
\begin{align*}
\Rightarrow &\quad n \mid (a-b) \\
\Rightarrow &\quad a \equiv b \mod n
\end{align*}

I personally would add thin spaces indicating the suppressed multiplication
signs.
$(a-b) = n\,y\,x$
Because $y\,x$ is still some variable, we will denote it with $x$ to make our life
easier.
\begin{align*}
\Rightarrow &\quad n \mid (a-b) \\
\Rightarrow &\quad a \equiv b \mod n
\end{align*}

\end{document}


• Thanks! This helped out a bunch. I was looking through different sources so I guess that's why I had written it so complicated. – Stephanie Blanco May 9 '18 at 6:10
• Probably looks better with at least a quad of space before the &'s – daleif May 9 '18 at 6:27
• the space around the arrow is too tight because you have used \Rightarrow & rather than &\Rightarrow , and \mid would be better than \,|\, – David Carlisle May 9 '18 at 7:02
• @daleif Better now? – user121799 May 9 '18 at 13:36
• +1, I don't better, though I don't agree on the adding space between variables, I see no need for it, and it makes the code for the formulas unnecessary complicated. Also I often create a new macro called \divides that is just \mid, then the source n \divides (a-b) makes sense on its own. If you do not know \mid then the code n \mid (a-b) is confusing. Writing math is often like this, and it might sometimes be a good idea to have personal names for symbols, names that makes more sense in the field one is using them in. – daleif May 9 '18 at 13:48

You possibly want to align the various formulas with each other. Here I make the \Rightarrow\quad “transparent” (this assumes the formulas are not too wide so the symbol will not go past the left margin).

\documentclass[12pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath,mathtools}

\begin{document}

\begin{align*}
& (a-b) = nyx \\
\shortintertext{Because $yx$ is still some variable, we will denote it
with $x$ to make our life easier.}
\follows & (a-b) = nx \\
\follows & n \mid (a-b) \\
\follows & a \equiv b \pmod{n}
\end{align*}

\end{document}