[Tex/LaTex] Unnumbered line inside align

alignequationsnumbering

Basically, I have two equations that I wanted to use align to number, but I also wanted to put the word 'and' in between the lines.
Here's what I have so far

\begin{document}
\usepackage{amsmath}

\begin{align}
  \mathrm{distance} &= \mathrm{speed} \times \mathrm{time}\\
  &\text{and}\\
  y &= \mathrm{m}x + \mathrm{c}
\end{align}

\end{document}

This gives me the equations in the way that I want them but it numbers the line that says 'and'. Hopefully, if this made any sense, someone can help me with this.

Best Answer

enter image description here

\documentclass[preview,border=12pt]{standalone}% please change to your document class
\usepackage{mathtools}
\usepackage{amsthm}
\newtheorem{mydef}{Definition}

\begin{document}
\begin{mydef}
\begin{align}
\text{distance} &= \text{speed} \times \text{time}\\
\intertext{and}
y &= \mathrm{m}x + \mathrm{c}
\end{align}
\end{mydef}


\begin{mydef}
\begin{align}
\mathrm{distance} &= \mathrm{speed} \times \mathrm{time}\\
\shortintertext{and}
y &= \mathrm{m}x + \mathrm{c}
\end{align}
\end{mydef}

\end{document}

Remarks:

Compare the results in the first and the second theorems carefully.

  • Use \text when you want its content to be affected by the surrounding font. For example, if \text is used inside a theorem environment, the surrounding font is italic so the contents of \text will be in italic as well.

  • Use \mathrm when you don't want its contents to be affected by the surrounding font.

  • Use \intertext for getting normal spacing but \shortintertext for shorter one.
Related Question