(一)插图的基本语法
%导入图片的宏包
\usepackage{graphicx}%插入图片
%语法:\includegraphics[可选项]{文件}
%格式:ESP,PDF,PNG,JPG,BMP
(二)插入的基本设置
1.说明:
在可选项进行设置:
scale=0.3 设置缩放比例
height=3cm 设置图片的高度
width=100pt 设置图片的宽度
height=1\textheight 设置图片的相对高度
width=1\textwidth 设置图片的相对宽度
angle=-45 设置角度
同时设置多个参数时,用逗进行分割
2.源代码:
扫描二维码关注公众号,回复:
9890862 查看本文章
%导言区
\documentclass[UTF8]{ctexart}
%导入图片的宏包
\usepackage{graphicx}
%语法:\includegraphics[可选项]{文件}
%格式:ESP,PDF,PNG,JPG,BMP
%添加路径,图片的搜索路径
%test为与.tex文件在同一文件夹下的一个文件夹,图片都存放在test文件夹中。
\graphicspath{{test/}}
%正文区
\begin{document}
\LaTeX{}中的插图
\includegraphics{a.jpg}
\includegraphics{b.png}
%设置缩放比例
\includegraphics{t.jpg}
\includegraphics[scale=0.3]{t.jpg}
%设置图片的高度
\includegraphics[height=3cm]{t.jpg}
%设置图片的宽度
\includegraphics[width=100pt]{t.jpg}
%设置图片的相对高度
\includegraphics[height=1\textheight]{t.jpg}
%设置图片的相对宽度
\includegraphics[width=1\textwidth]{t.jpg}
%设置角度
\includegraphics[angle=-45]{b.png}
%同时设置多个参数时,用逗进行分割
\includegraphics[width=1\textwidth,angle=-45]{b.png}
\end{document}