LaTeX语法整理

\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}

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

anthony-36

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值