科研写作LaTex

本文分享了科研论文写作中如何使用LaTeX进行中文编译,包括utf-8编码示例、表格制作(合并列、宽度调整)、算法表示(IF-ENDIF结构)、公式排版、图片插入、颜色设置以及参考文献管理。特别关注表格样式和特殊符号的使用,是提升学术论文排版质量的实用手册。
摘要由CSDN通过智能技术生成

背景

以下是科研写作中用到的相关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.csdn.net/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} π

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值