行内方程式第二行右对齐

行内方程式第二行右对齐

我在项目环境中有一个内联方程式。问题是将第二行对齐到右侧。如何实现?

\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}

在此处输入图片描述

答案1

LaTeX 不是文字处理器。\\应限制在需要明确结束行的情况下使用。

\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}

我还删除了\left\right公式中没有任何用处的部分。

在此处输入图片描述

注意calc.\ value,以避免句末出现句号。也可以是calc.\@ value

答案2

诀窍是\hfill在第二行前面使用,但在\mbox{}其前面使用,因为\hfill在该行的最前面不起作用。

\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}

在此处输入图片描述

相关内容