当我在 .bib 文件中包含 url 时,latex 会抛出错误:
Tex 容量超出,抱歉[保存大小=5000]
你知道为什么吗?
下面我粘贴了我使用的包和一个参考
\documentclass[english]{article}
\usepackage[utf8]{inputenc} %write accent without the \ [' ` ^]
\usepackage{lmodern,textcomp} % + the above package use euro directly
\usepackage{babel}
\usepackage{harvard}
\bibliographystyle{agsm}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{hyperref}
\usepackage[margin=1.5in]{geometry}
%\usepackage{times}
\begin{document}
as in \cite{AhlinTownsend2007}, blah, blah blah...
\cite{DufloBanerjee2013}
\bibliography{test}
\end{document}
和 test.bib 文件
@article {AhlinTownsend2007,
author = {Ahlin, Christian and Townsend, Robert M.},
title = {Using Repayment Data to Test Across Models of Joint Liability Lending*},
journal = {The Economic Journal},
volume = {117},
publisher = {Blackwell Publishing Ltd},
number = {517},
pages = {F11-F51},
issn = {1468-0297},
doi = {10.1111/j.1468-0297.2007.02014.x},
url = {http://dx.doi.org/10.1111/j.1468-0297.2007.02014.x},
year = {2007},
}
@techreport{DufloBanerjee2013,
title={The miracle of microfinance? Evidence from a randomized evaluation},
author={Duflo, Esther and Banerjee, Abhijit and Glennerster, Rachel and Kinnan, Cynthia G},
year={2013},
institution={National Bureau of Economic Research},
}
答案1
恐怕我也无法复制您报告的容量超出错误。
但是,我有两个建议——都是基于您正在使用该hyperref
软件包的事实——可能会很有用。此外,其中一个建议涉及使用natbib
而不是harvard
。通过此更改,容量超标错误也可能会自行消失。
如果您希望 URL 字符串成为用户可以点击的活动超链接,则应将 url 字段写为
url = {\url{http://dx.doi.org/10.1111/j.1468-0297.2007.02014.x}},
而不是
url = {http://dx.doi.org/10.1111/j.1468-0297.2007.02014.x},
如果您希望文档正文中的引文标注成为参考书目中相应条目的超链接,请不要加载
harvard
引文管理包。相反,请加载引文natbib
管理包和辅助har2nat
包。由于您使用的是agsm
参考书目样式(它是包的一部分)harvard
,因此有必要加载har2nat
,因为它提供了将某些harvard
- 特定宏“翻译”为可以处理的形式的宏natbib
。(从 切换harvard
到natbib
/时har2nat
,通常需要删除在早期编译运行期间创建的所有辅助文件。)
在下面的例子中,请注意,该natbib
包加载了选项longnamesfirst
,以复制该harvard
包的功能,即第一次引用给定条目时应提供所有作者的姓名。(对给定条目的后续标注排版为FirstAuthor et al.
。)另外,请注意,应该将单词括Evidence
在花括号中,以防止其转换为全小写。
\documentclass[english]{article}
\usepackage{filecontents} % make this a self-contained example
\begin{filecontents*}{test.bib}
@article {AhlinTownsend2007,
author = {Ahlin, Christian and Townsend, Robert M.},
title = {Using Repayment Data to Test Across Models of Joint Liability Lending},
journal = {The Economic Journal},
volume = {117},
publisher = {Blackwell Publishing Ltd},
number = {517},
pages = {F11-F51},
issn = {1468-0297},
doi = {10.1111/j.1468-0297.2007.02014.x},
url = {\url{http://dx.doi.org/10.1111/j.1468-0297.2007.02014.x}},
year = {2007},
}
@techreport{DufloBanerjee2013,
title={The miracle of microfinance? {Evidence} from a randomized evaluation},
author={Duflo, Esther and Banerjee, Abhijit and Glennerster, Rachel and Kinnan, Cynthia G},
year={2013},
institution={National Bureau of Economic Research},
}
\end{filecontents*}
\usepackage[margin=1.5in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{lmodern,textcomp}
\usepackage{babel}
%%%\usepackage{harvard}
\usepackage[longnamesfirst]{natbib}
\usepackage{har2nat} % emulate harvard-type macros for natbib
\bibliographystyle{agsm} % agsm is part of the "harvard" package
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage[colorlinks=true,citecolor=blue]{hyperref}
\begin{document}
\dots as in \cite{AhlinTownsend2007}, blah, blah blah\dots
\cite{DufloBanerjee2013}
\bibliography{test}
\end{document}