LaTeX教程—7.LaTeX中的插图

1.设置图片信息

①在导言区:使用\usepackagegraphicx{graphicx}引入宏包

②在导言区:使用\graphicspath{
   
   {figures/}}设置图片所在的文件夹目录,注可以设置多个文件夹目录,如:\graphicspath{
   
   {figures/}, {photos/}}

③在正文区:使用\includegraphics[width=12cm,height=8cm]{test.jpg}引入文件

2.LaTeX插图源码

% 导言区
\documentclass{article}

\usepackage{graphicx}
\graphicspath{
   
   {figures/}}  % 在当前目录下的figures文件夹下查找文件

% 正文区
\begin{document}

	% 插入图片test.jpg,设置宽为12cm	
	\includegraphics[width=12cm,height=8cm]{test.jpg}
	
	% 使用相对高度
	\includegraphics[height=0.2\textheight]{test.jpg}
	
	% 设置旋转角度
	\includegraphics[angle=45,width=0.5\textwidth]{test.jpg}

\end{document}

3.查看texdoc帮助文档

 texdoc graphicx  # 在MacOS终端输入命令,查看graphicx帮助文档

猜你喜欢

转载自blog.csdn.net/m0_38068876/article/details/113359389