Formula issues in using Latex (size, line breaks, labels)

When writing a paper, you usually don't encounter the problem of formula line wrapping, but when you encounter it, it is a very headache. Usually when writing long formulas, I write them in Mathtype and then convert them into Latex. Only shorter formulas or symbols are typed by hand.

The following formula requires \usepackage{amsmath} mathematical environment support

A less ideal but definitely useful way is to narrow the formula

Reduce the entire formula by adding a small environment at both ends, or adding a tiny environment. The advantage of this is that it is easier to use for formulas that are just over a little longer. The disadvantage is that the reduction will be
a bit uncoordinated, and if you use tiny, it will be a bit too small.

\begin{small}
  \begin{align}
   a=0.001
  \end{align}
\end{small}

Use the commonly used align environment formula to wrap the line

When using the align environment, the formula is aligned with the ampersand, and the \ mark is used to wrap the formula.

	\begin{align}
		a+b &= b+a \\
		1+2= & 2+1
	\end{align}

In this way, line wrapping belongs to two different formulas, because there will be two numbers. If it is a longer formula to wrap, only the last line needs to be numbered, and \notag is needed to prevent the numbering. Currently, I feel that this method is the same. The most useful way. However, when there are multiple formulas, you need to manually align them, otherwise they will be a bit ugly. If you don't mind the trouble, this is basically enough for most formulas.

	\begin{align}
		a+b &= b+a \notag \\
		1+2= & 2+1
	\end{align}

Use the gather environment to write multi-line formulas

Compared with the align environment, the gather environment is more suitable for writing multi-line formulas together, and is automatically aligned in the middle, which is more convenient.
Formulas are automatically numbered

\begin{gather}
		a+b = b+a \\
		1+2+3= 2+2+2
\end{gather}

If all are not numbered, just add * in the environment.

\begin{gather*}
		a+b = b+a \\
		1+2+3= 2+2+2
\end{gather*}

Single lines without numbering still use \notag

	\begin{gather}
	a + b = b + a \notag \\
	1+2 = 2 + 1
	\end{gather}

Use split environment

Compared with the align environment, it only carries a number and does not need to add \notag to each line. The others are the same as align. If there are many formula lines, it is recommended to use this method to write the formula.
Also use the ampersand, \ to realize formula line wrapping.
You need to add \usepackage{amssymb} in the header file to use the split environment, otherwise an error will be reported.

	\begin{equation}
		\begin{split}
		\cos 2x &= \cos^2 x - \sin^2x \\
		&=2\cos^2x-1
		\end{split}	
	\end{equation}

Copyright © 2020 by RichardYang. All rights reserved.
For reference only, reprinting is strictly prohibited, thank you.

Guess you like

Origin blog.csdn.net/u011442170/article/details/107637393