Latex 表格及算法排版记录

这里主要是对在 latex 中部分表格格式的方式做一个记录,以便之后会用到。 下面是用到的头文件,图片,表格,算法都写在一起了。可能部分读者需要自己用的,可以尝试将自己的表格格式改成下面表格中的某一种格式,或者就是基于当前的模板,根据你自己的需求来进行拓展,具体语法之类的可以自己建一个空的 .tex 文件多尝试一下就能慢慢摸索出来了,这里的格式仅供参考而已。(请忽略表中的内容,随便写的)

\usepackage{algorithmic}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{textcomp}
\usepackage{subfigure}
\usepackage{tabularx}
\usepackage{times}
\usepackage{multirow}
\usepackage{bm}
\usepackage{latexsym}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{epsf}
\usepackage{algorithm}
\usepackage{color,colortbl}
\renewcommand{\algorithmicensure}{\textbf{Output:}}
\renewcommand{\algorithmicrequire}{\textbf{Input:}}

算法1:

\begin{algorithm}[htb] 
\caption{ Algorithm Algorithm Algorithm Algorithm} 
\label{alg:Framwork} 
\begin{algorithmic}[] %这个1 表示每一行都显示数字
\REQUIRE ~~\\ %算法的输入参数:Input
Secret bit stream: B={0100……}\\
Embedding rate: m bit\\


\ENSURE ~~\\ %算法的输出:Output
Multiple sentences: Text;
\IF {not the end of current sentence}
\STATE Calculate the probability distribution of the next word ;
\STATE \STATE Calculate the perplexity of the words generated with the word of CP;
\IF {$ppl_j$ less than ppl}
\STATE Select the word to form the CP\_new;
\IF {CP\_new is empty}
\STATE Selected the word which has the highest conditional probability in the CP;
\ELSE 
\STATE Construct a Huffman tree according to the probability distribution of each word in the CP\_new and encode the word;
\ENDIF
\ENDIF
\ELSE 
\STATE Random pick a word from start word list start the other sentence;
\ENDIF
\RETURN generated sentences; %算法的返回值
\end{algorithmic}
\end{algorithm}

效果图:
在这里插入图片描述

表格1

\begin{table*}
	\centering
	\caption{ table name table name table name}
	\begin{tabular}{llll} 
		\toprule
		bpw & Perplexity default & Generated Sentence(Markov) & Generated Sentence(RNN) \\
		\hline
		\multirow{4}{*}{3} &  $10$  &i saw this movie& we see the man in the wheelchair \\
		~ & $30$ & i don't know about the movie but it is a great film  &what was happening is so stupid \\
		~ & $50$ &you can get a copy of this movie&oh yeah\\
		~ & $80$ &the acting was very good&after that he decides to try\\
		\hline
		\multirow{4}{*}{4} &  $10$  &i know the plot a very good& there is a good story about how the world does \\
		~ & $30$ &i would say they don't have that&my family was so disappointed \\
		~ & $50$ &the last few years to get his wife&a highly successful movie\\
		~ & $80$ &it's just another unknown actor&i want to go back to the movie\\
		\hline
		\multirow{4}{*}{5} &  $10$  &the first few minutes in length the film is a very good&it is a wonderful film \\
		~ & $30$ &you have a lot of it&what happened to that guy \\
		~ & $50$ &i believe in the movie&and i really thought the movie was well acted\\
		~ & $80$ &well i just hope he got it&he was a real star in the movie\\
		\bottomrule
	\end{tabular}
	\label{tbl:table1}
\end{table*}

效果图:
在这里插入图片描述

表格2

\begin{table}[h]
	\small\sf\centering
	\caption{ table name table name table name}
	\begin{tabular}{ccccccccccc}
	\hline
	\multirow{5}{*}{}&
	\multicolumn{2}{c}{} &
	\multicolumn{4}{c}{perplexity} &
	\multicolumn{4}{c}{bpw}\\
	\hline
	  Dataset&bpw& $ xxx $ &10&30&50&80&10&30&50&80 \\
	\hline
		\multirow{3}{*}{Imdb} & 3 &28.04&24.58&22.02& 24.64 &25.70&1.95&1.91&2.04&2.04\\
		 & 4 &36.31& 37.53& 27.54 &40.21&34.96&2.44&2.28&2.39&2.50 \\
		 & 5 &47.68& 47.37& 42.85 &35.72&35.01&2.85&2.73&2.66&2.70 \\
	\hline
		\multirow{3}{*}{News} & 3 &41.23&46.91&56.96& 67.31 &52.00&2.06&2.00&2.00&2.04\\
		 & 4 &55.47& 54.55&60.53 &62.04&63.69&2.49&2.53&2.51&2.56 \\
		 & 5 &66.01& 117.63& 65.31&89.18&78.17&2.75&2.81&2.99&2.85 \\
	\hline
		\multirow{3}{*}{twitter} & 3 &29.83&25.73&22.02& 20.33 &22.24&1.62&1.61&1.57&1.66\\
		 & 4 &40.18&24.54& 24.28 &30.49&34.26&1.83&1.83&1.94&1.83 \\
		 & 5 &55.00& 35.56& 28.41 &33.93&36.21&2.08&1.89&2.26&2.22 \\
	\hline
	\end{tabular}
\end{table}

效果图:
在这里插入图片描述

表格3

\begin{table}[ht]
	\small\sf\centering
	\caption{   table name table name table name}
	\begin{tabular}{ccccccccccccc}
	\hline
	\multirow{3}{*}{} &
	\multicolumn{4}{c}{3} &
	\multicolumn{4}{c}{4} &
	\multicolumn{4}{c}{5} \\
	\hline
	  bpw& 10&30&50&80 &10&30&50&80&10&30&50&80 \\
	\hline
		Acc & 0.625 &28.04&24.58&22.02& 24.64 &25.70&1.95&1.91&2.04&2.04&2.04&2.04\\
		P & 0.63 &36.31& 37.53& 27.54 &40.21&34.96&2.44&2.28&2.39&2.50&2.04&2.04 \\
		 R& 0.6 &47.68& 47.37& 42.85 &35.72&35.01&2.85&2.73&2.66&2.70&2.04&2.04 \\
		  F& 0.61 &47.68& 47.37& 42.85 &35.72&35.01&2.85&2.73&2.66&2.70&2.04&2.04 \\
	\hline
	\end{tabular}
\end{table}

效果图:
在这里插入图片描述

相关 Latex 环境配置见:
Windows 下 Texlive 2018 + sublime3 配置 LaTex 环境 (详细版)

  • 6
    点赞
  • 38
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值