LaTeX/Advanced Mathematics
Getting Started
Introduction
Installation
Installing Extra Packages
Basics
Common Elements
Document Structure
Text Formatting
Paragraph Formatting
Colors
Fonts
国庆节游玩作文List Structures
Special Characters
Internationalization
Rotations
Tables
Title creation
Page Layout
Importing Graphics
Floats, Figures and Captions
Footnotes and Margin Notes
Hyperlinks
This page outlines some more advanced us of mathematics markup using LaTeX. In particular it makes heavy u of the AMS-LaTeX packages supplied by the American Mathematical Society.
Equation numbering
The equation environment automatically numbers your equation.
\begin{equation} f(x)=(x+a)(x+b) \end{equation}
You can also u the \label and \ref(or \eqref from the amsmath package) commands to label and reference equations, respectively. For equation number 1, \ref results in and \eqref results in :
失时
\begin{equation}\label{eq:someequation} 5^2 - 5 = 20
\end{equation} this references the equation
\ref{eq:someequation}.
\begin{equation}\label{eq:erl} a = bq + r \end{equation}
where \eqref{eq:erl} is true if $a$ and $b$ are integers
ps怎么写字
with $b \neq c$.
Further information is provided in the labels and cross-referencing chapter.
To have the enumeration follow from your ction or subction heading, you must u the amsmath package or u AMS class documents. Then enter
\numberwithin{equation}{ction}
to the preamble to get enumeration at the ction level or
\numberwithin{equation}{subction}
to have the enumeration go to the subction level.
\documentclass[12pt]{article}\upackage{amsmath}
\numberwithin{equation}{subction}\begin{document}
\ction{First Section}\subction{A subction}
\begin{equation} L' = {L}{\sqrt{1-\frac{v^2}{c^2}}}
\end{equation}\end{document}
If the style you follow requires putting dots after ordinals (as it is required at least in Polish typography) the \numberwithin{equation}{subction}command in preamble will result in the equation number in the above example to be rendered in this way: (1.1..1).
团队愿景To remove the duplicate dot, add following command immediately after \numberwithin{equation}{subction}:
\renewcommand{\theequation}{\thection\arabic{equation}}
For numbering scheme using \numberwithin{equation}{subction}u:
\renewcommand{\theequation}{\thesubction\arabic{equation}}
in the preamble of the document.
Note: Though it may look like the \renewcommand works by itlf, it won't ret the equation number with each new ction. It must be ud together with manual equation number retting after each new ction beginning or with the much cleaner \numberwithin.
Subordinate equation numbering
To number subordinate equations in a numbered equation environment, place the part of document containing them in a subequations environment:
\begin{subequations} Maxwell's equations: \begin{align}
B'&=-\nabla\times E,\\ E'&=\nabla\times B - 4\pi j,
\end{align}\end{subequations}
Referencing of subordinate equations can be done in two methods. Adding a label after the \begin{subequations}command, will reference to the main equation (1.1 the ca prented). Adding a label after at the end of each line, before the \\command, will reference to the sub-equation (1.1a or 1.1b the ca prented). It is possible to add both labels in ca both types of references are ne
eded.
Vertically aligning displayed mathematics
An often encountered problem with displayed environments (displaymath and equation) is the lack of any ability to span multiple lines. While it is possible to define lines individually, the will not be aligned.
Above and below
The \overt and \undert commands[3] typet symbols above and below expressions. Without AmsTex the same result of \overt can be obtained with \stackrel. This can be particularly uful for creating new binary relations:
\[ A \overt{!}{=} B; A \stackrel{!}{=} B \]
or to show usage of L'Hôpital's rule: Array
\[\lim_{x\to0}{\frac{e^x-1}{2x}}
\overt{\left[\frac{0}{0}\right]}{\undert{\mathrm{H}}{=}}
\lim_{x\to0}{\frac{e^x}{2}}={\frac{1}{2}} \]
It's convenient to define a new operator that will t the equal sign with H and provided fraction:
\newcommand{\Heq}[1]{\overt{\left[#1\right]}{\undert{\mathrm{H}}{=}}}
to reduce above example to:
\[\lim_{x\to0}{\frac{e^x-1}{2x}} \Heq{\frac{0}{0}} \lim_{x\to 0}{\frac{e^x}{2}}={\frac{1}{2}} \]
If the purpo is to make comments on particular parts of an equation, the \overbrace and \underbrace commands may be more uful, however they have a different syntax:
\[ z =\overbrace{ \underbrace{x}_\text{real} +
\underbrace{iy}_\text{imaginary} }^\text{complex number} \]
Sometimes the comments are longer than the formula being commented on, which can cau spacing problems. The can be removed using the \mathclap command[4]:
\[ y = a + f(\underbrace{b x}_{ \ge0\text{ by
assumption}})= a + f(\underbrace{b x}_{
\mathclap{\ge0\text{ by assumption}}})\]
Alternatively, to u brackets instead of braces u \underbracket and \overbracket commands[4]:
\[ z =\overbracket[3pt]{ \underbracket{x}_{\text{real}} +
\underbracket[0.5pt][7pt]{iy}_{\text{imaginary}}
}^{\text{complex number}} \]
The optional arguments t the rule thickness and bracket height respectively:
\underbracket[rule thickness][bracket height]{argument}_{text below}
The \xleftarrow and \xrightarrow commands[3] produce arrows which extend to the length of the text. Yet again, the syntax is different: the optional argument (using [ & ]) specifies the subscript, and the mandatory argument (using { & }) specifies the superscript (this can be left empty).
\[ A \xleftarrow{\text{this way}} B \xrightarrow[\text{or that
way}]{} C \]
For more extensible arrows, you must u mathtools package:
\[ a \xleftrightarrow[under]{over} b\\% A \xLeftarrow[under]{over} B\\
% B \xRightarrow[under]{over} C\\% C \xLeftrightarrow[under]{over} D\\
% D \xhookleftarrow[under]{over} E\\% E \xhookrightarrow[under]{over}
F\\% F \xmapsto[under]{over} G\\\]
and for harpoons: Array
\[ H \xrightharpoondown[under]{over} I\\% I
\xrightharpoonup[under]{over} J\\% J \xleftharpoondown[under]{over}
K\\% K \xleftharpoonup[under]{over} L\\% L
池馆\xrightleftharpoons[under]{over} M\\% M
\xleftrightharpoons[under]{over} N \]
align and align*
The align and align* environments[3] are ud for arranging equations of multiple lines. As with matri
ces and tables, \\specifies a line break, and &is ud to indicate the point at which the lines should be aligned.
The align* environment is ud like the displaymath or equation* environment: Array
\begin{align*} f(x) &= (x+a)(x+b) \\&= x^2 + (a+b)x + ab
\end{align*}
To force numbering on a specific line, u the \tag{...}command before the linebreak.
The align is similar, but automatically numbers each line like the equation environment. Individual lines may be referred to by placing a \label{...}before the linebreak. The \nonumber or \notag command can be ud to suppress the number for a given line:
\begin{align} f(x) &= x^4 + 7x^3 + 2x^2 \nonumber\\城市设计
&\qquad{} + 10x + 12 \end{align}个人自荐书
Notice that we've added some indenting on the cond line. Also, we need to inrt the double braces {} before the + sign becau otherwi latex won't create the correct spacing after the + sign. The reason for this is that without the braces, latex interprets the + sign as a unary operator, instead of the binary operator that it really is.
More complicated alignments are possible. The following example illustrates the alignment rule of align*: Array
\begin{align*} a & b & c & d & e & f & g & h & i & j
\end{align*}
Braces spanning multiple lines
Additional &'s on a single line will specify multiple "equation columns", each of which is aligned. If you want a brace to continue across a new line, do the following:
\begin{align} f(x) &= \pi\left\{ x^4 + 7x^3 + 2x^2
\right.\nonumber\\&\qquad\left. {} + 10x + 12
\right\}\end{align}
In this construction, the sizes of the left and right braces are not automatically equal, in spite of the u of \left\{ and \right\}. This is becau each line is typet as a completely parate equation —notice the u of \right. and \left. so there are no unpaired \left and \right commands within a line. (The aren't needed if the formula is on one line.) You can control the size of the braces manually with the \big, \Big, \bigg, \Bigg commands.
Or you can replicate the height of the taller equation in the other using the \vphantom command: Array
\begin{align} A &= \left(\int_t XXX \right.\nonumber\\
&\qquad\left.\vphantom{\int_t} YYY \dots\right)
\end{align}
排球场尺寸
The cas environment
The cas environment[3] allows the writing of piecewi functions:
\[ u(x)=\begin{cas} \exp{x} & \text{if } x \geq0\\1 &
\text{if } x < 0\end{cas} \]
Just like before, you don't have to take care of definition or alignment of columns, LaTeX will do it for you. Unfortunately, it ts the internal math environment to text style, leading to such result:
To force display style for equations inside this construct, u dcas environment[4]: Array
\[ a =\begin{dcas} \int x\, dx\\ b^2\end{dcas} \]