latex学习(1)

1、latex中插入图片(需要调用\usepackage{graphicx}和\usepackage{float}宏包)

\begin{figure}[H]   
	\small
	\centering
	\includegraphics[width=13cm,height=8cm]{fig31}
    %\includegraphics[scale=0.6]
	\caption{sensitivity analysis results of damping trend model} \label{fig-29}
\end{figure}
  • 其中[H]是为了固定图片位置,htbp分别为:h 此处(here)t 页顶(top)b 页底(bottom)p 独立一页(page)
  • 改变width和height的参数值来改变图片的大小,也可以改变缩放因子scale改变图片大小。

latex学习(1)

 

2、两张图片并排插入(调用\usepackage{subfigure}宏包)

\begin{figure}[htbp]
	\centering
	\subfigure[predicted cumulative diagnosis]{\includegraphics[height=6cm,width=7cm]{fig7}}
	\subfigure[forest daily additions]{\includegraphics[height=6cm,width=7cm]{fig8}}
	\caption{ change curve of daily new number and cumulative confirmed number}
	\label{fig-7}
\end{figure}

其中\subfigure[每个图片的标签或说明]{\includegraphics[height=6cm,width=7cm]{fig7}},没有标签可去掉\subfigure。

latex学习(1)

 3、多张图片并排插入(与两张图片类似)

  • 3张照片
\begin{figure}[H]
	\centering
	{\includegraphics[height=5cm,width=4.7cm]{fig10}}
	{\includegraphics[height=5cm,width=4.6cm]{fig11}}
	{\includegraphics[height=5cm,width=4.7cm]{fig12}}
	\caption{virus transmission process when the infection rate parameter changes}
	\label{fig-8}
\end{figure}

其中\label{}为标签(通常放在\caption后),\ref{}为引用图片

latex学习(1)

  • 4张图片
\begin{figure}[H]
	\centering
	{\includegraphics[height=5cm,width=6cm]{fig13}}
	{\includegraphics[height=5cm,width=6cm]{fig14}}
	{\includegraphics[height=5cm,width=6cm]{fig15}}
	{\includegraphics[height=5cm,width=6cm]{fig16}}
	\caption{cellular automata grid diagram of different population sizes}
	\label{fig-16}
\end{figure}

 latex学习(1)

 4、插入普通表格


\begin{table}[htbp]
	\centering  %居中排版
	\setlength{\tabcolsep}{2mm}  %调整表格列宽
	\caption{Effect of infection rate parameters on prevalence}\label{tab-8}
	\begin{tabular}{|c|c|c|c|c|} %l为左对齐,c为居中对齐,r为右对齐
		\hline 
		 & Infection rate & cure rate & New patient probability &Stable prevalence \\
		\hline
		group 1 & 0.1 & 0.1 & 0.01 &0.381 \\
		\hline
		group 2 &  0.3 & 0.1 & 0.01 & 0.756 \\
		\hline
		group 3 & 0.5 & 0.1 & 0.01 & 0.831 \\
		\hline
	\end{tabular}
\end{table}

latex学习(1)

 

\begin{table}[htbp]
	\centering  %居中排版
	\setlength{\tabcolsep}{5mm}
	\caption{consistency inspection RI value}\label{tab-3}
		\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|} %l为左对齐,c为居中对齐,r为右对齐
			\hline 
			n & 1 & 2 & 3 &4&5&6&7&8&9 \\
			\hline
			RI & 0 & 0 & 0.58 &0.90&1.12&1.24&1.32&1.41&1.45 \\
			\hline
	\end{tabular}
\end{table}

latex学习(1)

 5、插入三线表

\begin{table}[H]
	\centering  %居中排版
	\caption{Notations used in this paper}      \label{tab-2}
	%\setlength{\tabcolsep}{12mm}{
	\begin{tabularx}{\textwidth}{C{4cm} X} \toprule[1.5pt]
		Scale  &  Meaning  \\
		\midrule[1.5pt]
		1  & Indicates that the two factors have the same importance compared to each other \\ 
		4  & Indicates that the former is slightly more important than the latter  \\
		5  & Indicates that the former is obviously more important than the latter  \\
		7  & Indicates that the former is more important than the latter \\
		9  & Indicates that the former is more important than the latter \\
		2,4,6,8  & Represents the intermediate value of the above adjacent judgment  \\
		reciprocal & If the factor $i$ to factor $j$ importance ratio is $a_{ij}$ , then the factor $j$ to $i$ factor importance ratio is $a_{ji}=\frac{1}{a_{ij}}$ \\
		\bottomrule[1.5pt]		
	\end{tabularx}
	%}
\end{table}

latex学习(1)

 

\begin{table*}[!htbp]
	\centering  %居中排版
	\caption{Determination of $SEIR^{CIA}$  model parameter values}      \label{tab-7}
	%\setlength{\tabcolsep}{12mm}{
	\begin{tabularx}{12cm}{X X X} \toprule[1.5pt]
%	\begin{tabularx}{\textwidth}{C{4cm} X X} \toprule[1.5pt]
		parameter  & numerical value & Setting basis  \\
		\midrule[1.5pt]
		$S$  & 1.3$\times$ $10^{7}$   & Xi’an population  \\ 
		$E$  &7 & E(0) Latency length \\
		$\beta$  & $10^{-6}$ & expert opinion \\
		$\rho$ & 0.5 &expert opinion  \\
		$\phi$ & 0.5 & expert opinion  \\
		$\epsilon$ & 0.2 & expert opinion  \\
		$\alpha$ & 1/7 & reference \\
		$\omega$ &0.01 & expert opinion \\
		$\eta$ & 0.9 & expert opinion  \\
		\bottomrule[1.5pt]		
	\end{tabularx}
	%}
\end{table*}

latex学习(1)

 居中:

\begin{table*}[!htbp]
	\centering  %居中排版
	\caption{Determination of $SEIR^{CIA}$  model parameter values}      \label{tab-7}
	%\setlength{\tabcolsep}{12mm}{
	\begin{tabularx}{15cm}{C{5cm} C{5cm} C{5cm}} \toprule[1.5pt]
%	\begin{tabularx}{\textwidth}{C{4cm} X X} \toprule[1.5pt]
		parameter  & numerical value & Setting basis  \\
		\midrule[1.5pt]
		$S$  & 1.3$\times$ $10^{7}$   & Xi’an population  \\ 
		$E$  &7 & E(0) Latency length \\
		$\beta$  & $10^{-6}$ & expert opinion \\
		$\rho$ & 0.5 &expert opinion  \\
		$\phi$ & 0.5 & expert opinion  \\
		$\epsilon$ & 0.2 & expert opinion  \\
		$\alpha$ & 1/7 & reference \\
		$\omega$ &0.01 & expert opinion \\
		$\eta$ & 0.9 & expert opinion  \\
		\bottomrule[1.5pt]		
	\end{tabularx}
	%}
\end{table*}

latex学习(1)

 

上一篇:Latex插入图片并固定图片位置


下一篇:LaTeX在VScode下的环境配置教程