LaTex错误汇总以及使用指南(持续更新)

1、LaTeX Error: Something's wrong--perhaps a missing \item.  output.bbl

See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.23 \end{thebibliography} Try typing <return> to proceed. If that doesn't work, type X <return> to quit.

错误原因:正文中没有引用参考文献,任意添加一个文献,就能解决这个问题,如`\cite{he_resnet}`

2、Missing $ inserted.  output.bbl,109

<inserted text> 
                $
l.109 .../dx.doi.org/10.1007/978-3-030-32226-7_80}
                                                  
I've inserted a begin-math/end-math symbol since I think
you left one out. Proceed, with fingers crossed.

错误原因:`refs.bib`文件中的参考文献存在“_”,latex将其误认为数学公式,修正方法,找到包含下划线的地方,然后前面添加一个转义字符“\”,具体说明如下所示:

@CONFERENCE{Yuan_miccai_2019_multiview,
    title = {Automatic Radiology Report Generation Based on Multi-view Image Fusion and Medical Concept Enrichment},
    ISBN = {9783030322267},
    ISSN = {1611-3349},
    url = {http://dx.doi.org/10.1007/978-3-030-32226-7_80},
    DOI = {10.1007/978-3-030-32226-7_80},
    booktitle = {Medical Image Computing and Computer Assisted Intervention – MICCAI 2019},
    publisher = {Springer International Publishing},
    author = {Yuan,  Jianbo and Liao,  Haofu and Luo,  Rui and Luo,  Jiebo},
    year = {2019},
    pages = {721–729}
}

将其修改为(只对url和DOI中的下划线前面添加了‘\’)

@CONFERENCE{Yuan_miccai_2019_multiview,
    title = {Automatic Radiology Report Generation Based on Multi-view Image Fusion and Medical Concept Enrichment},
    ISBN = {9783030322267},
    ISSN = {1611-3349},
    url = {http://dx.doi.org/10.1007/978-3-030-32226-7\_80},
    DOI = {10.1007/978-3-030-32226-7\_80},
    booktitle = {Medical Image Computing and Computer Assisted Intervention – MICCAI 2019},
    publisher = {Springer International Publishing},
    author = {Yuan,  Jianbo and Liao,  Haofu and Luo,  Rui and Luo,  Jiebo},
    year = {2019},
    pages = {721–729}
}

3、IEEE Transactions系列期刊添加bib格式的参考文献,给引用添加超链接

# 第一步:下载期刊的模版,IEEE Journal LaTex模版地址
https://template-selector.ieee.org/secure/templateSelector/publicationType

# 第二步:下载bib格式文件,即**.bst,IEEE LaTeX Bibliography Files模版地址
https://www.ieee.org/conferences/publishing/templates.html

## 注意,若是IEEE Transactions系列的期刊,一般用IEEEtran.bst这个参考文献格式
# IEEEtran.bst is the official BibTeX style for authors of the Institute of
# Electrical and Electronics Engineers (IEEE) Transactions journals and
# conferences.

# 第三步,将IEEEtran.bst文件上传到overleaf

# 第四步,在\end{document}添加如下命令,如下所示:

\bibliographystyle{IEEEtran}
\bibliography{refs}  # 这里的refs需要换成自己的文件名
# 注意refs是overleaf中存在所有bib参考文献的文件名,即refs.bib,所以这里是refs
\end{document}

# 第五步(optional),如何给引用添加超链接——在导言区添加如下指令:
% add hyperlinks to references
\makeatletter
\let\NAT@parse\undefined
\makeatother
\usepackage{hyperref}

# 隐层超链接的颜色
\hypersetup{hidelinks=true}

4、常用数学公式表示汇总

1. 加粗斜体表示方法,如{\boldsymbol{x}}_0,{\boldsymbol{x}}_0

2. 花体,如{\mathbb{R}^{n \times (p + 1) \times d}}\mathbb{I}, {\mathbb{R}^{n \times (p + 1) \times d}}, \mathbb{I}

3. 损失函数,{​{\cal L}},{{\cal L}}

4. 给公式字体添加绿色,并加粗,\textcolor{green}{\mathbf{+} },\textcolor{green}{\mathbf{+} }

5. 特殊字符列表:

\checkmark $\checkmark$     

备注:在线latex工具网址在线LaTeX公式编辑器-编辑器

5、Overleaf论上传至arXiv步骤以及遇到的坑

(1)从overleaf中下载上传至arXiv的源文件

进入论文中—> submit—> 找到arXiv—>下载"Download project ZIP with submission files"

这个步骤有一个坑:

  • 图片尽可能都要用pdf;
  • 图片命名坑很大,单词之间不要有空格,不然后面上传至arXiv会出现编译不通过的情况。具体而言,假如图片名“fig1 overview.pdf”,上传arXiv后图片名会为“fig1_overview.pdf”。如下图所示。

Overleaf中图片命名
arXiv上传后的图片命名,最终导致上传的文件无法编译通过,因为图片找不到了

(2)arXiv网站上传论文

最好用学校或者机构邮箱注册,否则可能有审核等相关的步骤;

打开网站“Log in to arXiv | arXiv e-print repository” —> 接下来的操作,可以参考下面这个链接,目前我遇到的坑就是latex源文件中的图片命名问题,详见(1)。

参考文献:

[1] 1从 Overleaf 提交论文到 arXiv - 知乎

6、表格过宽问题,自适应调整宽度

(1)方法一:使用\resizebox

% 第一步在导言区,添加
\usepackage{graphicx}
% 第二步,在tabular外面、table内部添加\resizebox
\begin{table}
\centering
\caption{Units for Magnetic Properties}
\label{table}

\resizebox{\linewidth}{!}{
\begin{tabular}
表格内容
\end{tabular}
}

\end{table}

(2)使用\setlength{\tabcolsep}{3pt}手动调整列宽,默认列宽为6pt

\begin{table}
\centering
\caption{Units for Magnetic Properties}
\label{table}
\setlength{\tabcolsep}{3pt}

\begin{tabular}
表格内容
\end{tabular}

\end{table}

7、作者右上角添加ORCID标识

% 导言区添加对应的模块
% add orcid
\usepackage{orcidlink} %调包
% \hypersetup{hidelinks} % hide the hyperlink box

% 通过公式的方式,给作者右上角添加ORCID的标识
\author{MK422 $^{\orcidlink{0000-0000-0000-0000}}$}

8、调整Latex段落间距的常见方式

 a. 通过\vspace(*pt)添加或减少间距

\vspace(2pt)

\vspace(-1pt)

\vspace(-2.5em)

b. 通过\begingroup来调整,这个方法挺有效的

\begingroup
\setlength{\parskip}{1.2pt}  % 设置段落间距为2pt

内容

\endgroup

9、表格相关注意事项

(1)让单元格中0.406正常大小显示,其他字符以6.5pt显示

0.406 {\fontsize{6.5pt}{10pt}\selectfont [0.418, 0.390]}

10、IEEE LaTex模版实现参考文献作者人数超过3就显示为“et al.”的功能(IEEEtran.bst)

方法一:调整*.bst文件,自动显示et al

(1)打开IEEEtran.bst文件,同时找到“FUNCTION {default.is.forced.et.al} { #0 }”,将附近的代码修改为(只需要修改数字即可)

% #0 turns off the forced use of "et al."
% #1 enables
FUNCTION {default.is.forced.et.al} { #1 }  

% The maximum number of names that can be present beyond which an "et al."
% usage is forced. Be sure that num.names.shown.with.forced.et.al (below)
% is not greater than this value!
% Note: There are many instances of references in IEEE journals which have
% a very large number of authors as well as instances in which "et al." is
% used profusely.
FUNCTION {default.max.num.names.before.forced.et.al} { #3 }

% The number of names that will be shown with a forced "et al.".
% Must be less than or equal to max.num.names.before.forced.et.al
FUNCTION {default.num.names.shown.with.forced.et.al} { #1 }

(2)备注:

  • FUNCTION {default.is.forced.et.al} { #1 }   % 开启使用"et al."功能,默认为0,其中1为开启
  • FUNCTION {default.max.num.names.before.forced.et.al} { #3 } % 超过3个作者,则显示N个作者+et al
  • FUNCTION {default.num.names.shown.with.forced.et.al} { #1 } % 上面N对应这里的1,即只显示第一个作者+et al,换句话说,当作者数量超过3时,只显示第一个作者+et al
  • 当参考文献[3]和[4]的第一个作者是同一个作者时,参考文献[4]的作者是一个横线,如下图所示。解决方案:1) 同一位作者的多篇文献,尽量不要挨着一起引用;2)如果同一位作者的多篇文献一定挨着,这可以在*.bib文件中,在author子段那里添加一个大括号(即两个大括号,解释器将其判断为一个作者),如下面的代码所示。
@ARTICLE{miccai-2024-sei,
      title={Structural Entities Extraction and Patient Indications Incorporation for Chest X-ray Report Generation}, 
      author={{Kang Liu and Zhuoqi Ma and Xiaolu Kang and Zhusi Zhong and Zhicheng Jiao and Grayson Baird and Harrison Bai and Qiguang Miao}},
      year={2024},
      journal={CoRR},
      volume={abs/2405.14905},
      doi={10.48550/arXiv.2405.14905},
      eprint={2405.14905},
      archivePrefix={arXiv},
      primaryClass={eess.IV}
}

方法二:手动修正每份参考文献

将不想显示的作者换成“others”,如下所示:

@ARTICLE{miccai-2024-sei,
      title={Structural Entities Extraction and Patient Indications Incorporation for Chest X-ray Report Generation}, 
      author={Kang Liu and others},
      year={2024},
      journal={CoRR},
      volume={abs/2405.14905},
      doi={10.48550/arXiv.2405.14905},
      eprint={2405.14905},
      archivePrefix={arXiv},
      primaryClass={eess.IV}
}

  • 6
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值