5

I'm trying to modify my references so that a journal article appears as "volume, number" instead of volume(number). I also need to include the DOI number. Any suggestions?

Currently, one reference looks like this:

Andreoni, James. 1990. "Impure Altruism and Donations to Public Goods: A Theory of Warm-Glow Giving" The Economic Journal 100(401):464-477.

What I am looking for:

Andreoni, James. 1990. "Impure Altruism and Donations to Public Goods: A Theory of Warm-Glow Giving" The Economic Journal 100, no. 401:464-477. doi: 10.2307/2234133.

I'm currently using natbib with apsr-quote.bst. I'm fairly new to LaTex so any advice would be much appreciated!

MWE

\documentclass[12pt,a4paper]{article}
\usepackage {inputenc, ucs, amsmath, amsfonts, amssymb, latexsym, graphicx, natbib,ntheorem,setspace}
\bibpunct{(}{)}{;}{a}{}{;}
\usepackage[bottom]{footmisc}
\usepackage[T1,hyphens]{url}
\usepackage[hidelinks]{hyperref}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage[flushleft]{threeparttable}
\usepackage{float}



\usepackage{csquotes}
\renewcommand{\mktextquote}[6]{#1#2#4#5#3#6}


\setlength{\topmargin}{-.5in}
\setlength{\textheight}{9in}
\setlength{\oddsidemargin}{.125in}
\setlength{\textwidth}{6.25in}

\newcommand*{\TitleFont}{%
    \usefont{\encodingdefault}{\rmdefault}{b}{n}%
    \fontsize{16}{20}%
    \selectfont}

Bib entry (using BibDesk):

@article{andreoni1990impure,
    Author = {Andreoni, James},
    Journal = {The Economic Journal},
    Number = {401},
    Pages = {464--477},
    Title = {Impure Altruism and Donations to Public Goods: A Theory of Warm-Glow Giving},
    Volume = {100},
    Year = {1990}}
6

Rename the file apsr_fsb.bst and in the new renamed file do the following changes:

1) In the ENTRY you have to add to doi so it will become:

ENTRY
  { address
    author
    booktitle
    chapter
    edition
    editor
    howpublished
    institution
    journal
    key
    month
    note
    number
    organization
    pages
    publisher
    school
    series
    title
    type
    URL
    volume
    year
    doi %added
  }

2) Add also the following code (you can put it directly after INTEGERS { nameptr namesleft numnames }):

FUNCTION {doilink}
{ duplicate$ empty$
{ pop$ "" }
{ doi empty$
    { skip$ }
    { "\href{http://dx.doi.org/" doi * "}{" * swap$ * "}" * }
  if$
}
if$
}
FUNCTION {add.doi}
{ duplicate$ empty$
    { skip$ }
    { doi empty$
        {}
        {"\href{http://dx.doi.org/" doi * "}{" * swap$ * "}" *}
      if$
    }
  if$
}
FUNCTION {format.jdoi}
{ doi missing$   
    { "" }
    {", doi: " doi * 
      }
    if$
     doilink 
}

3) Now replace the following code

FUNCTION {format.num}
{ number empty$
  'skip$
  { "(" number * ")" * *
  }
  if$
}

by the following one:

FUNCTION {format.num}
{ number empty$
  'skip$
  { ", no. " number * " " * *
  }
  if$
}

4) Finally, replace the following code

FUNCTION {article}
{ output.bibitem
  list.label.output
  list.year output.nonnull
  new.block
  author "author" item.check
  title.field field.used =
    { skip$ }
    { format.title quote "title" output.check }
  if$
  crossref missing$
    { journal emphasize "journal" duplicate$ item.check
      year empty$
        { ". Forthcoming" * output new.block }
        { " " * format.vol.mon.num.pages * output }
      if$
     }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  fin.entry
}

by

FUNCTION {article}
{ output.bibitem
  list.label.output
  list.year output.nonnull
  new.block
  author "author" item.check
  title.field field.used =
    { skip$ }
    { format.title quote "title" output.check }
  if$
  crossref missing$
    { journal emphasize "journal" duplicate$ item.check
      year empty$
        { ". Forthcoming" * output new.block }
        { " " * format.vol.mon.num.pages * output }
      if$
      format.jdoi * " " output %added
     }
    { format.article.crossref output.nonnull
      format.pages output 
      format.jdoi add.doi "doi: " output  
    }
  if$
  new.block
  fin.entry
}

A MWE:

\documentclass[12pt,a4paper]{article}
\usepackage {inputenc, ucs, amsmath, amsfonts, amssymb, latexsym, graphicx, natbib,ntheorem,setspace}
\bibpunct{(}{)}{;}{a}{}{;}
\usepackage[bottom]{footmisc}
\usepackage[T1,hyphens]{url}
\usepackage[hidelinks]{hyperref}
\usepackage{graphicx}
\usepackage{multirow}
\usepackage[flushleft]{threeparttable}
\usepackage{float}



\usepackage{csquotes}
%\renewcommand{\mktextquote}[6]{#1#2#4#5#3#6} 

\renewcommand{\mktextquote}[6]{%
    #1%
    \iflanguage{english}{\itshape}{}% ADDED
    #2#4#3#6#5%
}
\renewcommand{\mkblockquote}[4]{%
    \iflanguage{english}{\itshape}{}% ADDED
    #1#2#4#3%
}


\setlength{\topmargin}{-.5in}
\setlength{\textheight}{9in}
\setlength{\oddsidemargin}{.125in}
\setlength{\textwidth}{6.25in}

\newcommand*{\TitleFont}{%
    \usefont{\encodingdefault}{\rmdefault}{b}{n}%
    \fontsize{16}{20}%
    \selectfont}

\begin{document}
    \cite{andreoni1990impure}
    \bibliographystyle{apsr_fsb_mod}
    \bibliography{Library}
\end{document}

which produces: enter image description here

Update:

For the apsr.bst style instead of 3) you must replace the following code

FUNCTION {format.vol.num.pages}
{ volume field.or.null
  number empty$
    'skip$
    { "(" number * ")" * *
      volume empty$
    { "there's a number but no volume in " cite$ * warning$ }
    'skip$
      if$
    }
  if$
  pages empty$
    'skip$
    { duplicate$ empty$
    { pop$ format.pages }
    { ":" * pages n.dashify * }
      if$
    }
  if$
}

by

FUNCTION {format.vol.num.pages}
{ volume field.or.null
  number empty$
    'skip$
    {    ", no. " number * " " * *     % instead of: "(" number * ")" * *
      volume empty$
    { "there's a number but no volume in " cite$ * warning$ }
    'skip$
      if$
    }
  if$
  pages empty$
    'skip$
    { duplicate$ empty$
    { pop$ format.pages }
    { " : " * pages n.dashify * } % instead of: ":" * pages n.dashify * }
      if$
    }
  if$
}
|improve this answer|||||
  • Thank you! The DOI field is now included in references. However, I am having trouble with step 3 since I wasn't able to find the FUNCTION{format.num} in the apsr.bst file. Instead, I modified the FUNCTION{format.vol.num.pages} with the same change you suggested, but this removes volume and number from the references all together. Not sure what I did wrong? – ankitaban Jun 11 '18 at 6:30
  • Just to clarify my above comment, my sample reference is now appearing as: Andreoni, James. 1990. “Impure Altruism and Donations to Public Goods: A Theory of Warm-Glow Giving.” The Economic Journal , doi: 10.2307/2234133. – ankitaban Jun 11 '18 at 9:45
  • @AnkitaBanerjea, could you give me the link of the apsr_fsb.bst style that you are using. I downloaded it from here. In my version you can find FUNCTION{format.num} just above FUNCTION {format.vol.mon.num.pages} – Mohamed Vall Jun 11 '18 at 10:07
  • the file I am using was downloaded from here: ctan.yazd.ac.ir/macros/latex/contrib/harvard/apsr.bst. It seems like you were using a different version perhaps? – ankitaban Jun 11 '18 at 10:17
  • It works now! I used the version you were using and modified the code, and everything looks good. Thank you so much! – ankitaban Jun 11 '18 at 10:27

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.