0

I have an inline equitation inside an item-environment. The problem is to align the second line on the right side. How to achieve this?

\documentclass[a4paper,twocolumn]{scrbook}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{enumerate}
\usepackage{amsmath}

\begin{document}

\begin{enumerate}
\item Theoretically, the calculated voltage should be
correspond to the measured voltage. But in practice it is
often \emph{not} the case. There are small deviations. Calculate first
the absolute deviations according to the rule:\\
\medskip{}\\
$\left\langle\text{absolute deviation}\right\rangle = \\ \left\langle\text{calc. value}\right\rangle - \left\langle\text{measured value}\right\rangle$\\
\medskip{}\\
The ,,measured value`` here is of course the ,,measured voltage``.\\
Calculate all absolute deviations and enter the results in the
table.
\item Further steps
\end{enumerate}

\end{document}

enter image description here

2 Answers 2

2

LaTeX is not a word processor. Usage of \\ should be limited to where explicitly ending lines is necessary.

\documentclass[a4paper,twocolumn]{scrbook}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{enumerate}
\usepackage{amsmath}

\setlength{\multlinegap}{0pt}

\begin{document}

\begin{enumerate}
\item Theoretically, the calculated voltage should be
correspond to the measured voltage. But in practice it is
often \emph{not} the case. There are small deviations. Calculate first
the absolute deviations according to the rule:
\begin{multline*}
\langle\text{absolute deviation}\rangle = \\ 
\langle\text{calc.\ value}\rangle - \langle\text{measured value}\rangle
\end{multline*}
The ,,measured value`` here is of course the ,,measured voltage``.

Calculate all absolute deviations and enter the results in the
table.

\item Further steps

\end{enumerate}

\end{document}

I also removed \left and \right that do nothing useful in that formula.

enter image description here

Note calc.\ value in order to avoid an end-of-sentence period. It could also be calc.\@ value.

0

The trick is to use a \hfill in front of the second line, but with a \mbox{} in front of it, because \hfill doesn't work at the very beginning of the line.

\documentclass[a4paper,twocolumn]{scrbook}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{enumerate}
\usepackage{amsmath}

\begin{document}

\begin{enumerate}
\item Theoretically, the calculated voltage should be
correspond to the measured voltage. But in practice it is
often \emph{not} the case. There are small deviations. Calculate first
the absolute deviations according to the rule:\\
\medskip{}\\
$\left\langle\text{absolute deviation}\right\rangle = \\ \mbox{}\hfill \left\langle\text{calc. value}\right\rangle - \left\langle\text{measured value}\right\rangle$\\
\medskip{}\\
The ,,measured value`` here is of course the ,,measured voltage``.\\
Calculate all absolute deviations and enter the results in the
table.
\item Further steps
\end{enumerate}

\end{document}

enter image description here

3
  • As long as you're loading amsmath, you might as well use multline. But there are several other problems with OP's code that have been fixed in the other answer.
    – Teepeemm
    Commented Apr 13, 2022 at 14:24
  • I do not know the terminus "OP's code".
    – Michael.H
    Commented Apr 14, 2022 at 15:54
  • OP = original poster. So there are several other problems with the original code that should also be fixed. But I'm now seeing that you are the original poster, so I would encourage you to look through the other answer to see what else has changed. At a minimum, you should use \[...\] instead of `\medskip{}\\$...$\medskip{}\` if you're wanting to have an equation displayed by itself.
    – Teepeemm
    Commented Apr 14, 2022 at 16:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .