Latex文献引用

我使用的是在线latex编译器:A Survey on Machine Translation - Online LaTeX Editor Overleaf

# 宏文件处,开头加上
\usepackage{cite}
\bibliographystyle{plain}  

# 结尾加上这个你的 mybibfile.bib 文件的名字
\bibliography{mybibfile}

# 记录一个小问题:
\cite{} 这个给我报错:
"""
			]{xxxx名字} 
			! Paragraph ended before \@citex was complete.
			<to be read again> 
			                   \par 
			l.1474 
			       
			I suspect you've forgotten a `}', causing me to apply this
			control sequence to too much text. How can we recover?
			My plan is to forget the whole thing and hope for the best.
"""
\citep{} 才不报错,不知道为啥

举个例子 咱们有两个文件 一个 .tex(需要编译的主文件)和 .bib(这个里面放引用文献的信息)

.bib

@inproceedings{NIPS2017_3f5ee243,
 author = {Vaswani, Ashish and Shazeer, Noam and Parmar, Niki and Uszkoreit, Jakob and Jones, Llion and Gomez, Aidan N and Kaiser, \L ukasz and Polosukhin, Illia},
 booktitle = {NeurIPS},
 pages = {},
 title = {Attention is All you Need},
 url = {https://proceedings.neurips.cc/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf},
 year = {2017}
}
@inproceedings{Box1970TimeSA,
  title={Time series analysis, forecasting and control},
  author={G. E. P. Box and Gwilym M. Jenkins},
  year={1970}
}

@book{2008Forecasting,
  title={Forecasting with exponential smoothing: the state space approach},
  author={Hyndman, Rob and Koehler, Anne B and Ord, J Keith and Snyder, Ralph D},
  year={2008},
  publisher={Springer Science \& Business Media}
}

.tex

\usepackage[utf8]{inputenc} % allow utf-8 input
\usepackage[T1]{fontenc}    % use 8-bit T1 fonts
\usepackage{hyperref}       % hyperlinks
\usepackage{url}            % simple URL typesetting
\usepackage{booktabs}       % professional-quality tables
\usepackage{amsfonts}       % blackboard math symbols
\usepackage{nicefrac}       % compact symbols for 1/2, etc.
\usepackage{microtype}      % microtypography
\usepackage{xcolor}         % colors
\usepackage{graphicx}
\usepackage{float} 
\usepackage{subfigure}
\graphicspath{{fig/}}
\usepackage{cite}           %这个就是咱们上面提到的


正文里面
Transformer-based models ~\citep{NIPS2017_3f5ee243}have achieved progressive breakthrough on extensive areas. Especially in time series forecasting, credited to their stacked structure and the capability of attention mechanisms, Transformers can naturally capture the temporal dependencies among time points, thereby fitting the series forecasting task perfectly~\citep{Box1970TimeSA,2008Forecasting}.


\bibliographystyle{plain}  
\bibliography{LaTex/mypaper.bib} #这个地方mypaper是我.bib文件的名字,还有这个一般放到正文后面

效果展示

这个序号生成感觉比较随机,如果注重顺序的朋友可以再想想其他办法,因为我参考nips2022的模板里面的论文好像没有这个要求。

其他资料

Latex如何进行文献的引用(两步解决) - 知乎 (zhihu.com) //这个和我讲的差不多

(293条消息) LaTeX引用参考文献——BibTex参考文献格式大全_花无凋零之时的博客-CSDN博客

//bib文件里面的各个字段的含义(293条消息) Latex正确的引用姿势(使用~\cite, ~\cref, ~\autoref)_鸾镜朱颜暗换的博客-CSDN博客 

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
LaTeX中,文献引用常用的方法是使用BibTeX。下面是一个简单的文献引用模板示例: 1. 首先,创建一个名为“references.bib”的文件,其中包含你要引用文献信息,例如: ``` @article{citekey, author = {Author Name}, title = {Article Title}, journal = {Journal Name}, year = {Year}, volume = {Volume}, number = {Number}, pages = {Pages}, doi = {DOI}, } ``` 其中,`citekey`是你要引用文献的唯一标识符,可以随意命名;`author`是作者名字;`title`是文章标题;`journal`是期刊名字;`year`是发表年份;`volume`是卷号;`number`是期号;`pages`是页码;`doi`是数字对象标识符。 2. 在LaTeX文档中,使用`\bibliography{references}`命令引用“references.bib”文件,并使用`\cite{citekey}`命令引用具体的文献。例如: ``` \documentclass{article} \begin{document} This is a citation \cite{citekey}. \bibliography{references} \bibliographystyle{plain} \end{document} ``` 其中,`\bibliographystyle{plain}`是指定参考文献格式,可以根据需要修改。 3. 编译LaTeX文档时,需要依次执行以下命令: ``` pdflatex document.tex bibtex document pdflatex document.tex pdflatex document.tex ``` 其中,“document”是LaTeX文档的文件名。第一次执行`pdflatex`命令是为了生成`.aux`文件,第二次执行`pdflatex`命令是为了将参考文献插入到文档中。如果需要添加新的文献,只需要在“references.bib”文件中添加即可,不需要修改LaTeX文档。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值