基本插入图片
插图功能不是由 LATEX 的内核直接提供,而是由 graphicx 宏包提供的。要使用 graphicx 宏包的插图功能,需要在源文件的导言区使用\usepackage命令引入宏包:\usepackage{graphicx}
%使用\usepackage{graphicx}
宏包实现插图
%语法:\includegraphics{<选项>}{<文件名>}
[] ->可以固定长宽高的等值,到宏包中看texdoc graphicx
%格式:EPS,PDF,PNG,JPEG,BMP
eg:\includegraphics[height=0.3\textheight]{studengage.png}
\documentclass{ctexbook}
\usepackage{graphicx}
\graphicspath{{figures/}}%查找目录
\begin{document}%插入图片
\includegraphics[height=0.3\textheight]{tupianming.png}
\end{document}
2:设置图片位置等
\documentclass{ctexbook}
\usepackage{graphicx}
%查找目录
\graphicspath{{figures/}}
\begin{document}
\ref{fig-lion}插入图片1:见下图%引用标签,即引用该标签下的图片
%插入图片
\begin{figure}[htbp]%允许位置
%此处和表格的位置存在符号一样
\label{fig-lion}%设置标签
\centering %居中
\includegraphics[height=0.3\textheight]{tupianming.png}
\caption{ 美丽的图片}%设置插图标题
\end{figure}
\end{document}