文章目录
视频中提到了一个在线编辑latex的网站:overleaf,可以试试。
LaTeX Tutorial 1 - Creating a LaTex Docunment
\documentclass[11pt]{article}
\begin{document}
Hello!This is my first \LaTeX document!A rectangle has side length of
(
x
+
1
)
(x+1)
(x+1) and
(
x
+
3
)
(x+3)
(x+3).
The equation
A
(
x
)
=
x
2
+
4
x
+
3
A(x) = x^2 + 4x + 3
A(x)=x2+4x+3 gives the area of rectangle.
\end{document}
基本结构
\documentclass[]{article}
//[]都是用于可选参数的
\begin{document}
Hello World!
\end{document}
2 有两种方法创建换行
- hard return(硬换行):在两行之间留出一个空行
- soft return(软换行):\
3 数学模式
- $数学公式$ 与文本显示在同一行
- $$数学公式$$ 另起一行
LaTeX Tutorial 2 - Common Mathmatical Notation
\documentclass[11pt]{article}
\usepackage{amsmath,amssymb,amsfonts}
\begin{document}
superscripts $2x^3$
$$2x^{34}$$
$$2x^{3x+4}$$
roots
$$\sqrt{2}$$
$$\sqrt[3]{2}$$
$$\sqrt{x^2+y^2}$$
$$\sqrt{ 1 + \sqrt{x}}$$
Fractions
$$\frac{2}{3}$$
About $\displaystyle \frac{2}{3}$ of glass is full.
\end{document}
1.多位数字只识别成一位时
- 处理方法:加一个大括号{}
2.根号
roots
$$\sqrt{2}$$
$$\sqrt[3]{2}$$ [方括号里面放的是根号几次方]
$$\sqrt{x^2+y^2}$$
$$\sqrt{ 1 + \sqrt{x}}$$ //嵌套sqrt
2
\sqrt{2}
2
2
3
\sqrt[3]{2}
32
x
2
+
y
2
\sqrt{x^2+y^2}
x2+y2
1
+
x
\sqrt{ 1 + \sqrt{x}}
1+x
3.分数
Fractions
Fractions
$$\frac{2}{3}$$
About $\displaystyle \frac{2}{3}$ of glass is full.
//没有display的话,分数的显示会很小,为了跟字体一样大
2
3
\frac{2}{3}
32
About
2
3
\displaystyle \frac{2}{3}
32 of glass is full.
LaTeX Tutorial 3 - Bracekets,Tables,and Arrays
1.特殊符号
The distributive property states that $a(b+c)=ab+ac$,for all $a,b,c\in \mathbb{R}$
The distributive property states that a ( b + c ) = a b + a c a(b+c)=ab+ac a(b+c)=ab+ac,for all a , b , c ∈ R a,b,c\in \mathbb{R} a,b,c∈R
2.括号的大小适应内容
- 使用\left( 和\right)可以让括号的大小适应内容
$$2(\frac{1}{x^2-1})$$
$$2\left(\frac{1}{x^2-1}\right)$$
2
(
1
x
2
−
1
)
2(\frac{1}{x^2-1})
2(x2−11)
2
(
1
x
2
−
1
)
2\left(\frac{1}{x^2-1}\right)
2(x2−11)
-尖括号需要用\left \langle 和 \right \rangle
$$2\left \langle \frac{1}{x^2-1} \right\rangle$$
2 ⟨ 1 x 2 − 1 ⟩ 2\left \langle \frac{1}{x^2-1} \right\rangle 2⟨x2−11⟩
- 绝对值直接使用键盘上的|即可
$$2\left | \frac{1}{x^2-1} \right|$$
2 ∣ 1 x 2 − 1 ∣ 2\left | \frac{1}{x^2-1} \right| 2∣∣∣∣x2−11∣∣∣∣
- 微分值,直接使用\right | 是不可以的,因为right要和left匹配,因此,可以在左边加上\left但是不告诉编译器要匹配哪个符号,而是用.代替
$$\left.\frac{dx}{dy} \right |_{x=1}$$
d x d y ∣ x = 1 \left.\frac{dx}{dy} \right |_{x=1} dydx∣∣∣∣x=1
3.表格
\documentclass{article}
\usepackage{amsfonts,amssymb,amsmath}
\usepackage{float}
\begin{document}
The distributive property states that $a(b+c)=ab+ac$,for all $a,b,c\in \mathbb{R}$
$$2(\frac{1}{x^2-1})$$
$$2\left(\frac{1}{x^2-1}\right)$$
$$2\left \langle \frac{1}{x^2-1} \right\rangle$$
$$2\left | \frac{1}{x^2-1} \right|$$
$$\left.\frac{dx}{dy} \right |_{x=1}$$
Tables
\begin{tabular}{|c|c|c|c|c|c|}
$x$ & 1 & 2 & 3 & 4 & 5\\ \hline
$f(x)$ & 10 & 11 & 12 &13 & 14\\
\end{tabular}
\begin{table}[H]
\centering
\def\arraystretch{1.5}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
$x$ & 1 & 2 & 3 & 4 & 5\\ \hline
$f(x)$ & 10 & $\frac{2}{3}$ & 12 &13 & 14\\ \hline
\end{tabular}
\caption{These values represent the function $f(x)$}
\end{table}
\begin{table}[H]
\centering
\caption{These values represent the function $f(x)$}
\def\arraystretch{1.5}
\begin{tabular}{|l|p{3in}|}
\hline
$f(x)$ & $f'(x)$\\ \hline
$x>0$ & The function $f(x)$ is increasing.The function $f(x)$ is increasing.The function $f(x)$ is increasing.The function $f(x)$ is increasing.The function $f(x)$ is increasing.The function $f(x)$ is increasing.The function $f(x)$ is increasing.\\ \hline
\end{tabular}
\end{table}
Arrays:
\begin{align}
5x^2\text{place your words here}\\
5x^2-x-12=0
\end{align}
\begin{align}
5x^2-9&=x+3\\
5x^2-x-12&=0
\end{align}
\begin{align*}
5x^2-9&=x+3\\
5x^2-x-12&=0
\end{align*}
\end{document}
- \begin{tabular}{c|c|c|c|c|}
- 六个c代表有六列
- c的意思是center居中
- 表格之间的内容要用&分隔
\begin{tabular}{|c|c|c|c|c|c|}
$x$ & 1 & 2 & 3 & 4 & 5\\ \hline
$f(x)$ & 10 & 11 & 12 &13 & 14\\ \hline
\end{tabular}
- 如果是\begin{table}的话,会由编译器决定表格的位置在哪里,不受控制
- \begin{table}[H] 加上H可以决定表格放置的位置
\begin{table}[H]
\begin{tabular}{|c|c|c|c|c|c|}
\hline
$x$ & 1 & 2 & 3 & 4 & 5\\ \hline
$f(x)$ & 10 & 11 & 12 &13 & 14\\ \hline
\end{tabular}
\end{table}
\begin{table}[H]
\centering
\def\arraystretch{1.5}
\begin{tabular}{|c|c|c|c|c|c|}
\hline
$x$ & 1 & 2 & 3 & 4 & 5\\ \hline
$f(x)$ & 10 & $\frac{2}{3}$ & 12 &13 & 14\\ \hline
\end{tabular}
\caption{These values represent the function $f(x)$}
\end{table}
- 处理段落的时候 -p告诉编译器是一个段落,后面的数组告诉编译器应该把表格设置成多宽\begin{tabular}{|l|p{3in}|}
4.方程组
Arrays:
\begin{align}
5x^2\text{place your words here}\\
5x^2-x-12=0
\end{align}
\begin{align}
5x^2-9=x+3\\
5x^2-x-12=0
\end{align}
- 等号对齐 &=
\begin{align}
5x^2-9&=x+3\\
5x^2-x-12&=0
\end{align}
- \begin{align*} *号的意思是取消编号
LaTeX Tutorial 4 - Creating Lists
\documentclass[11pt]{article}
\usepackage{enumerate}
\begin{document}
\begin{enumerate}
\item pencil
\item calculator
\item ruler
\end{enumerate}
\begin{itemize}
\item pencil
\item calculator
\item ruler
\end{itemize}
\begin{enumerate}
\item pencil
\item calculator
\item ruler
\begin{enumerate}
\item notes
\item homework
\item assessments
\begin{enumerate}
\item tests
\item quizzes
\end{enumerate}
\end{enumerate}
\end{enumerate}
\begin{enumerate}[A.]
\item pencil
\item calculator
\item ruler
\end{enumerate}
\begin{enumerate} \setcounter{enumi}{5}
\item pencil
\item calculator
\item ruler
\end{enumerate}
\begin{enumerate} \setcounter{enumi}{5}
\item[] pencil
\item[] calculator
\item[] ruler
\end{enumerate}
\begin{enumerate}
\item[a)] pencil
\item[b)] calculator
\item[c)] ruler
\end{enumerate}
\end{document}
1.有序列表 enumerate
\begin{document}
\begin{enumerate}
\item pencil
\item calculator
\item ruler
\end{enumerate}
2.无序列表
\begin{itemize}
\item pencil
\item calculator
\item ruler
\end{itemize}
3. 嵌套列表
\begin{enumerate}
\item pencil
\item calculator
\item ruler
\begin{enumerate}
\item notes
\item homework
\item assessments
\begin{enumerate}
\item tests
\item quizzes
\end{enumerate}
\end{enumerate}
\end{enumerate}
4. 改变编号形式
- 改变编号形式,[A.],要记得\usepackages{enumerate}
\begin{enumerate}[A.]
\item pencil
\item calculator
\item ruler
\end{enumerate}
- 如果想改变编号开始的位置
\begin{enumerate} \setcounter{enumi}{5}
\item pencil
\item calculator
\item ruler
\end{enumerate}
5.隐藏编号
- 隐藏编号
\begin{enumerate} \setcounter{enumi}{5}
\item[] pencil
\item[] calculator
\item[] ruler
\end{enumerate}
-
设置独特的编号
\begin{enumerate}
\item[a)] pencil
\item[b)] calculator
\item[c)] ruler
\end{enumerate}
LaTeX Tutorial 5 - Text and Document Formatting
\documentclass[11pt]{article}
\usepackage{hyperref}
\title{My LaTeX Document}
\author{ZIZI}
\date{July 26,2020}
\begin{document}
\tableofcontents
\maketitle
This will produce \textit{italicized} text.
This will produce \textbf{bold face} text.
This will produce \textsc{small caps} text.
This will produce \texttt{typewriter font} text.
Please visit Michelle Krummel's website at \href{http://michellekrummel.com}{My Website}.
Please excuse my dear aunt Sally.
Please excuse my \begin{large}dear aunt Sally\end{large}.
Please excuse my \begin{Large}dear aunt Sally\end{Large}.
Please excuse my \begin{huge}dear aunt Sally\end{huge}.
Please excuse my \begin{Huge}dear aunt Sally\end{Huge}.
Please excuse my \begin{normalsize}dear aunt Sally\end{normalsize}.
Please excuse my \begin{small}dear aunt Sally\end{small}.
Please excuse my \begin{scriptsize}dear aunt Sally\end{scriptsize}.
Please excuse my \begin{tiny}dear aunt Sally\end{tiny}.
\begin{center}This is centered.\end{center}
\begin{flushleft} This is left-justified. \end{flushleft}
\begin{flushright} This is right-justified \end{flushright}
\section{Linear Functions}
\subsection{Slope-Intercept Form}
\subsubsection{Example1}
\subsection{Standard Form}
\section{Quadratic Functions}
\subsection{Vertex Form}
\subsection{Factored Form}
\end{document}
1.改变字体样式
This will produce \textit{italicized} text.
This will produce \textbf{bold face} text.
This will produce \textsc{small caps} text.
This will produce \texttt{typewriter font} text.
Please visit Michelle Krummel's website at \href{http://michellekrummel.com}{My Website}.
2.改变字号
2.1 变大
Please excuse my \begin{large}dear aunt Sally\end{large}.
Please excuse my \begin{Large}dear aunt Sally\end{Large}.
Please excuse my \begin{huge}dear aunt Sally\end{huge}.
Please excuse my \begin{Huge}dear aunt Sally\end{Huge}.
2.2 变小
Please excuse my \begin{normalsize}dear aunt Sally\end{normalsize}.
Please excuse my \begin{small}dear aunt Sally\end{small}.
Please excuse my \begin{scriptsize}dear aunt Sally\end{scriptsize}.
Please excuse my \begin{tiny}dear aunt Sally\end{tiny}.
3.居中
- 方法1
\begin{center}This is centered.\end{center}
\begin{flushleft} This is left-justified. \end{flushleft}
\begin{flushright} This is right-justified \end{flushright}
- 方法2
- \centering 将会影响后面的所有内容,所有的都会居中
- \large 所有的后会变大
4.标题
\title{My LaTeX Document}
\author{ZIZI}
\date{July 26,2020}
\begin{document}
\maketitle
5.每一节小标题
- 一级标题
\section{Linear Functions}
\section{Quadratic Functions}
- 二级标题
\section{Linear Functions}
\subsection{Slope-Intercept Form}
\subsubsection{Example1}
\subsection{Standard Form}
\section{Quadratic Functions}
\subsection{Vertex Form}
\subsection{Factored Form}
6.目录
\tableofcontents