Latex 撰写论文错误及解决方法记录

author year 问题

报错信息

Package natbib: Bibliography not compatible with author-year citations.
(natbib)	Press <return> to continue in numerical citation style.

解决方法

将 authoryear 选项去掉。

\documentclass[times,twocolumn,authoryear,final]{elsarticle}%错误
\documentclass[times,twocolumn,final]{elsarticle}%正确

hyperref 问题

报错信息

Token not allowed in a PDF string (PDFDocEncoding):
(hyperref)	removing `\<def>-command'.

解决方法

\usepackage[colorlinks]{hyperref}

在引入包之后添加如下代码。

\pdfstringdefDisableCommands{
  \def\corref#1{<#1>}
}

BibTex 引用问题

在使用 BibTex 引用时,若使用从 arXiv 网站导出的 BibTex 出现错误,

@misc{ledig2017photorealistic,
      title={Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network},
      author={Christian Ledig and Lucas Theis and Ferenc Huszar and Jose Caballero and Andrew Cunningham and Alejandro Acosta and Andrew Aitken and Alykhan Tejani and Johannes Totz and Zehan Wang and Wenzhe Shi},
      year={2017},
      eprint={1609.04802},
      archivePrefix={arXiv},
      primaryClass={cs.CV}
}

则可以考虑统一换成谷歌学术上的 BibTex 代码。

@inproceedings{ledig2017photo,
  title={Photo-realistic single image super-resolution using a generative adversarial network},
  author={Ledig, Christian and Theis, Lucas and Husz{\'a}r, Ferenc and Caballero, Jose and Cunningham, Andrew and Acosta, Alejandro and Aitken, Andrew and Tejani, Alykhan and Totz, Johannes and Wang, Zehan and others},
  booktitle={Proceedings of the IEEE conference on computer vision and pattern recognition},
  pages={4681--4690},
  year={2017}
}

图片与表格 label 放置问题

图片

将\label{}放入\caption{}中。

\begin{figure}[htb]
  \centering
  \caption{\label{fig1}Results of ablation study}
\end{figure}latex

表格

将\label{}放在\end{table}之前。

\begin{table}[htb]
  \centering
  \caption{Results of Ablation Study}
  \begin{tabular}{@{}lc|cccc@{}}
  \end{tabular}
  \label{table1}
\end{table}

字体问题

在使用

\setCJKmainfont{}
\setCJKmonofont{}

等命令进行设置的时候,选择字体时采用的名字 Win10 和 Linux 是不同。另外,如果一个模板在 Linux 下开发的,拿到 Win10 来用可能会出现奇奇怪怪的问题,这是直接只用命令行编译有奇效。

比如直接用

xelatex resume-zh.tex

碰到报错就直接回车键跳过。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值