LaTex---在图片或表格上方、下方添加字体

1、

\documentclass{ctexbook}%book,report,letter
\title{Study latex}
\author{YQ}
\usepackage{ctex}
\date{\today}
%\usepackage{graphicx}
%语法:\includegraphics[选项]{文件名}	
%格式:JPG/PDF/PNG/BMP/EPS
\usepackage{graphicx}%插图的时候要在导言区导入包
\graphicspath{{figures/},{pics/}}
%正文区(文稿区)
\begin{document}
	
	\includegraphics[scale=0.5]{network}
	
	
     \begin{tabular}{l|| c| c| c| c| p{1.5cm}}
     	\hline
         method & bicubic & ibp & stv &  ncsr & srcnn \\
         \hline\hline
          psnr  &  10     &  20 & 21  & 22    &23      \\
          \hline
          ssim  &  10     &   21 & 21.5 & 22.5 &24      \\  
     	
     \end{tabular}

\end{document}

最初图片效果:
在这里插入图片描述
2、加入浮动语句之后;
如,只在图片加入

\begin{document}
	%通过figure将图片转换为浮动体
	网络模型为:
	\begin{figure}
	\includegraphics[scale=0.5]{network}
	\end{figure}
	
	
     \begin{tabular}{l|| c| c| c| c| p{1.5cm}}
     	\hline
         method & bicubic & ibp & stv &  ncsr & srcnn \\
         \hline\hline
          psnr  &  10     &  20 & 21  & 22    &23      \\
          \hline
          ssim  &  10     &   21 & 21.5 & 22.5 &24      \\  
     	
     \end{tabular}

\end{document}

效果如下:
在这里插入图片描述
对于表格则是添加tab命令

3、在图片和表格变为浮动体后,可进行居中,添加标题等操作

居中:\centering

\begin{document}
	%通过figure将图片转换为浮动体
	网络模型为:
	\begin{figure}
		\centering
		\includegraphics[scale=0.5]{network}
	\end{figure}
	
    评价指标效果:
	\begin{table}
		\centering
		 \begin{tabular}{l|| c| c| c| c| p{1.5cm}}
			\hline
			method & bicubic & ibp & stv &  ncsr & srcnn \\
			\hline\hline
			psnr  &  10     &  20 & 21  & 22    &23      \\
			\hline
			ssim  &  10     &   21 & 21.5 & 22.5 &24      \\  
			
		\end{tabular}
	\end{table}
   

\end{document}

在这里插入图片描述
添加标题:\caption{}

\begin{document}
	%通过figure将图片转换为浮动体
	网络模型为:
	\begin{figure}
		\centering
		\includegraphics[scale=0.5]{network}
		\caption{1 网络结构}
	\end{figure}
	
    评价指标效果:
	\begin{table}
		\centering
		 \begin{tabular}{l|| c| c| c| c| p{1.5cm}}
			\hline
			method & bicubic & ibp & stv &  ncsr & srcnn \\
			\hline\hline
			psnr  &  10     &  20 & 21  & 22    &23      \\
			\hline
			ssim  &  10     &   21 & 21.5 & 22.5 &24      \\  
			
		\end{tabular}
	    \caption{1 评价指标}
	\end{table}
   

\end{document}

效果如下;
在这里插入图片描述
可以看出标题出现在表格下方,如果想出现在表格上方,则把 \caption{表1 评价指标}命令放在tabular之前。

		\centering
		\caption{1 评价指标}
		 \begin{tabular}{l|| c| c| c| c| p{1.5cm}}
			\hline
			method & bicubic & ibp & stv &  ncsr & srcnn \\
			\hline\hline
			psnr  &  10     &  20 & 21  & 22    &23      \\
			\hline
			ssim  &  10     &   21 & 21.5 & 22.5 &24      \\  
			
		\end{tabular}
	    

在这里插入图片描述
4、交叉引用
**\ref{fig-network}%表示图片的序号如 1,2,3
\label{fig-network}**表示利用label实现图片的交叉引用

网络模型为:
	\begin{figure}
		网络结构见图 \ref{fig-network}
		\centering
		\includegraphics[scale=0.5]{network}
		\caption{1 网络结构}\label{fig-network}
	\end{figure}

在这里插入图片描述
可以看出,如果我不写图1,表1,latex会根据内容自动生成序号,防止自己记混。

CTRL + T :快速注释
CTRL + U: 取消注释

here —代码所在的上下文位置
top----代码所在的页面或之后页面的顶部
bottom ----代码所在的页面或之后的页面底部
page --单独一页
htpg----允许各个位置
使用label

在这里插入代码片
  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值