4

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.

2
  • 1
    There is \nonumber/\notag but here, typographically speaking, you should use \intertext{and} or \shortintertext{and} from the mathtools package instead (you can slip a \centering in there). – Qrrbrbirlbel Apr 28 '13 at 18:27
  • Ah okay, cool, thanks. Looking at it now, I'm fairly sure I've used this before, I knew it wasn't difficult. Thanks again! – bigbadpiano Apr 28 '13 at 18:31
5

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.
2
  • Oh right, okay, cheers. I'm kinda just getting used to this trying to write my first lab report for uni with it. This is really great, I didn't really understand what \mathrm was I was just using it. Thanks again, really helpful! – bigbadpiano Apr 28 '13 at 18:51
  • Use \centering inside the intertext commands for a more readable centred layout, e.g., \shortintertext{\centering and}. – loved.by.Jesus Feb 21 '19 at 16:10
3
\documentclass{article}
\usepackage{amsmath}


\begin{document}


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

\end{document}

enter image description here

1
  • Oh wow, that was so simple. I feel pretty stupid now. I knew there would be some simple fix! Thank you! – bigbadpiano Apr 28 '13 at 18:27

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.