我使用 Jabref 为我的 LaTeX 文件制作 .bib 文件,因为我的标题需要引号。它们可以正常工作,除非我的标题直接位于 URL 旁边。
这有效:
[5] ASCE (2013). "2013 Report Card for America's Infrastructure." American
Society of Civil Engineers, <http://www.infrastructurereportcard.org/bridges/>
(March).
这不起作用:
[32] Pierce, G. (2013). "GN's Bridge 4: The Great Northern's Bridge at the Locks",
<http://www.gngoat.org/bridge 4.htm> (March).
我尝试在出现此问题的标题末尾添加 '',但逗号最终超出了引号。我尝试了两种样式:
bibliographystyle{ascelike}
bibliographystyle{plainnat}
但我认为 Jabref 无论如何都会覆盖它们,所以我认为问题出在 Jabref 上。有什么想法吗?
答案1
您在这里面临的问题是,您实际上需要提前扫描标点符号并将其移到引号内。幸运的是,包csquotes
正是为您做到这一点。
您需要修改\bibliographystyle
您使用的,假设它是plainnat
。将文件plainnat.bst
(或您使用的任何文件)复制到可以找到它的位置LaTeX
,将其重命名为plainnatampct.bst
。
找到FUNCTION {format.title}
(我的 l.299 plainnat.bst
)并将整个函数替换为:
FUNCTION {format.title}
{ title empty$
{ "" }
{ "\textquote{" title "t" change.case$ * "}" * }% <----- this is the modified line
if$
}
这将标题包装起来\textquote{...}
并且引用命令可以向前查看。
如果要修改ascelike.bst
,则需要进行一些更改。然后新文件将是ascelikeampunct.bst
改变FUNCTION {format.title}
。
FUNCTION {format.title}
{ title empty$
{ "" }
{ "\textquote{" title "t" change.case$ * "}" * }% <----- this is the modified line
if$
}
您还需要对safter.quote 'output.state :=
中的所有内容进行注释FUNCTION
。
然后将\usepackage[autostyle=true,english=american]{csquotes}
和\renewcommand{\mktextquote}[6]{#1#2#4#5#3#6}
放在你的序言中,后者确保标点符号被移动里面引号。
还要确保您的.bib
文件才不是包含多余的引号。这是不必要(实际上这不是一个好主意)在标题中添加外引号。写
title = {{GN}'s {B}ridge 4: {T}he {G}reat {N}orthern's {B}ridge at the {L}ock}
为 而不是title = {{GN}'s {B}ridge 4: {T}he {G}reat {N}orthern's {B}ridge at the {L}ocks''}
。
平均能量损失
\documentclass[american]{article}
\usepackage{natbib}
\usepackage{babel}
\usepackage{url}
\usepackage[autostyle=true,english=american]{csquotes}
\begin{filecontents*}{\jobname.bib}
@article{testart,
author = {Arnold Uthor and William Riter},
title = {A Very Interesting Article},
journal = {Journal of Articles},
volume = {7},
number = {3},
page = {1-5},
year = {2010},
}
@book{testbook,
author = {Walter Ordsmith},
title = {The Work},
subtitle = {Subtitle},
publisher = {Pub \& Lisher's Co.},
year = {1983},
}
@misc{testonline,
author = {Bernie Logger},
title = {A Very Opinionated Blog Post},
url = {http://example.com},
year = {2013},
}
@MISC{ASCE2013,
author = {{ASCE}},
title = {2013 {R}eport {C}ard for {A}merica's {I}nfrastructure},
month = {March},
year = {2013},
organization = {{A}merican {S}ociety of {C}ivil {E}ngineers},
url = {http://www.infrastructurereportcard.org/bridges/},
}
@MISC{Pierce1998,
author = {Pierce, G.},
title = {{GN}'s {B}ridge 4: {T}he {G}reat {N}orthern's {B}ridge at the {L}ocks},
month = {March},
year = {2013},
url = {http://www.gngoat.org/bridge4.htm},
}
\end{filecontents*}
\renewcommand{\mktextquote}[6]{#1#2#4#5#3#6}
\begin{document}
\bibliography{\jobname}
\nocite{*}
\bibliographystyle{ascelikeampunct}
\end{document}