MikTex+Texmaker环境LaTeX使用bib文件引用参考文献步骤

文章介绍了如何在MikTex和Texmaker环境下设置和使用LaTeX项目,包括创建bib文件存储参考文献,编写main.tex文件引用这些文献,以及详细阐述了编译过程,包括BibTex和XeLaTeX的交替使用,以生成正确的PDF预览,显示引用和参考文献列表。
摘要由CSDN通过智能技术生成

一、MikTex+Texmaker环境

        MikTex+Texmaker环境是一个LaTeX编辑与编译,以及PDF预览环境。如果还没装好的话,推荐浏览【MiKTeX+Texmaker安装】这篇博客去安装此环境。

二、准备bib文件

        文件名命名为ref.bib,添加如下内容(作为demo)

@article{kaelbling1996survey4rl,
  title={Reinforcement learning: A survey},
  author={Kaelbling, Leslie Pack and Littman, Michael L and Moore, Andrew W},
  journal={Journal of artificial intelligence research},
  volume={4},
  pages={237--285},
  year={1996}
}

三、准备LaTeX项目的main.tex文件并引用参考文献

        与ref.bib同级目录下,创建main.tex文件,添加以下内容(作为demo)

\documentclass{article}

\begin{document}

\section{Citation Demo}

On the paper, I read literatures of reinforcement learning in \cite{kaelbling1996survey4rl}. This is the abstract what I read:

This paper surveys the field of reinforcement learning from a computer-science perspective. It is written to be accessible to researchers familiar with machine learning. Both the historical basis of the field and a broad selection of current work are summarized. Reinforcement learning is the problem faced by an agent that learns behavior through trial-and-error interactions with a dynamic environment. The work described here has a resemblance to work in psychology, but differs considerably in the details and in the use of the word ``reinforcement.'' The paper discusses central issues of reinforcement learning, including trading off exploration and exploitation, establishing the foundations of the field via Markov decision theory, learning from delayed reinforcement, constructing empirical models to accelerate learning, making use of generalization and hierarchy, and coping with hidden state. It concludes with a survey of some implemented systems and an assessment of the practical utility of current methods for reinforcement learning.

\bibliography{ref}
\bibliographystyle{ieeetr}

\end{document}

四、具体步骤

        1、在Texmaker中打开ref.bib文件,使用BibTex编译,如下图

        2、在Texmaker中打开main.tex文件,使用BibTex编译,如下图

        3、针对main.tex文件,使用LaTeX具体编译器编译,比如XeLaTeX,如下图

        4、针对main.tex文件,再次使用BibTex编译,如下图

        5、针对main.tex文件,再次使用XeLaTeX编译,如下图

        6、针对main.tex文件,再一次使用XeLaTeX编译,终于不报错了,如下图

        7、此时查看PDF,显示引用和参考文献列表正常。

五、总结语

        总的来说,使用MikTex+Texmaker环境这种离线的LaTeX编辑和编译环境在参考文献方面实在是太过玄学。我真的不明白它为什么搞得这么复杂。使用技巧总结如下:

        ①使用BibTex先后编译bib文件、tex文件;

        ②分别使用XeLaTex、BibTex对tex文件编译;

        ③再使用XeLaTex对tex文件进行两次编译。

        ④查看PDF,应该就可以正常显示引用了。如果还是不行,建议查看一下,main.tex文件目录下有没有生成main.bbl文件。如果有,应该是可以正常显示的。如果没有,再考虑下是不是遇到了其他的问题了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

飞机火车巴雷特

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值