My advisor wants me to cause all titles for papers, books, and articles in "
for my thesis in my bibliography.
I am using natbib
and the plainnat
bibliography style and am unsure how to do this. I am NOT asking how to do this or displaying a quote in the title, I want to make the title show "
around it with capitalization being saved. I could go through and manually modify the .bib file I suppose…
Here is a working example:
\begin{filecontents}{mybib.bib}
@Article{Hart,
author = {P.E. Hart, N.J. Nilsson, B. Raphael},
title = {Correction to a Formal Basis for the Heuristic Determination of Minimum Cost Paths },
journal = {SIGART Newsletter 37},
year = {1972},
pages = {28-29}
}
@Article{Hart2,
author = {P.E. Hart, N.J. Nilsson, B. Raphael},
title = { {``Correction to a Formal Basis for the Heuristic Determination of Minimum Cost Paths''} },
journal = {SIGART Newsletter 37},
year = {1972},
pages = {28-29}
}
\end{filecontents}
\documentclass{report}
\usepackage[numbers,square]{natbib}
\begin{document}
\bibliographystyle{plainnat}
I don't want it to look like this reference \cite{Hart}
I want it to look like this \cite{Hart2}
\bibliography{mybib}
\end{document}
Is there a way to easily do this? I can always hack this by doing what I did for the second reference if not.
From reading this documentation nothing stands out to me as doing this?
Best Answer
Whatever you do, don't modify your
.bib
file by adding the quotation marks there. This will cause you no end of trouble in the future. Here are two solutions.Use
makebst
It's possible to the use
makebst
program to generate a new.bst
file for yourself. To do this, you can open a command line window and type:This will walk you through a whole bunch of menus of choices, including the following:
Then you just use this new
.bst
file for your thesis. You can put it in the same folder as the main.tex
file of your thesis, or put it in your localtexmf
folder (on a TeXLive system is should go in<path-to-local-texmf>/texmf/bib/bst
.Make a new
.bst
file which usescsquotes
for quotingInstead of doing things this way, if you are comfortable with editing your own copy of
plainnat.bst
here's a method which uses thecsquotes
package to do the quotation. This handles punctuation correctly and also allows you to easily change from single to double quotes if you need. It does involve some work, though, but probably will take less time than stepping through all themakebst
choices (especially if you don't know what each one is asking.)First, make a copy of
plainnat.bst
in the same folder of your.tex
file and rename it (e.g.plainnat-csquotes.bst
).Now make the following changes/additions to that file:
First, we add a function
format.atitle
similar to theformat.btitle
function on line 432 ofplainnat.bst
:Next, we add an
enquote
function similar to theemphasize
function on line 207 ofplainnat.bst
. Note that this uses the\textquote
macro from thecsquotes
package, so this.bst
file will require that package to be loaded. We are using the\textquote
macro instead of the more general\enquote
macro so that we can redefine it to place the punctuation correctly according to American standards (punctuation is always inside the quotation mark.)Finally we need to change any entry type that needs quotation marks around its title to use the
format.atitle
function instead of theformat.title
function. In my opinion, this should include (for consistency) thearticle
,incollection
,inproceedings
,techreport
, andunpublished
entry types. If you search through the.bst
file you will find a function for each of them. Here's thearticle
function as an example: (before the change:)We now change the line
to:
Do this for each of the other entry types listed above.
You now have a
csquotes
aware.bst
file. To use it, you simply need to add the following lines to your preamble:To implement correct placement of the punctuation with respect to the quotation mark we need to add the following extra line:
This will place the punctuation inside the quotation marks.
Changing the format of book titles too
Your advisor has requested that book titles also use quotation marks. This is a very unorthodox style, and I don't recommend it at all, but if that's what he wants, it's easy enough to do. Simply find the
format.btitle
function and change it from:to