论文写作笔记8 latex语法

我在写论文时遇到过的所有latex排版问题, 将解决方案与大家分享.

目录

\label标签

图片

图片格式

多图组合

浮动

引用

2.检查作者省略和期刊名称缩写

用到缩写

cite编号顺序

表格

字体加粗标红

IEEE合并单元格

横线

表格内换行

脚注

超链接

附录

通栏标题

作者

高亮


\label标签

latex中的\label标签的作用, 参考:

latex中的\label标签的作用_latex \label_音程的博客-CSDN博客

\label可以给一个公式,一个章节,一个图片,一个表格打上标签,然后使用\ref进行引用

\begin{equation}\label{newton2}

F=ma

\end{equation}

\begin{equation}\label{distance}

s=v_0+\frac{1}{2}at^2

\end{equation}

unite the equation (\ref{newton2}),(\ref{distance}),we can conclude that.... 

大于号:\textgreater

小于号: \textless

图片

图片格式

保存格式和图中字体

IEEE论文模板要求的300 dpi TIFF or EPS file

生成图片时将其字体格式均改为’Arial

pdf转eps这个好用:

https://pdftoimage.com/zh/pdf-to-eps

eps裁剪:

https://www.img2go.com/crop-image/editor#j=2bdbd7e2-599b-45fc-9424-

多图组合

参数讲解参考:

Latex中插入多张图片,实现并排排列或者多行多列排列_latex 图片4张排成2行3列_泽米的博客-CSDN博客

官方文档参考

Figures, Subfigures and Tables - Overleaf, Online LaTeX Editor

图片如果要横跨两栏,figure后加*

如果要是图片在一行,那么就需要在两个图片之间添加~或者\hfill这些命令是为了填充两个图片之间不换行,或者直接什么也不填,只要宽度够;如果要换行,留空一行即可。

\usepackage{caption}

\usepackage{subcaption}

\begin{figure}

     \centering

     \begin{subfigure}[b]{0.3\textwidth}

         \centering

         \includegraphics[width=\textwidth]{graph1}

         \caption{$y=x$}

         \label{fig:y equals x}

     \end{subfigure}

     \hfill

     \begin{subfigure}[b]{0.3\textwidth}

         \centering

         \includegraphics[width=\textwidth]{graph2}

         \caption{$y=3sinx$}

         \label{fig:three sin x}

     \end{subfigure}

     \hfill

     \begin{subfigure}[b]{0.3\textwidth}

         \centering

         \includegraphics[width=\textwidth]{graph3}

         \caption{$y=5/x$}

         \label{fig:five over x}

     \end{subfigure}

        \caption{Three simple graphs}

        \label{fig:three graphs}

\end{figure}

子图引用参考:

LATEX IEEEtran 子图引用 - 知乎

Fig. \ref{fig:SHAP all}(\subref{fig:SHAP 1})

浮动

禁止图表跨章节placeins

为了避免浮动对象(图形和表格等)被排版到下一节中,可以采用 placeins宏包。

使用\usepackage{placeins}命令调用该宏包,然后在浮动对象不能跨越的地方(如“\section”之前)插入命令 “\FloatBarrier” ,这样LaTex会将所有未排版的浮动对象排版完后,再继续排版后面的内容。

https://blog.csdn.net/Caiqiudan/article/details/109715583

\usepackage[section]{placeins}

\usepackage{float}

只加placeins输出在章节后一页, 好丑.

用 \FloatBarrier 命令. 浮动体的浮动范围不可以跨越该命令. 在每个大章节之间加上这个就可以

\FloatBarrier

\section{}

\begin{figure}

...

\end{figure}

\FloatBarrier

\section{}

加!h有强制效果

为了通栏, 带星号的浮动体只会出现在下一页的顶部,无法出现在当前位置,所以会使得公式的顺序紊乱

引用

文献的名称放在谷歌学术搜

选bibtex格式的cite

bibtex教程

自己新建https://www.cnblogs.com/ntxs4/p/12099640.html

IEEE模板https://blog.csdn.net/will_ye/article/details/94013837

overleaf: https://blog.csdn.net/kxbk100/article/details/88426028

显示未引用文献: https://zhuanlan.zhihu.com/p/110709175

剩下的那些如果也想放到正文reference列表裏的話就在\end{document}之前加入那個\nocite{}命令,就會順延把剩下所有在.bib中的條目放到reference裏面。不然的話reference只會顯示在正文中被\cite{}過的那些條目

\cite{b18,b19}

\cite{b14}--\cite{b16}

--的引用不用自己写, 连续超过3个引用模板会自己生成--, 如果自己写--, 导致中间的没有cite到, 还要再写notice, 更麻烦

有些模板不支持不规范的bib引用格式, 会报错

因为样式不支持这个引用中的url

尝试参考这个会议格式修改

%% Paper presented at a conference

@misc{bib8,

  author       = "Chung, S. T. and Morris, R. L.",

  title                   = "Isolation and characterization of plasmid deoxyribonucleic acid from

                                   Streptomyces fradiae",

  year                  = "1978",

  note                 = "Paper presented at the 3rd international symposium on the genetics

                                   of industrial microorganisms, University of {W}isconsin, {M}adison,

                                   4--9 June 1978"

}

@inproceedings{pan2008transfer,

  title={Transfer learning via dimensionality reduction.},

  author={Pan, Sinno Jialin and Kwok, James T and Yang, Qiang and others},

  booktitle={AAAI},

  volume={8},

  pages={677--682},

  year={2008},

  url={\url{https://www.cse.ust.hk/\%7Eqyang/Docs/2008/AAAIsinnoA.pdf}}

}

@inproceedings{pan2008transfer,

  author       = "Pan, Sinno Jialin and Kwok, James T and Yang, Qiang and others",

  title                   = "Transfer learning via dimensionality reduction.",

  volume             = "8",

  booktitle           = "AAAI",

  pages               = "677--682",

  year                  = "2008",

  note                 = "\url{https://www.cse.ust.hk/\%7Eqyang/Docs/2008/AAAIsinnoA.pdf}"

}

新模板中的参考文献bib格式

%% Journal article

@article{bib1,

  author       = "Campbell, S. L. and Gear, C. W.",

  title                   = "The index of general nonlinear {D}{A}{E}{S}",

  journal       = "Numer. {M}ath.",

  volume             = "72",

  number            = "2",

  pages               = "173--196",

  year                  = "1995"

}

%% Journal article with DOI

@article{bib2,

  author       = "Slifka, M. K. and Whitton, J. L.",

  title                   = "Clinical implications of dysregulated cytokine production",

  journal       = "J. {M}ol. {M}ed.",

  volume             = "78",

  pages               = "74--80",

  year                  = "2000",

  doi                    = "10.1007/s001090000086"

}

%% Journal article

@article{bib3,

  author       = "Hamburger, C.",

  title                   = "Quasimonotonicity, regularity and duality for nonlinear systems of

                                   partial differential equations",

  journal       = "Ann. Mat. Pura. Appl.",

  volume             = "169",

  number            = "2",

  pages               = "321--354",

  year                  = "1995"

}

%% book, authored

@book{bib4,

  author       = "Geddes, K. O. and Czapor, S. R. and Labahn, G.",

  title                   = "Algorithms for {C}omputer {A}lgebra",

  address             = "Boston",

  publisher          = "Kluwer",

  year                  = "1992"

}

%% Item 8. Book, chapter

@incollection{bib5,

  author       = "Broy, M.",

  title                   = "Software engineering---from auxiliary to key technologies",

  editor        = "Broy, M. and Denert, E.",

  booktitle           = "Software Pioneers",

  pages               = "10--13",

  address             = "New {Y}ork",

  publisher          = "Springer",

  year                  = "1992"

}

%% Book, edited

@book{bib6,

  editor        = "Seymour, R. S.",

  title                   = "Conductive {P}olymers",

  address             = "New {Y}ork",

  publisher          = "Plenum",

  year                  = "1981"

}

%% Chapter in a book in a series with volume titles

@inproceedings{bib7,

  author       = "Smith, S. E.",

  title                   = "Neuromuscular blocking drugs in man",

  editor        = "Zaimis, E.",

  volume             = "42",

  booktitle           = "Neuromuscular junction. {H}andbook of experimental pharmacology",

  pages               = "593--660",

  address             = "Heidelberg",

  publisher          = "Springer",

  year                  = "1976"

}

%% Paper presented at a conference

@misc{bib8,

  author       = "Chung, S. T. and Morris, R. L.",

  title                   = "Isolation and characterization of plasmid deoxyribonucleic acid from

                                   Streptomyces fradiae",

  year                  = "1978",

  note                 = "Paper presented at the 3rd international symposium on the genetics

                                   of industrial microorganisms, University of {W}isconsin, {M}adison,

                                   4--9 June 1978"

}

%% Data citation example

@misc{bib9,

  author       = "Hao, Z. and AghaKouchak, A. and Nakhjiri, N. and Farahmand, A.",

  title                   = "Global integrated drought monitoring and prediction system (GIDMaPS) data sets",

  year                  = "2014",

  note                 = "figshare \url{https://doi.org/10.6084/m9.figshare.853801}"

}

%% Preprint citation example

@misc{bib10,

  author       = "Babichev, S. A. and Ries, J. and Lvovsky, A. I.",

  title                   = "Quantum scissors: teleportation of single-mode optical states by means

                                   of a nonlocal single photon",

  year                  = "2002",

  note                 = "Preprint at \url{https://arxiv.org/abs/quant-ph/0208066v1}"

}

现在遗留问题是

1.有很多error

2.检查作者省略和期刊名称缩写

1.在bib条目中增加abbrev字段

@article{Smith2023,

  author = {John Smith},

  title = {A Great Paper},

  journal = {Journal of Great Research},

  year = {2023},

  volume = {42},

  pages = {123-135},

  abbrev = {JGR}

}

2.软件转换jabref

https://zhuanlan.zhihu.com/p/369403325

https://zsc.vercel.app/md/2020-08-11-latex%E7%BC%A9%E5%86%99%E6%9C%9F%E5%88%8A/

jabref:

https://github.com/JabRef/abbrv.jabref.org

JabRef可以通过自动缩写或取消缩写期刊名称来帮助您重构参考文献列表。 这要求您保留一个或多个期刊名称及其各自的缩写列表。 要设置这些列表,请选择选项 ->管理日记缩写。 有关广泛的文档,请参阅 Journal abbreviations - JabRef

无法匹配的缩写查询:

https://cassi.cas.org/search.jsp

AMA风格引用有缩写

https://catalog.nlm.nih.gov/discovery/fulldisplay?docid=alma995060993406676&context=L&vid=01NLM_INST:01NLM_INST&lang=en&search_scope=MyInstitution&adaptor=Local%20Search%20Engine&tab=LibraryCatalog&query=lds04,exact,7809515

修改csv为分号分割:

https://www.extendoffice.com/documents/excel/7228-excel-change-delimiter-when-saving-as-csv.html

还是cscode替换最方便...

用到缩写

Revista do Col{\'e}gio Brasileiro de Cirurgi{\~o}es

Rev Col Bras Cir

RCBC

https://catalog.nlm.nih.gov/discovery/fulldisplay?docid=alma995060993406676&context=L&vid=01NLM_INST:01NLM_INST&lang=en&search_scope=MyInstitution&adaptor=Local%20Search%20Engine&tab=LibraryCatalog&query=lds04,exact,7809515

World Journal of Gastroenterology: WJG

World J Gastroenterol

Pulmonary therapy

Pulm Ther

Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining

ACM Transactions on Knowledge Discovery from Data=ACM Trans Knowl Discov Data

NLM Title Abbreviation

Neuroimage Clin

Title(s)

NeuroImage. Clinical

NLM Title Abbreviation

J Softw (Malden)

Title(s)

Journal of software (Malden, MA)

Uniform Title

Journal of software (Malden, MA)

NLM Title Abbreviation

J Big Data

Title(s)

Journal of big data

Title(s)

IEEE intelligent systems & their applications

Other Title

IEEE expert intelligent systems & their applications Nov./Dec. 1997

IEEE expert Nov./Dec. 1997

IEEE intelligent systems Jan./Feb. 1998-

Institute of Electrical and Electronic Engineers intelligent systems & their applications

IEEE intelligent systems and their applications

IEEE INTELLIGENT SYSTEMS & THEIR APPLICATIONS

IEEE INTELL SYST APP

IEEE Intelligent Systems and their applications

IEEE Intell Syst App

#IEEE_J_NNLS#

IEEE Transactions on Neural Networks and Learning Systems

IEEE Trans Neural Netw Learn Syst

IEEE Transactions on Neural Networks

#IEEE_J_NN#

IEEE Trans. Neural Netw.


IEEE Trans Neural Netw

IEEE Transactions on Knowledge and Data Engineering

#IEEE_J_KDE#

IEEE Trans Knowl Data Eng

Abdominal Radiology

Abdom Radiol

Abdom. Radiol.

还要处理链接

写在note中的url编辑和jabref识别不到, 也许应该同一放在URL字段中

cite编号顺序

sort citations according to their order of appearance in the document

参考: https://blog.csdn.net/AdijeShen/article/details/107108726

按照cite顺序自动排序文献编号,用\bibliographystyle{unsrt}

一般来说,引用bib格式的参考文献时,会这么写:

\bibliographystyle{plain}

\bibliography{%filename%.bib}

而plain的意思是用作者的姓名排序,而不是按照引用顺序,所以推荐改成

\bibliographystyle{unsrt}

按照bib中出现顺序来排序

报错:

Illegal, another \bibstyle command : \bibstyle : {unsrt}

这是因为

您有两个\Bibliographystyle{aChemso},可能一个在类文件中,一个在您的文档中

(https://tex.stackexchange.com/questions/631323/error-message-from-bibtex-illegal-another-bibstyle-command)

这个类文件是:

\documentclass[sn-basic,Numbered]{sn-jnl}% Basic Springer Nature Reference Style/Chemistry Reference Style

办法

1.更新样式

```latex

% In your LaTeX document, before \begin{document}, add:

\makeatletter

\renewcommand{\@biblabel}[1]{\hfill#1.}

\makeatother

\bibliographystyle{unsrt} % Use the unsrt style for sorting

2. **检查模板文档:** 查看 Springer 模板提供的文档,看看它是否提供与参考书目样式或引文排序相关的任何选项或自定义设置。 某些模板提供了用于调整引文样式的选项。

在用户手册中没找到设置样式的选项, 但给出常见问题链接:

https://www.springernature.com/gp/authors/campaigns/latex-author-support

参考:

https://zhuanlan.zhihu.com/p/427371287

https://www.cnblogs.com/qixianyu/p/7086259.html

复制一份新的.bst,

打开.bst,ctrl+F搜索SORT(注意大小写)

将SORT这一行注释(在SORT前面写上%),保存

表格

字体加粗标红

蓝色加粗的{\color{blue}{\textbf{English}}}英文单词

}}&\textbf{\color{red}{

\textbf{\color{red}{81.49\%}}

IEEE合并单元格

普通latex合并单元格参考: https://blog.csdn.net/FY_2018/article/details/120357211

合并1行多列可以使用\multicolumn{cols}{pos}{text}

\begin{table}

       \centering

       \begin{tabular}{|c|c|c|c|}

              \hline

              \multicolumn{2}{|c|}{合并一行两列} & 三 & 四 \\

              \hline

              1 & 2 & 3 & 4 \\

              \hline

       \end{tabular}

\end{table}

合并多行1列单元格可以用multirow包中的\multirow{rows}{width}{text}来实现

注意这里的第2个参数是{width},与\multicolumn第2个参数不同。如果不确定{width}需要填什么,就将其替换为*

\begin{table}

       \centering

       \begin{tabular}{|c|c|c|c|}

              \hline

              \multirow{2}*{合并两行一列} & 二 & 三 & 四 \\

              ~ & 2 & 3 & 4 \\

              \hline

       \end{tabular}

\end{table}

IEEE合并单元格:

https://blog.csdn.net/sinat_39121062/article/details/126588511

这里不支持*作通配符

多行的包是要额外加的

\usepackage{multirow}

横线

引入{booktabs}

\usepackage{booktabs}

通过在对应行的\后加入

\cmidrule(r){1-1}

大括号的{1-1}表示从第1列到第1列

表格内换行

https://zhuanlan.zhihu.com/p/409241007

\usepackage{makecell}

这个包有两个命令都可以实现单元格换行,分别是\thead和\makecell

其中,原本{ccc}对应3列,我对其中一个c(这里是第二列)固定了长度,改写为p{8cm},这样写以后,表内内容会自动换行。同时,使用p会导致对应列内容左对齐,如果需要居中,在文本后加入\centering就可实现

脚注

脚注参考:

https://jacobzhuo.blog.csdn.net/article/details/110248849

\usepackage{threeparttable}

\begin{table}[]

\begin{threeparttable} %添加此处

      \begin{tabular}{cccc}

        \hline

           & B1  &B2   & B3\\ \hline

        A1 & 0.1 & 0.2 & 0.3\\

        A2 & ... & ..  & .\\

        A3 & ..  & .   & .\\ \hline

      \end{tabular}

      \begin{tablenotes}%添加此处

        \footnotesize%添加此处

        \item[i] %添加此处

     \end{tablenotes} %添加此处

\end{threeparttable} %添加此处

\end{table}

\begin{table}[H]

  \centering

  \caption{2018年世界静态数据}

    \begin{threeparttable}

    \begin{tabular}{rrrr}

    \hline

    \multicolumn{1}{l}{GDP(万亿)\tnote{1}} & \multicolumn{1}{l}{人口(十亿)} & \multicolumn{1}{l}{土地面积(兆平方公里)\tnote{1}} & \multicolumn{1}{l}{收入(千美元)} \bigstrut\\

    \hline

    0.369 & 7.594 & 127.343 & 8.826 \bigstrut\\

    \hline

    \end{tabular}%

   

    \begin{tablenotes}

       \footnotesize

       \item[1] 这里的美元都是指2018年年底的美元价格为单位,下同

       \item[2] 即$1\times10^6$平方公里

     \end{tablenotes}

    \end{threeparttable}

  \label{tb:1}%

\end{table}

超链接

文件超链接

https://blog.csdn.net/weixin_43102634/article/details/108484391

https://blog.csdn.net/qq_19591449/article/details/105931268

1、需要用到的宏包

\usepackage{hyperref}

记住一定要加上,放在导言区,即 \begin{document}  之前。

2、代码块

\href{run:D:/report/Jiao.pdf}{Jiao}

上面是我tex里面代码块,你需要做的就是如下:

\href{run:A}{B}

A 部分需要打开的文件名字(具体的在文件出点击鼠标右键,然后点击属性就可以看到啦,注意文件名是 右斜杠 \ ,你要把它改成 左斜杠 /)

B 这部分就是超链接的名称,你运行TEX后生成的pdf中出现的按钮,比如我写的是  Jiao ,那么我运行的TEX后的pdf文件超链接就是 Jiao,然后你点击 Jiao 就直接可以打开你想要的文件。

附录

IEEE附录参考:

多排feature

https://ieeexplore.ieee.org/document/7307080

TABLE VII Features With Corresponding P-Values and AIGR

https://ieeexplore.ieee.org/document/8327491

https://ieeexplore.ieee.org/document/7214201

https://ieeexplore.ieee.org/document/6613509

https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8678399

https://ieeexplore.ieee.org/document/6680664

通栏标题

\twocolumn[

\begin{@twocolumnfalse}

\section*{\centering{Appendix}}

% \end{multicols}

%\begin{strip}

\begin{table}[hb]

\caption{A sample instance from the dataset}

\label{table:Data Example}

\centerline{\includegraphics[width=0.85\textwidth]{Appendix.pdf}}

\end{table}

\end{@twocolumnfalse}

]

IEEE单双转换

https://blog.csdn.net/zjc910997316/article/details/120616234

latex浮动体(表格)需要0.85以内且位于底部才不会对于顶上已有标题(appendix)的一页另起新页, 这样非常不和谐. 所以直接双栏+pdf不使用图表环境

作者

通讯作者设置:

https://blog.csdn.net/weixin_39278265/article/details/112308231

https://blog.csdn.net/tangjiahao10/article/details/125653481

作者信息脚注例子

Manuscript received July 2, 2020; revised December 9, 2020 and

March 4, 2021; accepted March 8, 2021. Date of publication March

11, 2021; date of current version July 20, 2021. This work was supported by the National Natural Science Foundation of China under Grant

71532014. (Corresponding author: Dongsheng Zhao.)

Haifeng Xu is with Information Center, Academy of Military Medical

Sciences, Beijing 100850, China, and also with the Information Department, General Hospital of Xinjiang Military Command, Urumqi 830000,

China (e-mail: xuhf@bmi.ac.cn).

Jianfei Pang, Xuemeng Li, and Dongsheng Zhao are with Information Center, Academy of Military Medical Sciences, Beijing 100850,

China (e-mail: pangjf@bmi.ac.cn; rose_1203@yeah.net; dszhao@bmi.

ac.cn).

Weiliang Zhang is with the Department of Neurology, General Hospital of Xinjiang Military Command, Urumqi 830000, China (e-mail:

weiliang19821108@163.com).

Mei Li is with China Stroke Data Center, Beijing 100101, China

(e-mail: lim301@126.com).

Digital Object Identifier 10.1109/JBHI.2021.3065427

高亮

高亮

https://zhuanlan.zhihu.com/p/354838863

格式:\hl{需要高亮的内容}

ps:需要在文档内容前面添加:\usepackage{soul}

\soulregister{\cite}7 % 注册\cite命令

\soulregister{\ref}7 % 注册\ref命令

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值