【代码总结】LaTeX常用代码

1. 图片:

  • 单张图片:
%%包含头文件
\usepackage{graphicx}

\begin{figure*}[t]
	\centering
	\includegraphics[width=0.5\linewidth]{Figs/Features.pdf}
	\caption{Title}
	\label{fig1}
\end{figure*}
  • 多张图片:

2. 表格:

%使用头文件
\usepackage{booktabs}


\begin{table}[t]
    \centering
	\caption[User handwritten data storage format]
    {User Handwritten Data Storage Format\label{tab:format}}
	\setlength{\tabcolsep}{6.4mm}{ %限制宽度
		\begin{tabular}{cccc}
			\toprule
			No. & X & Y & Pressure \\
			\midrule
			1 & 0 & 0 & 0.301961 \\
			2 & 3.320862 & -2 & 0.294118 \\
			3 & 20.62878 & 0.9912712 & 0.286275 \\
			\multicolumn{4}{c}{……} \\ %合并列
			149 & -87 & 425 & 0.184314 \\
			150 & -87 & 425 & 0.184314 \\
			\bottomrule
	\end{tabular}}
\end{table}

3.重定义命令:

  • 重定义标为红色:
%直接使用\red{}
\newcommand{\red}[1]{{\textcolor{red}{#1}}}

4.字母上面加符号:

  • 加^号 输入\hat  或 \widehat
  • 加横线 输入 \overline
  • 加波浪线 输入 \widetilde
  • 加一个点 \dot{要加点的字母}
  • 加两个点\ddot{要加点的字母}
  • 加箭头 输入\vec{}

5.使整个LaTeX可使用中文:

6.LaTeX中仅参考文献引用中文:

7.参考文献中插入DOI编号:

@article{Jia2006,
  title={title},
  author={author},
  journal={journal},
  volume={12},
  number={3},
  year={2006},
  note={doi: 123}
}

8.插入算法:

\begin{algorithm}[t] 
	\caption{Incremental LSTM} 
	\label{alg:Framwork} 
	\begin{algorithmic}[1] %这个1 表示每一行都显示数字
		\REQUIRE  %输入\\
		
		$T_i$, the classifier ($i$ = 1, 2, …, $n$)\\
		
		
		\ENSURE
		
		$T_n$, the classifier ($n$ is an integer parameter when $B_{err} = \emptyset$)


        %开始算法
		
		\STATE xxxxx
		
		%循环
		\REPEAT
		
		\STATE xxx
		
        %判断
		\IF{xxx}
		
		\STATE xxx
		
		\ENDIF
		
		\STATE xxx
		
		\UNTIL{xxx}
		
		\RETURN xxx.
	\end{algorithmic}
\end{algorithm}
原创文章 6 获赞 4 访问量 2529

猜你喜欢

转载自blog.csdn.net/Elivyxy/article/details/103962856