6

I have a group of equations on the left hand side and a group of explanations on the right hand side. Since the number of lines in both group differ from each other I use the aligned and alignedat for automatic alignment.

How do I get equation numbers for f_1 and f_2? There are a lot of similar questions like this on stackexchange, but the answers boil down to use another environment like align or split. This is not feasible in my case, since I would lose the automatic alignment.

Example:

\documentclass{scrartcl}
\usepackage{amsmath}

\begin{document}
    \begin{equation}
    \begin{aligned}[c]
    f_1 &= a + b\\ %1.1 here
    f_2 &= a - b\\ %1.2 here
    \end{aligned}
    \qquad
    \begin{alignedat}{2}
    a &= &&\text{ Some one line text}\\
    b &= &&\text{ Some two line text}\\
    &&&\text{ 2nd line}\\
    \end{alignedat}
    \end{equation}
\end{document}

How it should look

Additionally it would be nice if I could freely decide if the numbers would be place left, middle (like in the picture) or right of the equation.

Thanks for your time!

  • Welcome to TeX.SE. Valid placement specifier options for an aligned environment are [t] ("top"), [c] (centered -- the default), and [b] ("bottom"). [r] is not a valid option and is simply ignored. – Mico Apr 15 '18 at 14:08
5

I don't think this is the best way to set the display.

\documentclass{scrartcl}
\usepackage{amsmath,varwidth}
\usepackage[nopar]{lipsum}

\begin{document}

\lipsum[3]
\begin{center}
\begin{minipage}{0.2\textwidth}% <--- adjust to the needed width
\vspace*{-\baselineskip}
\begin{flalign}
f_1 &= a + b &\\
f_2 &= a - b &
\end{flalign}
\end{minipage}
\qquad
$\begin{aligned}
a &= \text{Some one line text}\\
b &= \begin{varwidth}[t]{0.7\textwidth}
     Some two line text\\
     second line
     \end{varwidth}
\end{aligned}$
\end{center}
\lipsum[4]

\end{document}

enter image description here

6

Something like this?

enter image description here

\documentclass{scrartcl}
\usepackage{amsmath}
\numberwithin{equation}{section}
\begin{document}
\setcounter{section}{1} % just for this example

\noindent
\begin{minipage}{0.25\textwidth} % choose a suitable width
\setlength\abovedisplayskip{0pt}
\setlength\belowdisplayskip{0pt}
\begin{align}
    f_1 &= a + b\\ %1.1 here
    f_2 &= a - b   %1.2 here
\end{align}
\end{minipage}
\hspace{2cm} % or whatever spacing amount is desired
\begin{minipage}{0.6\textwidth}
$\begin{aligned}
    a &= \text{A first line of text}\\
    b &= \text{A second line of text}\\
      &\quad \text{ And a third line}
 \end{aligned}$
\end{minipage}
\end{document}
  • Thanks for the minipage idea! But I'll go with egreg, because the without the second minipage, I get automatic horizontal alignment between the equations and the text. – user3608078 Apr 17 '18 at 18:23

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.