我正在使用 overleaf 撰写我的文档。以下是我的序言:
\documentclass[12pt]{report}
\usepackage[english]{babel}
\usepackage{appendix}
\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{subfig}
\graphicspath{ {./images/} }
\usepackage{float}
\usepackage{caption}
\usepackage{subcaption}
\usepackage[left=2cm, right=2cm]{geometry} %this is the margin size.
\setlength {\marginparwidth }{2cm} %confirming the margin width for todonotes?
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{url}
\bibliographystyle{ieeetr}
\usepackage[toc,page]{appendix}
\begin{document}
然后我想将参考书目放在文档末尾附近,因此我向下滚动到我想要的位置,这就是我所得到的:
\newpage
\addcontentsline{toc}{section}{References}
\bibliographystyle{ieetr}
\bibliography{bib}
\newpage
%TC:ignore
\begin{appendices}
(我希望参考书目位于附录之前)。但是,当我编译文档时,我的参考文献打印时没有 url。以下是我放入 bib.bib 中的参考文献之一的示例:
@article{TLD_variance,
author={ANDREW MATACZ},
year={2000},
month={Jan},
title={FINANCIAL MODELING AND OPTION THEORY WITH THE TRUNCATED LEVY PROCESS},
journal={International journal of theoretical and applied finance},
volume={3},
number={1},
pages={143-160},
abstract={In recent studies the truncated Levy process (TLP) has been shown to be very promising for the modeling of financial dynamics. In contrast to the Levy process, the TLP has finite moments and can account for both the previously observed excess kurtosis at short timescales, along with the slow convergence to Gaussian at longer timescales. In this paper I further test the truncated Levy paradigm using high frequency data from the Australian All Ordinaries share market index. I then consider an optimal option hedging strategy which is appropriate for the early Levy dominated regime. This is compared with the usual delta hedging approach and found to differ significantly.},
isbn={0219-0249},
url={http://www.worldscientific.com/doi/abs/10.1142/S0219024900000073},
doi={10.1142/S0219024900000073}
}
但编译后却打印如下:
[48] A. MATACZ, “Financial modeling and option theory with the truncated levy process,” Interna-
tional journal of theoretical and applied finance, vol. 3, pp. 143–160, Jan 2000.
32
我怎样才能让它也显示参考文献中的 url,以及如何让它如果有人点击正文中的参考编号,它就会把他们带到参考书目中的特定参考文献?
如果代码很混乱,请原谅,这是我第一次使用 LaTeX 处理如此大的文档。
答案1
你问,
我怎样才能做到,如果有人点击正文中的参考编号,它就会把他们带到参考书目中的特定参考文献?
确保加载该hyperref
包。
我怎样才能让它显示
url
参考中的字段?
不要使用ieeetr
bib 样式,它现在已经过时了,可以追溯到 URL 字符串诞生之前的很久以前。相反,我建议您使用IEEEtran
bib 样式。它的年代比 更近ieeetr
;因此,它已被编程为知道如果条目有一个名为 的字段该怎么做url
。
顺便说一句,我认为没有必要将字段内容全部大写author
;因此,请将其替换author={ANDREW MATACZ},
为author = {Andrew Matacz},
。字段也一样title
。我还会将其替换month={Jan},
为month=jan
。
\documentclass[12pt]{report}
\begin{filecontents}[overwrite]{bib.bib}
@article{TLD_variance,
author = {Andrew Matacz},
year = {2000},
month = jan,
title = {Financial modeling and option theory with the truncated {Levy} process},
journal = {International Journal of Theoretical and Applied Finance},
volume = {3},
number = {1},
pages = {143-160},
abstract = {...},
isbn = {0219-0249},
url = {http://www.worldscientific.com/doi/abs/10.1142/S0219024900000073},
doi = {10.1142/S0219024900000073}
}
\end{filecontents}
\usepackage[english]{babel}
%%\usepackage{appendix} % don't load packages more than once
%%%\usepackage[utf8x]{inputenc} % nooooooo !
\usepackage{amsmath}
\usepackage{graphicx}
%\usepackage{subfig} % don't load both 'subfig' and 'subcaption'
\graphicspath{ {./images/} }
\usepackage{float} % <-- are you sure?
\usepackage{caption}
\usepackage{subcaption}
\usepackage[hmargin=2cm]{geometry} % horizontal margins
\setlength {\marginparwidth }{2cm} %confirming the margin width for todonotes?
\usepackage[colorinlistoftodos]{todonotes}
\usepackage{xurl} % better use 'xurl', not 'url'
\bibliographystyle{IEEEtran}
\usepackage[toc,page]{appendix}
\usepackage{ragged2e} % <-- new
\frenchspacing % optional
\begin{document}
\nocite{*}
\RaggedRight
\addcontentsline{toc}{section}{References}
\bibliography{bib}
\end{document}