1. 导言区
\documentclass{article}
\title{插图}
\author{文泽路小男孩}
\date{\today}
%宏包使用-------------------------------------------
\usepackage{ctex}
\usepackage{graphicx} %这个是插图必须要用到的宏包
\usepackage{subfig} %并排摆放,共享标题,各有子标题需要用到的宏包
1.1 宏包使用
graphicx
:插图必用!subfig
:并排摆放,共享标题,各有子标题需要用到!
2. 正文区
2.1 简单的插图命令
\begin{figure}[htbp]
\centering
\includegraphics[width = 0.5\textwidth]{equation.jpg}
\caption{一元二次方程}
\label{fig:graph_1}
\end{figure}
\centering
居中表示- 在
figure
环境中使用 [htbp]
表示浮动位置(一般全部都写)\includegraphics[width = 0.5\textwidth]{equation.jpg}
表示插入图片(图片必须与.tex
文件放在一起)\caption{一元二次方程}
图表名称\label{fig:graph_1}
交叉引用的时候用到
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/0505ebdc0c0ecd8c62537c88a5e5b395.png)
2.2 并排摆放,共享标题
\begin{figure}[htbp]
\centering
\includegraphics[width = 0.3 \textwidth]{equation.jpg}
\hspace{10pt}
\includegraphics[width = 0.3 \textwidth]{equation1.jpg}
\caption{公式}
\end{figure}
\hspace{10pt}
表示两图之间的间隔
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/13ef592a01c8b6f74496eefcf547716d.png)
2.3 并排摆放,各有标题
\begin{figure}[htbp]
\centering
\begin{minipage}{60pt}
\centering
\includegraphics[scale=0.6]{equation.jpg}
\caption{一元二次方程}
\end{minipage}
\hspace{60pt}
\begin{minipage}{60pt}
\centering
\includegraphics[scale=0.6]{equation1.jpg}
\caption{一元三次方程}
\end{minipage}
\end{figure}
- 在
minipage
环境中写子图,并且各自有个\caption{一元二次方程}
表示的子标题。
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/416e591bf334c5a06332e37cb380a57f.png)
2.4 并排摆放,共享标题,各有子标题
\begin{figure}[htbp]
\centering
\subfloat[一元二次方程]{
\label{fig:subfig_a}
\includegraphics[width=0.3\textwidth]{equation.jpg}
}
\hspace{60pt}
\subfloat[一元三次方程]{
\label{fig:subfig_b}
\includegraphics[width=0.3\textwidth]{equation1.jpg}
}
\caption{公式}
\label{subfig}
\end{figure}
\subfloat[]{}
放子图,是带自己图名的
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/67eb69a926c53d9f89c34cbe1c8e8da1.png)