文字
{\bf **} %加粗**
\textit{**} %斜体**
\emph 强调文本
另外
百分号:\%
双引号:前双引号点两次`(左上角1旁边的键)后双引号点两次''(enter旁边的键)
注意 - 这个符号,有时候可能是中文的(报错)
上标:字母^上标;下标:字母_下标;
表格
宏包
\usepackage{booktabs}
\label{table:1}%对表格自动排序
\usepackage{arydshln} % 负责画虚线的包
\hdashline%在此处画虚线
\caption{}%给表格加标题
\tabcolsep=0.05cm%表格列间距
\caption{\centering 标题} %居中标题
\centering%表格居中
\begin{table*}[h!] %将表格强插入此处,固定位置
%在\begin{table}下一行加下面指令,调节表格文字大小
%从小到大顺序排列
\tiny
\scriptsize
\footnotesize
\small
\normalsize
\large
\Large
\LARGE
\huge
\Huge
\begin{tabular}[c]{@{}c@{}}换行内容 \\ 换行内容 \end{tabular}
表格中插入图片
\begin{minipage}[b]{0.3\columnwidth}
\raisebox{-0.7\height}{\includegraphics[height=1.8cm,width=3.5cm]{图片}}
\end{minipage}
%-0.7是图片下沉的高度
m{3cm}让表格文字靠上
c居中
合并单元格
\usepackage{multirow} %宏包
\multirow{35}{3cm}{文本} %合并35行
\multicolumn{2}{文本宽度}{文本} %合并2列
如果想让表格跨双栏,就在头和尾的table加星 table*
在线表格生成点击此处
公式
宏包
\usepackage{amsmath}
如果公式不居中,查找文中是否有\documentclass[a4paper,fleqn]{cas-dc}一句命令,把flegn删去即可。
一小个公式或者其他符号用$ $包起来
大公式需要用 \begin{align} 和 \end{align} 包起来
如果长公式需要换行对齐,用\\换行,用&对齐
%例子
\begin{equation}
\begin{aligned}
IDF1=&\frac{2\times IDP\times IDR}{IDP+IDR} \\=&\frac{2|IDTP|}{2|IDTP|+|IDFP|+|IDFN|}
\end{aligned}
\end{equation}
效果:
在线公式生成点击此处,右下方生成latex代码复制到overleaf即可。
参考文献
1.在overleaf菜单栏创建.bib文件,可以命名为reference.bib
2.引入宏观包
\bibliographystyle{elsarticle-num} %或者\bibliographystyle{IEEEtran}
\biboptions{sort&compress}%达到[1-3]多个文献引用的效果
\bibliography{reference}%放在末尾,自动生成文献,括号里是自己的bib文件
爱斯维尔期刊:
\usepackage[square, comma, sort&compress, numbers]{natbib}
\bibliographystyle{elsarticle-num}
\bibliographystyle{cas-model2-names}%末尾
\bibliography{reference}
输入引用文献标题,搜索,点击左下角引用 “ ,点击左下角bibtex,然后复制全部到reference.bib文件中,改动 { 到 , 第一个逗号之间的内容,我这里是改为2
接着正文部分\cite{2}或者\citep{2}即可引用。
参考文献引用时标颜色:
\usepackage[dvipsnames]{xcolor}
\usepackage[colorlinks,linkcolor=blue,anchorcolor=blue, %%修改此处为你想要的颜色
citecolor=blue]{}
图片
宏包
\usepackage{caption}
\usepackage{graphicx}
\usepackage{float}
%\usepackage{subfigure}
\usepackage{subcaption}
首先点击overleaf左上方上传标志,然后将图片拖进来
\begin{figure}[h]%[h]表示图片插入此处
\begin{center}
\includegraphics[width=3in]{图片名称}\\
\caption{标题名字}\label{circuit_diagram}
\end{center}
\end{figure}
如果想让图片跨双栏,就在头和尾的figure处加星figure*
如果图片位置仍不对,可以调整图片大小 width=3in处。
插入上下两张图片
\begin{figure}[htbp]
\centering
\subfigure[标题1[width=3in]{5a.png}
%\caption{fig1}
}
\quad
\subfigure[标题2[width=3in]{5b.png}
}
\caption{总标题}
插入左右三张图片
\begin{figure}[htbp]
\centering
\begin{subfigure}{0.325\linewidth}
\centering
\includegraphics[width=0.9\linewidth]{图片}
\caption{小标题}
\end{subfigure}
\centering
\begin{subfigure}{0.325\linewidth}
\centering
\includegraphics[width=0.9\linewidth]{图片}
\caption{小标题}
\end{subfigure}
\centering
\begin{subfigure}{0.325\linewidth}
\centering
\includegraphics[width=0.9\linewidth]{图片}
\caption{小标题}
\end{subfigure}
\caption{总标题}
\label{}
\end{figure}
插入2行3列图片(根据实际情况可修改)
\begin{figure}[h!]
\centering
\subfigure[第一行图片名称]{
\begin{minipage}{0.32\linewidth}
\centering
\caption{第一行第一个图片名称}%不需要可删去
\includegraphics[width=1\linewidth]{第一个图片}%width为图片宽度
\end{minipage}
\begin{minipage}{0.32\linewidth}
\centering
\caption{第一行第二个图片名称}%不需要可删去
\includegraphics[width=1\linewidth]{第二个图片}
\end{minipage}
\begin{minipage}{0.32\linewidth}
\centering
\caption{第一行第三个图片名称}%不需要可删去、、同下
\includegraphics[width=1\linewidth]{第三个图片}
\end{minipage}}
%\qquad
%让图片换行,
\subfigure[第二行图片名称]{
\begin{minipage}{0.32\linewidth}
\centering
\includegraphics[width=1\linewidth]{第二行第一个图片}
\end{minipage}
\begin{minipage}{0.32\linewidth}
\centering
\includegraphics[width=1\linewidth]{第二行第二个图片}
\end{minipage}
\begin{minipage}{0.32\linewidth}
\centering
\includegraphics[width=1\linewidth]{第二行第三个图片}
\end{minipage}}
\caption{图片总名称}
\end{figure}
作者
%例子
\author[1]{aaa }
\ead{email}
\author[2]{bbb }
\cormark[1]%通讯作者
\ead{email}
\author[3]{ccc }
\ead{email}
\address[1]{简略信息}
\tnotetext[]{脚注信息}
\cortext[cor1]{Corresponding author}%脚注
插入对号
$\surd$ \checkmark也可以:
插入空格
正常距离空格\quad \; \: \,是不同距离的空格 \!负距离空格
~ 也是空格
膨胀空格:水平膨胀 \hfill 垂直膨胀 \vfill
处于膨胀空格两侧的文字会被挤压到边界
爱斯维尔期刊修改
1.去掉页脚的 ORCID(s)
:在下面这段代码最后添加 \let\printorcid\relax
\begin{document}
\let\WriteBookmarks\relax
\def\floatpagepagefraction{1}
\def\textpagefraction{.001}
\let\printorcid\relax % 可去掉页面下方的ORCID(s)
2.图片标题由 Figure 1:
变为 Fig. 1.
在导言区使用
\usepackage{caption}
\captionsetup[figure]{labelfont={bf}, labelformat={default}, labelsep=period, name={Fig.}}
然后ctrl+f在cas-common.sty文件中搜索fig_caption,将scolor后面的:改为.即可。
3.修改图/表格字体为Time New Roman,模板默认的图片/表格caption字体为字体族 \sffamily,搜索关键字 fig_caption和tbl1_caption,将有关的 \sffamily 改为 \rmfamily即可。