简体   繁体   English

在Latex中对每个等式线进行编号

[英]Numbering each line of equation in Latex

Is there a way to label every line of multiline equation with a separate subindex? 有没有办法用单独的子索引标记多行方程的每一行?

For example, I would like to obtain sth like (in the output) 例如,我想得到......(在输出中)

a = b (1.23.1) a = b(1.23.1)

c = d (1.23.2) c = d(1.23.2)

= f (1.23.3) = f(1.23.3)

and then be able to refer to either whole multiline equation ("As seen in 1.23 bla bla bla...") or to a specific line ("In 1.23.3 we have redefined d..."). 然后能够参考整个多线方程(“见于1.23 bla bla bla ...”)或特定线(“在1.23.3中我们重新定义了d ......”)。

For anyone wanting the answer to this query, here's a useful tex.stackexchange answer: https://tex.stackexchange.com/questions/118086/numbering-all-lines-of-an-array 对于想要这个查询的答案的人来说,这是一个有用的tex.stackexchange答案: https ://tex.stackexchange.com/questions/118086/numbering-all-lines-of-an-array

The essentials are as follows: 要点如下:

%% in your preable
\usepackage{amsmath}

%% in your document
\begin{subequations}
\begin{align}
% YOUR MULTILINE MATHEMATICS WITH & ALIGNMENT CHARACTERS AND \\ NEWLINE MARKERS
% place \label{THIS-LINE} on each line, and you can cross-reference the line using \ref{THIS-LINE}
\end{align}
% place a \label{WHOLE-THING} here, and you can cross-reference the whole thing using \ref{WHOLE-THING}
\end{subequations}

Here's an example: 这是一个例子:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}

\begin{subequations}
\begin{align}
\frac{\mathrm{d} x}{\mathrm{d} t} &=\sigma(y-x)\label{eqn:line-1} \\
\frac{\mathrm{d} y}{\mathrm{d} t} &=x(\rho-z)-y\label{eqn:line-2} \\
\frac{\mathrm{d} z}{\mathrm{d} t} &=x y-\beta z
\end{align}
\label{eqn:all-lines}
\end{subequations}

Look at the first line \ref{eqn:line-1}, and now look at the second line \ref{eqn:line-2}. They are both part of the whole system \ref{eqn:all-lines}.

\end{document}

多行数学,每行标记为数字+字母,并对每行和整个系统进行交叉引用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM