LaTeX入门一丢丢

LaTeX入门一丢丢

代码源自这份文档,写得超棒!

 

当然基于我的理解做出了一丢丢魔改。*=—=*

 

\documentclass[UTF8]{ctexart}

\usepackage{amsmath}

\begin{document}

你好,world!$E=mc^2$ 阿巴阿巴 %行内

[E = mc^2] %行间

[ z = r^as\cdot e^{2\pi i}_{12}3. ]%上下标 注意花括号的使用

 

$\sqrt{x}$, $\frac{1}{2}$. %平方根 分式

 

[ \sqrt{x}, ] %行间 与 行内模式的分式输出在大小上有差异

 

[ \frac{1}{2}. ]

 

 

$\sqrt{x}$, $\dfrac{1}{2}$. %用 \dfrac \tfrac 可实现大小的改变

 

[ \sqrt{x}, ]

 

[ \tfrac{1}{2}. ]

 

$\sqrt{x}$, $\tfrac{1}{2}$.

 

[ \sqrt{x}, ]

 

[ \dfrac {1}{2}. ]

 

[ \pm\; \times \; \div\; \cdot\; \cap\; \cup\; \geq\; \leq\; \neq\; \approx \; \equiv ]%运算符

 

 

$ \sum{i=1}^n i\quad\quad\quad \prod{i=1}^n $ %强制限制或不限制

$ \sum\limits _{i=1}^n i\quad \prod\limits _{i=1}^n $

 

[ \lim_{x\to0}x^2 \quad \iiint_a^b x^2 dx ]

[ \lim\nolimits _{x\to0}x^2\quad \iiiint\iiiint\iiiint\nolimits_a^b x^2 dx ]

 

[ \Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) ] %不做魔改至多五层

[ \Biggl[\biggl[\Bigl[\bigl[[x]\bigr]\Bigr]\biggr]\Biggr] ]

[ \Biggl {\biggl {\Bigl {\bigl {{x}\bigr }\Bigr }\biggr }\Biggr} ]

[ \Biggl\langle\biggl\langle\Bigl\langle\bigl\langle\langle x

\rangle\bigr\rangle\Bigr\rangle\biggr\rangle\Biggr\rangle ]

[ \Biggl\lvert\biggl\lvert\Bigl\lvert\bigl\lvert\lvert x

\rvert\bigr\rvert\Bigr\rvert\biggr\rvert\Biggr\rvert ]

[ \Biggl\lVert\biggl\lVert\Bigl\lVert\bigl\lVert\lVert x

\rVert\bigr\rVert\Bigr\rVert\biggr\rVert\Biggr\rVert ]

 

[ x_1,x_2,\dots ,x_n\quad 1,2,\cdots ,n\quad %省略号

\vdots\quad \ddots ]

 

[ \begin{pmatrix} a&b&1\c&d&3 \end{pmatrix} \quad %矩阵

\begin{bmatrix} a&b\c&d \end{bmatrix} \quad

\begin{Bmatrix} a&b\c&d \end{Bmatrix} \quad

\begin{vmatrix} a&b\c&d \end{vmatrix} \quad

\begin{Vmatrix} a&b\c&d \end{Vmatrix} ]

 

Marry has a little matrix $ ( \begin{smallmatrix} a&b\c&d \end{smallmatrix} ) $. %行内小矩阵

 

 

\begin{multline} %不对齐

x = a+b+c+{} \

d+e+f+g

\end{multline}

 

[\begin{aligned} %对齐

x ={}& a+b+c+{} \

&d+e+f+g

\end{aligned}]

 

\begin{gather} %公式组

a = b+c+d \

x = y+z

\end{gather}

\begin{align}

a &= b+c+d \

x &= y+z12

\end{align}

\begin{gather*} %公式组 无编号

a = b+c+d \

x = y+z

\end{gather*}

\begin{align*}

a &= b+c+d \

x &= y+z

\end{align*}

 

[ y= \begin{cases} %分段函数

-x,\quad x\leq 0 \

x,\quad x>0

\end{cases} ]

 

[

y= \begin{cases}

-x,\quad x\leq 0 \

x,\quad x>0

\end{cases}

]

 

\end{document}

 

 

\documentclass[UTF8]{ctexart}

\title{你好,world!}

\author{Liam}

\date{\today}

\begin{document}

\maketitle

\tableofcontents %注意这个控制序列的位置

\section{你好中国}

中国在East Asia.

\subsection{Hello Beijing}

北京是capital of China.

\subsubsection{Hello Dongcheng District}

\paragraph{Tian'anmen Square}

is in the center of Beijing

\subparagraph{Chairman Mao}

is in the center of 天安门广场。

\subsection{Hello 山东}

\paragraph{山东大学} is one of the best university in 山东。

\end{document}

 

 

\documentclass[UTF8]{ctexart}

\title{你好,world!}

\author{Liam}

\date{\today}

\begin{document}

\maketitle %还多了一个控制序列 maketitle。这个控制序列能将在导言区中定义的标题、作者、日期按照预定的格式展现出来。

你好,world!

\end{document}

 

\documentclass[UTF8]{ctexart}

\begin{document}

你好,world!

\end{document}

 

 

\documentclass{article}

\usepackage{xeCJK} %调用 xeCJK 宏包

\setCJKmainfont{SimSun} %设置 CJK 主字体为 SimSun (宋体)

\begin{document}

你好,world!

\end{document}

 

 

\documentclass{article}

% 这里是导言区

%你可以将导言区理解为是对整篇文档进行设置的区域——在导言区出现的控制序列,往往会影响整篇文档的格式。

%比如,我们通常在导言区设置页面大小、页眉页脚样式、章节标题样式等等。

\begin{document}

Hello, world!\%

\end{document}

posted @ 2021-10-13 21:01  BriChen  阅读(91)  评论(0)    收藏  举报