latex中常用的數學命令

2021-10-12 17:16:56 字數 3669 閱讀 4156

%導言區

\documentclass%book report letter article

\title

\author

\date

\usepackage

\usepackage%羅馬數字的巨集包

%\usepackage

\newcommand\degree

\begin

hello world!%空行表示回車

let $f(x)$ be defined by the formula $$f(x) = 3x^2+x-1$$.%$$表示公式換行

\begin %帶標號的行間公式

ab^2 = bc^2+ac^2.

\end

%字型族設定(羅馬字型、無襯線字型、打字機字型0

\textrm

\rmfamily roman family

\sffamily sans serif family

\ttfamily typewriter family %使用大括號限定字型範圍

% 字型系列設定(粗細、寬度)

\tex*** \textbf

%字型形狀(直立、斜體、仿斜體、小型大寫)

\textup

\subsection%用於輸出行間公式

交換律是

\begin

a+b = b+a

\end

\subsection%編號並且可以用於引用,\ref與前文之間不能有空格

交換律見式\ref

\begin

a^2 + b^2 = b^2 + a^2 \label

\end

\subsection%這時引用的是小節編號

新的公式見\ref節

\begin%使用equation*要使用環境變數\usepackage

a1+b1 = b1+a1\label

\end

\begin

2x + 3y &= 7\\

5x - 2y &= 2

\end

\subsection

$$\alpha$$%兩個美元是居中對齊,乙個美元是行內公式

$\beta$

$\gamma$

$\epsilon$

$\pi$

$\omega$

$\cos^2x+sin^2x = 1$

%$\alpha$%大寫希臘字母還是沒打出來

%$\beta$

% $\gamma$

% %$\epsilon$

% $\pi$

% $\omega$

\[1+2=2+1=3\]

\[%矩陣環境的開始結束都要寫上\[\],用&分割列,用\\分割行

\begin

0&1\\

2&3\end

\]\[

\begin%小括號

0&1\\

2&3\end

\]\[

\begin%中括號

0&1\\

2&3\end

\]\[

\begin%大括號

0&1\\

2&3\end

\]\[

\begin%單豎線

0&1\\

2&3\end

\]\[

\begin%雙豎線

0&1\\

2&3\end

\]\[

\begin

0&1\\

2&3\end\qquad %是空格的意思

\begin%小括號

0&1\\

2&3\end

\]\[

a = \begin

a_^2 & a_^2 & a_^2 \\

0 & a_ & a_ \\

0 & 0 & a_

\end

\]%矩陣中常用的省略號常用\dots \vdots \ddots 實現

\[a = \begin

a_ & \dots & a_\\

& \ddots & \vdots \\

0 & & a_

\end_

\]%分塊矩陣(巢狀矩陣)

\[\begin

\begin

1&0 \\ 0&1

\end

& \text \\ %數學模式轉文字

\text &

\begin

1 & 0 \\ 0 & 1

\end

\end

\]%三角矩陣

\[\begin

a_ & a_ & \cdots & a_\\

& a_ & \cdots & a_ \\

& &ddots & \vdots \\

\multicolumn[0pt]}

& & a_

\end

\]%hdotsfor跨列省略號

\[\begin

1 & \frac 12 & \dots & \frac 1n \\

\hdotsfor\\

m & \frac m2 & \dots & \frac mn

\end

\]%使用smallmatrix排版行內小矩陣

\begin

\left(

\begin

x & -y \\ y & x

\end

\right)

\end

\[\begin

\frac12 & 0 \\

a & -\frac abc\\

\end

\]%多行公式的排版,gather 環境中好像不能使用&,空格使用\quad

\begin

a+b = b+a\\

ab \quad ba

\end

\begin %使用notag命令,使得在gather環境也不編號

3^2+4^2=5^2 \notag\\

5^2+12^2=13^2 \notag\\

5^2+12^2=13^2

\end

\begin%不編號

a+b = b+a\\

ab ba

\end

\begin%align用於對齊

x&=t+\cos t+1 \\

y&=2\sin t

\end

\begin

x&=t+\cos t+1 &x &=\cos t & x&=t\\

y&=2t &y &=\sin(t+1) &y&=\sin t

\end

%split環境(對齊採用align環境的方式,編號在中間)

\begin

\begin

x&=t+\cos t+1 \\

x &=\cos t

\end

\end

%cases 環境邊界分段函式,mathbb用於輸出花體字元

\begin

d(x) = \begin

1,&\textx \in \mathbb;\\

0,&\textx \in \mathbb\setminus \mathbb;

\end

\end

\end

latex常用的命令

newcommand 引數個數 或者如下 newcommand 引數個數 帶 的為短命令 命令內容不能出現段落,即不能有 par renewcommand 引數個數 對原來已有的命令重新定義 renewcommand 引數個數 declaremathsizes 第乙個大括號裡是文件使用的字型大小。只...

常用數學符號的 LaTeX 表示方法

以下內容主要摘自 乙份不太簡短的 latex2e 介紹 指數和下標可以用 和 後加相應字元來實現。比如 2 平方根 square root 的輸入命令為 sqrt,n 次方根相應地為 sqrt n 方根符號的大小由latex自動加以調整。也可用 surd 僅給出 符號。比如 3 命令 overlin...

常用數學符號的 LaTeX 表示方法

指數和下標可以用 和 後加相應字元來實現。比如 2 平方根 square root 的輸入命令為 sqrt,n 次方根相應地為 sqrt n 方根符號的大小由latex自動加以調整。也可用 surd 僅給出 符號。比如 3 命令 overline 和 underline 在表示式的上 下方畫出水平線...