1

I'm using Jabref to make my .bib file for my LaTeX file because I needed quotations for my titles. They work, except when my title is directly next to a URL.

This works:

[5] ASCE (2013). "2013 Report Card for America's Infrastructure." American
Society of Civil Engineers, <http://www.infrastructurereportcard.org/bridges/>
(March).

This doesn't work:

[32] Pierce, G. (2013). "GN's Bridge 4: The Great Northern's Bridge at the Locks",
<http://www.gngoat.org/bridge 4.htm> (March).

I tried to just add '' to the end of the titles that have this problem, but my comma ends up being outside the quotation marks. I tried both styles:

bibliographystyle{ascelike}
bibliographystyle{plainnat}

but I think Jabref overrides them anyways, so I think the problem is in Jabref. Any ideas?

4
  • Did you add the quotation marks manually via JabRef? What do the entries in the .bib file for the entries above look like?
    – moewe
    Sep 5 '13 at 20:22
  • @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 = {{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 = {gngoat.org/bridge_4.htm} } Sep 5 '13 at 20:53
  • My title box on JabRef looks like this in order to get the quotes on the right (the left works): GN's Bridge 4: The Great Northern's Bridge at the Locks'' Sep 5 '13 at 20:56
  • 1
    First of all, it is not good style to add the quotation mark to the title field in the .bib file manually; this should only be done by bibtex itself. The problem you are facing here is, that at times you need a . at times a , inside the parentheses, so a solution with bibtex is likely to be quite complicated (one would need to check ahead for punctuation marks and move them inside) maybe csquotes could help there or you could use biblatex.
    – moewe
    Sep 6 '13 at 7:32
2

The problem you are facing here, is that you actually need to scan ahead for punctuation marks and move them inside the quotation. Fortunately, the package csquotes does exactly that for you.

You will need to modify the \bibliographystyle you use, let's say it is plainnat. Copy the file plainnat.bst (or whatever file you use) to a location where LaTeX can find it, rename it to, say, plainnatampct.bst.

Find FUNCTION {format.title} (l. 299 in my plainnat.bst) and replace the entire function with:

FUNCTION {format.title}
{ title empty$
    { "" }
    { "\textquote{" title "t" change.case$ * "}" * }% <----- this is the modified line
  if$
}

This wraps the title in \textquote{...} and that quote command can look ahead.


If you want to modify ascelike.bst, you will need to change a little bit more. The new file would then be ascelikeampunct.bst

Change FUNCTION {format.title}.

FUNCTION {format.title}
{ title empty$
    { "" }
    { "\textquote{" title "t" change.case$ * "}" * }% <----- this is the modified line
  if$
}

You also need to comment all the after.quote 'output.state := in the FUNCTIONs.


Then put \usepackage[autostyle=true,english=american]{csquotes} and \renewcommand{\mktextquote}[6]{#1#2#4#5#3#6} in your preamble, the latter makes sure punctuation is moved inside the quotation marks.


Also make sure your .bib file does not contain superfluous quotation marks. It is not necessary (and actually not a good idea) to add the outer quotation marks to a title. Write title = {{GN}'s {B}ridge 4: {T}he {G}reat {N}orthern's {B}ridge at the {L}ock} and not title = {{GN}'s {B}ridge 4: {T}he {G}reat {N}orthern's {B}ridge at the {L}ocks''}.


MWE

\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}

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.