內聯方程式第二行的右對齊

內聯方程式第二行的右對齊

我在專案環境中有一個內聯方程式。問題是如何將第二條線對齊到右側。如何實現這項目標?

\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在第二行前面使用 a,但\mbox{}前面要加上 a,因為\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}

在此輸入影像描述

相關內容