一、基本语法
1.1文档
\documentclass{artical}
%documentclass制定了文档的类型,最常用的是artical,其他的还有book、beamer等
\documentclass[UTF8]{ctexart}
ctexart的作用是允许中文和英文混排
- 所有在begin{document}之前的内容都属于前言,可以在这里设置文档的格式,页面的尺寸,文档中需要导入的包等等
- begin和end{document}之间属于正式内容
\documentclass[UTF8]{ctexart}
\title{文章的标题}
\author{zxx}
\date{\today}
\begin{document}
\maketitle
你好!
\end{document}
注意:
-
title 指定文章的内容
-
author 指定作者
-
date 说明日期
要想让这些内容显示出来,需要在正文部分添加 \maketitle
1.2内容
- textbf{}–加粗
- textit{}–斜体
- underline{}–下划线
1.3章节
\section{第一章节}
第一章的内容
\subsection{第一章节中的第一小节}
第一小节的内容
\subsection{第一章节中的第二小结}
第二小节的内容
\section{第二章节}
第二章的内容
1.4图片
\usepackage{graphicx}
\begin{figure}
\centering
\caption{sehun}
\includegraphics[width=0.5\textwidth]
{C:/Users/Desktop}
\end{figure}
注意:
- usepackage{graphicx},要想插入图片就要引入这个包
- \includegraphics[width=0.5\textwidth]{C:/Users/Desktop}的作用:width设置为当前文本宽度的{}里面是图片路径,注意斜杠方向
- 如果想要添加标题,首先要将图片放到\begin{figure}和\end{figure}中
- \caption里面放标题,\centering表示居中显示
1.5列表
\begin{itemize}
\item 1
\item 2
\item 3
\end{itemize}
\begin{enumerate}
\item 帅
\item 超级帅
\item 天下第一帅
\end{enumerate}
注意:
- itemize是[无序列表],注意每一个项前面都要加上\item
- enumerate是[有序列表]
1.6、公式
爱因斯坦的智能守恒方程为:$E=mc^2$
\begin{equation}
a=b+c
\end{equation}
\[
d={k\varphi(n)+1}\over e
\]
注意:
- 如果在行内插入公式,需要使用$$括起来
- 如果另起一行插入公式
常用排版
段落
居中
\begin{center}
要居中的内容
\end{center}
文本、变量
加粗
\textbf{A}、\boldsymbol{A}、\boldsymbol{我们}、\textbf{我们}、我们
斜体
\textit{我们}、\it{我们}
向量(顶有向量箭头→)
\vec v
v⃗ \vec v v
估计(顶有尖头hat)
\hat{y}
y^ \hat{y} y^
平均(顶有横线)
% \overline的线稍长,能覆盖所有字符
\bar x ,\overline x,\bar{AB} ,\overline{AB}
xˉ∣x‾∣ABˉ∣AB‾ \bar x | \overline x | \bar{AB} | \overline{AB} xˉ∣x∣ABˉ∣AB
顶有波浪号~
% \widetilde能覆盖所有字符
\tilde x ,\widetilde x,\tilde{AB} ,\widetilde{AB}
x~x~AB~AB~ \tilde x \widetilde x \tilde{AB} \widetilde{AB} x~xAB~AB
分式
\frac{分子}{分母}
\frac{2}{3}
\frac{x+y}{2}
2×35 \frac{2 \times 3}{5} 52×3
符号
属于
\in
∈ \in ∈
集合之间的各种关系(包含于、包含、真包含于……)
A\subset B
A\supset B
A\subseteq B
A\supseteq B
A\cap B
A\cup B
% A减B
A\setminus B
\emptyset
A⊂BA⊃BA⊆BA⊇BA∩BA∪BA∖B∅ A\subset B\\ A\supset B\\ A\subseteq B\\ A\supseteq B\\ A\cap B\\ A\cup B\\ % A减B A\setminus B\\ \emptyset A⊂BA⊃BA⊆BA⊇BA∩BA∪BA∖B∅
任意
\forall
∀ \forall ∀
存在
\exist或者\exists
∃ \exist ∃
因为、所以
\because 和 \therefore
∵∴ \because\\ \therefore ∵∴
无穷大
\infty +\infty -\infty
∞+∞−∞ \infty \\ +\infty \\ -\infty ∞+∞−∞
尖括号(也就是常见的向量夹角)
注意与小于号<,大于号> 区别
\langle
⟨
\rangle
⟨
小于等于、大于等于、不等于、恒等于、恒不等于
\le 或者 \leq
≤\le≤
\ge 或者 \geq
≥\ge≥
\ne 或者 \neq
≠\ne=
\equiv
≡\equiv≡
\not\equiv # 注意这里只能是拼接\not和\equiv,\nequiv无效
≢ \not\equiv ≡
\ll,\gg
≪≫ \ll \\ \gg ≪≫
\approx
≈
\lceil x \rceil
⌈x⌉
\lfloor x \rfloor
⌊x⌋
绝对值
\left|-2\right| 或者 \vert -2\vert 或者 \lvert -2\rvert
∣−2∣、∣−2∣、∣−2∣
开n次方
\sqrt{2}、\sqrt[3]{4}
2、43 \sqrt{2}、\sqrt[3]{4} 2、34
导数
% 求导
\frac{\mathrm{d}y}{\mathrm{d}x}
% 高阶导
\frac{\mathrm{d}^{n} y}{\mathrm{d}x^{n}}
% 求偏导
\frac{\partial{Loss}}{\partial{w}}
% 二阶偏导
\frac{\partial^{2}z}{\partial{x}^{2}}
\frac{\partial^{2}z}{\partial{x}\partial{y}}
sin2x=2sinxcosx \sin 2x = 2sinxcosx sin2x=2sinxcosx
sin2x=2sinxcosx\sin 2x = 2sinxcosxsin2x=2sinxcosx

1404

被折叠的 条评论
为什么被折叠?



