最近作业要求使用latex语法进行排版编写,然后就学习了一下相关语法,发布在这里,方便之后进行查找
latex logo
一.代码
\documentclass[UTF8]{ctexart}
\usepackage{amsmath}
\title{homework}
\author{李庆文}
\date{\today}
\begin{document}
\maketitle
\section{你好中国}
你好 ,Hello world!
\subsection{hello beijing}
北京is the capital of china
\subsubsection{Hello Doncheng District}
\paragraph{Tian'anmen Square}
is in the center of Beijing
\subparagraph{Chairman Mao}
is in the center of Tian'anmen Square
\subsection{Hello 山东}
\paragraph{山东大学} is one of the best university in 山东
\section{数学公式}
\begin{equation}
E=mc^2
\end{equation}
\paragraph{句内公式}要这么写
$e=mc^2$
\paragraph{常规公式}要这么写
\[e=m^c\]\
\paragraph{根式与分式}
%行内和行间根号x
$\sqrt{x}$
\[\sqrt{x}\]
%行内和行间1/2
$\frac{1}{2}$
\[\frac{1}{2}\]
\paragraph{小型运算符}
\[ \pm\; \times \; \div\; \cdot\; \cap\; \cup\;
\geq\; \leq\; \neq\; \approx \; \equiv \]
\paragraph{大型运算符}
\paragraph{连加}
\[\sum_{i=1}^n \]
\paragraph{连乘}
\[\prod_{i=1}^n\]
\paragraph{极限}
\[ \lim_{x\to0}x^2 =0\]
\paragraph{积分}
\[\int_a^b x^2 dx \]
\paragraph{积分和极限:显示的压缩或者不压缩上下标}
\[ \lim\nolimits _{x\to0}x^2\quad \int\nolimits_a^b x^2 dx \]
\paragraph{多重积分}
%\[ \iint\quad \iiint\quad \iiiint\quad \idotsint \]
\paragraph{括号}
\[x\]
\[(x)\]
\[\bigl((x)\bigr)\]
\paragraph{中括号}
\[x\]
\[[x]\]
\[\bigl[[x]\bigr]\]
\paragraph{大括号}
\[x\]
\[\{x\}\]
\[\bigl\{\{x\}\bigr\}\]
\[ \Biggl \{\biggl \{\Bigl \{\bigl \{\{x\}\bigr \}\Bigr \}\biggr \}\Biggr\} \]
\paragraph{省略号}
\[x_1,x_2,\dots,x_n\]
\[x_1,x_2,\cdots,x_n\]
\[x_1,x_2,\vdots,x_n\]
\[x_1,x_2,\ddots,x_n\]
\paragraph{矩阵}
$$
\begin{pmatrix}
1 & 2 \\
3 & 4
\end{pmatrix}
$$
$$
\begin{bmatrix}
1 & 2 \\
3 & 4
\end{bmatrix}
$$
$$
\begin{Bmatrix}
1 & 2 \\
3 & 4
\end{Bmatrix}
$$
$$
\begin{vmatrix}
1 & 2 \\
3 & 4
\end{vmatrix}
$$
$$
\begin{Vmatrix}
1 & 2 \\
3 & 4
\end{Vmatrix}
$$
\paragraph{长公式}
\begin{multline}
x=a+b+c+\\
d+e+f
\end{multline}
\paragraph{对齐的长公式}
$$
\begin{aligned}
x={}& a+b+c+{}\\
&d+e+f
\end{aligned}
$$
\paragraph{公式组}
\begin{gather}
a = b+c+d \\
x = y+z
\end{gather}
\begin{align}
a &= b+c+d \\
x &= y+z
\end{align}
\paragraph{分段函数}
$$
y=\begin{cases}
-x,\quad x\leq 0\\
x \quad x>0
\end{cases}
$$
\end{document}
二.效果
image.pngimage.png
image.png
image.png
常用的用法应该已经可以覆盖掉了,如果有后续再来补充,继续加油啦.
网友评论