背景
以下是科研写作中用到的相关latex内容,希望可以帮助到大家。
中文模板
中文的,用latex进行编译,而不是xelatex
\documentclass[twocolumn]{article}
\usepackage{setspace}
\usepackage{ctex}
\begin{document}
\begin{spacing}{1}
\tiny 这是一个XeLaTex的utf-8编码例子。这是一个XeLaTex的utf-8编码例子。XeLaTex的utf-8编码例子。
\end{spacing}
\end{document}
表格
\usepackage{multirow}
表格下划线
\usepackage{booktabs}
\toprule
\midrule
\bottomrule
表格宽度设置
\centering
\setlength{\tabcolsep}{8pt}
合并列
\begin{table}[H]
\centering
\caption{CASE I 的仓库月台资源表}
\begin{tabular}{cccc}
\hline\hline
月台总数&\multicolumn{3}{c}{4}\\
\hline
时间段 &8:00-12:00&12:00-13:00 &13:00-19:00\\
开放月台数 &4 &0&3\\
\hline\hline
\end{tabular}
\end{table}
算法
IF EndIF
\IF{$di=dm$}
\STATE step$ \leftarrow [U_{max}]$
\ELSE[$N$ is odd]
\STATE step=1
\ENDIF
公式
引入数学公式的包
\usepackage{amsmath}
LaTex缩减公式间距
“\!”
图片
加入双列图片
\usepackage[tight,footnotesize]{subfigure}
\begin{figure}[htpb]
\centering
\subfigure[P@20]{\includegraphics[width=0.48\columnwidth]{rnn_lstm_gru}\label{P@20}}
\subfigure[MRR@20]{\includegraphics[width=0.48\columnwidth]{rnn_lstm_gru2}\label{MRR@20}}
\caption{Performance comparison of our method with different learning networks.}
\label{dembedding}
\end{figure}
png转eps
bmeps -c
\begin{figure}[!h]
\centering\includegraphics[width=8.5cm,height=6.5cm]{./pic/51.jpg}\\
\caption{Comparison of Accuracy of Baseline Method for PEMSD4}
\label{f5}
\end{figure}
如果jpg编译不了,使用其它方式的编译,例如PDFLaTEx
颜色
https://blog.youkuaiyun.com/qq_44926567/article/details/108440519
设置字体颜色
#soul 可以让字体高亮显示
\usepackage{soul} % 导入 soul 包
\usepackage{color, xcolor} % 颜色包,color 必须导入,xcolor 建议导入
\textcolor{red}{}
自定义颜色命令
%红色
\usepackage{color}
\definecolor{modify}{rgb}{1,0,0}
\textcolor{modify}{}
文字
文字两端对齐
可以使用\usepackage{ragged2e}包
定义新命令
\renewcommand{\justify}{\leftskip=0pt \rightskip=0pt plus 0cm}
然后在需要对齐的文字前加此命令即可.
\justify
加空格
{\kern 90pt}
修改表格的列的宽度
\begin{table}[H]
\begin{center}
\renewcommand{\arraystretch}{1.5}
\zihao{5}\caption{感知图神经架构搜索空间中的激活函数}
\label{activationfunction}
\begin{tabular}{p{6cm}<{\centering}p{7cm}<{\centering}}
\toprule
激活函数名称&计算方式 \\
\midrule
$relu(\cdot)$&$x \rightarrow max(0,x)$ \\
$sigmoid(\cdot)$&$x \rightarrow \frac{1}{{1 + {e^{ - x}}}}$\\
$identity(\cdot)$&$x \rightarrow x$\\
$softplus(\cdot)$&$x \rightarrow log(1 + {e^x})$\\
$elu(\cdot)$&$x \to \left\{ {\begin{array}{*{20}{c}}
x&{x > 0}\\
{\alpha ({e^x} - 1)}&{x \le 0}
\end{array}} \right.$\\
$tanh(\cdot)$&$x \rightarrow \frac{{{e^x} - {e^{ - x}}}}{{{e^x} + {e^{ - x}}}}$\\
$leaky\_relu(\cdot)$&$x \rightarrow max(\alpha x, x)$\\
$relu6(\cdot)$&$x \rightarrow min(6,max(0,x))$\\
$prelu(\cdot)$&$x \to \left\{ {\begin{array}{*{20}{c}}
x&{x \ge 0}\\
{\alpha x}&{x < 0}
\end{array}} \right.$\\
$srelu(\cdot)$&$x \to \left\{ {\begin{array}{*{20}{c}}
{{a_l}(x - {c_l}) + {c_l}}&{x \le {c_l}}\\
x&{{c_l} < x < {c_r}}\\
{{a_r}(x - {c_r}) + {c_r}}&{x \ge {c_r}}
\end{array}} \right.$\\
%$srelu(\cdot)$ & $x \to {\left\{ {\begin{array}{*{20}{c}}
%{{a_l}(x - {c_l}) + {c_l}}&{x \le {c_l}}\\
%x&{{c_l} < x < {c_r}}\\
%{{a_r}(x - {c_r}) + {c_r}}&{x \ge {c_r}}
%\end{array}} \right.}$\\
\bottomrule
\end{tabular}
\end{center}
\end{table}
特殊符号
箭头
\uparrow
\downarrow
无穷
正无穷大: +\infty
负无穷大: -\infty
参考文献
在end的document之前加入, 下面两行代码,之后就可以直接进行引用了。
\bibliographystyle{IEEEtran}
\bibliography{refer}
公式
\begin{align}
(a,b,c) \rightarrow (b,c) \nonumber\\
(b,c)\rightarrow(a,b)\nonumber\\
(c,e)\rightarrow(e) \nonumber\\
\end{align}
文字颜色
<font color=red>蓝色</font>
问题解决
参考文献[S.l]问题解决
删除bst文件中对应的[S.l]
加粗特殊字符
π\boldsymbol{\pi}π