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
在这里插入代码片