\documentclass{article}
\usepackage{ctex}%中文
\newcommand\degree{^\circ}%角度
\newcommand{\myfont}{\textit{\textbf{\heiti{你好!}}}}%重定义
\usepackage{graphicx}%图片
\graphicspath{{figures/},{pics/}}
\usepackage{amsmath}%引入矩阵
%ctrl+T 批量注释
\title{\heiti LaTex第一篇文章}%文字字体黑体
\author{\kaishu xyz}%文字字体楷书
\date{\today}
\begin{document}
\maketitle
你好 \LaTeX。
直角三角形 $\angle C=90\degree$
%中文字体
{\songti 宋体} \quad {\heiti 黑体} \quad {\fangsong 仿宋} \quad {\kaishu 楷书}
中文字体的\textbf{粗体}与\textit{斜体}
\zihao{4} 你好!
\myfont
\tableofcontents%目录
\section{引言}
\section{实验}
123
这里是实验
\subsection{数据}
456
这里是数据
\subsubsection{数据条件}
789
这里是数据条件
%图片引入
熟练使用LaTeX中的TiKz,可以绘制如图\ref{fig-tikz1}所示的精密矢量图
\begin{figure}[h]
\centering
\includegraphics[height=5cm,width=5cm]{123.png}
\caption{\TeX 图1}\label{fig-tikz1}
\end{figure}
熟练使用LaTeX中的TiKz,可以绘制如图\ref{fig-tikz2}所示的精密矢量图
\begin{figure}[h]
\centering
\includegraphics[height=0.2\textheight,width=0.2\textwidth]{123.png}
\caption{\TeX 图2}\label{fig-tikz2}
\end{figure}
%表格引入
精美的表格见表\ref{label}
\begin{table}[htbp]
% [允许位置]
% h,此处(此处)-代码所在的上下文位置
% t,页顶(top)-代码所在页面或者之后页面的顶部
% b,页底(bottom)-代码所在页面或者之后页面的底部
% p,独立一页(page)-浮动页面
\centering
\caption{成绩单}
\begin{tabular}{|l|c|cp{1.5cm}|}
%\begin{tabular}{|l|c|rp{1.5cm}|}
%用&表示不同列
%\\表示换行
%l-本列左对齐
%c-本列居中对齐
%r-本列右对齐
%p{<宽>}-本列宽度固定,能够自动换行
\hline
姓名&语文&数学\\
\hline
张三&8&9\\
\hline
李四&9&8\\
\hline
\end{tabular}\label{label}
\end{table}
% 公式和markdown一样
公式见式\ref{1-1}
\begin{equation}
f(x)=3x^2+x-1 \label{1-1}
\end{equation}
%引入矩阵
%用&分割列,用\\分割行
\[
\begin{matrix}
a &\dots& b \\
&\ddots&\vdots\\
c & &d
\end{matrix}
\]
\[
\begin{pmatrix}
a&b\\
c&d
\end{pmatrix}_{n \times m}
\]
\[
\begin{bmatrix}
a&b\\
c&d
\end{bmatrix}
\]
\[
\begin{Bmatrix}
a&b\\
c&d
\end{Bmatrix}
\]
\[
\begin{vmatrix}
a&b\\
c&d
\end{vmatrix}
\]
\[
\begin{Vmatrix}
a&b\\
c&d
\end{Vmatrix}
\]
%行内小矩阵
复数$z=(x,y)$也可以用矩阵
\begin{math}
\left(%需要手动加上左括号
\begin{smallmatrix}
x&- y\\
y&x
\end{smallmatrix}
\right)%需要手动加上右括号
\end{math}来表示
%多行公式
%多个编号
\begin{gather}
123\\
3 \times 5
\end{gather}
%不带编号
\begin{gather*}
123\\
3 \times 5
\end{gather*}
%一个编号
\begin{gather}
123\notag \\
3 \times 5
\end{gather}
%一个编号,并居中
\begin{equation}
\begin{split}
123\\
456
\end{split}
\end{equation}
%分段
\begin{equation}
D(x) = \begin{cases}
123,& \text{如果} x \in \mathbf{Q};\\
456,& \text{如果} x \in \mathbf{R};\\
\end{cases}
\end{equation}
%参考文献
\end{document}