latex入门(四) 图片与表格的插入

latex入门(四) 图片与表格的插入

1)图片的插入
1.基本语法
%导入图片的宏包
\usepackage{graphicx}
%语法:\includegraphics[可选项]{文件}
%格式:ESP,PDF,PNG,JPG,BMP

2.基本设置
在可选项进行设置:

scale=0.3 设置缩放比例

height=3cm 设置图片的高度

width=100pt 设置图片的宽度

height=1\textheight 设置图片的相对高度

width=1\textwidth 设置图片的相对宽度

angle=-45 设置角度

同时设置多个参数时,用逗进行分割

\documentclass{article}
\usepackage{graphicx}          %导入图片的宏包
%语法:\includegraphics[可选项]{文件}
%格式:ESP,PDF,PNG,JPG,BMP

%注意需要将图片与tex源文件放在同一个文件夹中
%正文区
\begin{document}
	\includegraphics[scale=0.1]{a.jpg}            %设置缩放比例
	%\includegraphics[height=1\textheight]{a.jpg}  %设置相对高度
	%\includegraphics[width=1\textwidth]{a.jpg}    %设置相对宽度
\end{document}

在这里插入图片描述
3.使用浮动体
一般情况下我们很少会把图片直接插入到我们的文本当中,而是会给它放置在一个叫做浮动体(float)的东西中(这样图片可以有一些相对位置的变换,不会造成分页困难等问题)。图片的浮动环境是figurefi(使用figure表示的是把我们这个东西看成一个段落并且是没有任何缩进的)。

\centering表示的是里面紧跟的内容都居中
\includegraphics[]{}表示的插入图片
\caption设置图片的一个编号以及为图片添加标题
figure参数:h 此处(here)t 页顶(top)b 页底(bottom)p 独立一页(page)

\documentclass{article}
\usepackage{graphicx}          %导入图片的宏包
%语法:\includegraphics[可选项]{文件}
%格式:ESP,PDF,PNG,JPG,BMP

%注意需要将图片与tex源文件放在同一个文件夹中
%正文区
\begin{document}
	In this problem, as members of International Coalition of Modelers, we are supposed to build a model of optimal refugee movement that would incorporate projected flows of refugees with consideration of transportation accessibility, safety of emigration routes and countries’ resource capacities. We are expected to establish our model on a set of parameters as metrics of the crisis and take the endogenous systemic dynamics of the crisis into account. The working model serves to support the optimal set of conditions with our proposals of a set of policies for optimal migration pattern. In addition, we modelers also embrace exogenous events that may result in substantial shifts in the volatile environment and consider the scalability and corresponding changes of the model. 
	
	%插入图片
	\begin{figure}[ht]
	\centering
	\includegraphics[scale=0.1]{a.jpg}            %设置缩放比例
	\caption{xiaojiejie}                      %设置图片的一个编号以及为图片添加标题
	\end{figure}

\end{document}

在这里插入图片描述
1)插入两张图片
\quad表示空格

\documentclass{article}
\usepackage{graphicx}          %导入图片的宏包
%语法:\includegraphics[可选项]{文件}
%格式:ESP,PDF,PNG,JPG,BMP

%注意需要将图片与tex源文件放在同一个文件夹中
%正文区
\begin{document}
	In this problem, as members of International Coalition of Modelers, we are supposed to build a model of optimal refugee movement that would incorporate projected flows of refugees with consideration of transportation accessibility, safety of emigration routes and countries’ resource capacities. We are expected to establish our model on a set of parameters as metrics of the crisis and take the endogenous systemic dynamics of the crisis into account. The working model serves to support the optimal set of conditions with our proposals of a set of policies for optimal migration pattern. In addition, we modelers also embrace exogenous events that may result in substantial shifts in the volatile environment and consider the scalability and corresponding changes of the model. 
	
	%插入图片
	\begin{figure}[ht]
		\centering
		\begin{minipage}[b]{0.33\linewidth}
			\includegraphics[width=4.0cm,height=5.5cm]{a.jpg}
			\caption{xiaojiejie1}
		\end{minipage}
		\quad
		\begin{minipage}[b]{0.33\linewidth}        %图片占用一行宽度的33%
			\includegraphics[width=4.0cm,height=5.5cm]{b.jpg}
			\caption{xiaojiejei2}
		\end{minipage}
	\end{figure}


\end{document}

在这里插入图片描述
2)多张图片的插入(放在同一行)

\documentclass{article}
\usepackage{graphicx}          %导入图片的宏包
%语法:\includegraphics[可选项]{文件}
%格式:ESP,PDF,PNG,JPG,BMP

%注意需要将图片与tex源文件放在同一个文件夹中
%正文区
\begin{document}
	In this problem, as members of International Coalition of Modelers, we are supposed to build a model of optimal refugee movement that would incorporate projected flows of refugees with consideration of transportation accessibility, safety of emigration routes and countries’ resource capacities. We are expected to establish our model on a set of parameters as metrics of the crisis and take the endogenous systemic dynamics of the crisis into account. The working model serves to support the optimal set of conditions with our proposals of a set of policies for optimal migration pattern. In addition, we modelers also embrace exogenous events that may result in substantial shifts in the volatile environment and consider the scalability and corresponding changes of the model. 
	
	%插入图片
	\begin{figure}[ht]
		\centering
		\begin{minipage}[b]{0.27\linewidth}
			\includegraphics[width=3.0cm,height=2.5cm]{1.jpg}
			\caption{xiaojiejie1}
		\end{minipage}
		\quad
		\begin{minipage}[b]{0.27\linewidth}        %图片占用一行宽度的33%
			\includegraphics[width=3.0cm,height=2.5cm]{2.jpg}
			\caption{xiaojiejei2}
		\end{minipage}
		\quad
		\begin{minipage}[b]{0.27\linewidth}
			\includegraphics[width=3.0cm,height=2.5cm]{3.jpg}
			\caption{xiaojiejie3}
		\end{minipage}
		\quad

	\end{figure}
	
	
\end{document}

在这里插入图片描述
3)多张图片的插入(实现2x2)
以实现2x2形式为例,使用宏包subfigure

\documentclass{article}
\usepackage{graphicx}          %导入图片的宏包
\usepackage{subfigure}
%语法:\includegraphics[可选项]{文件}
%格式:ESP,PDF,PNG,JPG,BMP

%注意需要将图片与tex源文件放在同一个文件夹中
%正文区
\begin{document}
	In this problem, as members of International Coalition of Modelers, we are supposed to build a model of optimal refugee movement that would incorporate projected flows of refugees with consideration of transportation accessibility, safety of emigration routes and countries’ resource capacities. We are expected to establish our model on a set of parameters as metrics of the crisis and take the endogenous systemic dynamics of the crisis into account. The working model serves to support the optimal set of conditions with our proposals of a set of policies for optimal migration pattern. In addition, we modelers also embrace exogenous events that may result in substantial shifts in the volatile environment and consider the scalability and corresponding changes of the model. 
	
	%插入图片
	\begin{figure}[ht]
		\centering
		\subfigure[xiaojiejei1]
		{
			\includegraphics[height=3.5cm,width=5.5cm]{1.jpg}
		}
		\quad
		\subfigure[xiaojiejie2]
		{
			\includegraphics[height=3.5cm,width=5.5cm]{2.jpg}
		}
		\quad
		\subfigure[xiaojiejie3]
		{
			\includegraphics[height=3.5cm,width=5.5cm]{3.jpg}
		}
		\quad
		\subfigure[xiaojiejie4]
		{
			\includegraphics[height=3.5cm,width=5.5cm]{4.jpg}
		}
		\caption{xiaojiejie}
	\end{figure}


\end{document}

在这里插入图片描述
4)关于visio的插入
关于visio的插入我还没有找到比较好的方法。目前只能将visio输出为pdf然后插入

发布了15 篇原创文章 · 获赞 13 · 访问量 6798

猜你喜欢

转载自blog.csdn.net/weixin_44026026/article/details/104103248