[Tex/LaTex] Bibtex style with url and titles of references in bold

bibtexnatbiburls

I'm looking for a bibliography style (in bibtex) that displays the web url of the references AND also writes the names of the authors of each reference in bold, e.g.

Smith, Nick and John Zeigler, "How to become rich", Journal of Dreams, 2007, 74 (2), 391-415. URL https://blurp.org/a/dreams/issue/16-340.html

I have used \bibliographystyle{plainnat} which gets the url right but doesn't display the authors in bold, and \bibliographystyle{aer} which displays the authors in bold but doesn't write the url.

Remark: I know it can probably be done with biblatex but I would like to know specifically if there is a way to do it with bibtex. Is there a bibliography style that gets it done right?

I attach below a sample document

\documentclass[a4paper,12pt]{article}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{amsmath}
%\usepackage{floats}
\setcounter{MaxMatrixCols}{10}


\thispagestyle{empty}
\setcounter{secnumdepth}{0}
\setlength{\topmargin}{-1.0in}
\setlength{\textheight}{9.25in}
\setlength{\oddsidemargin}{0.0in}
\setlength{\evensidemargin}{0.0in}
\setlength{\textwidth}{6.5in}

\usepackage[authoryear]{natbib}

\usepackage[plainpages=false,breaklinks=true,colorlinks=true,urlcolor=magenta,
citecolor=blue,linkcolor=blue,bookmarks=true,bookmarksopen=true,
bookmarksopenlevel=1,pdfstartview=FitH,pdfview=FitH]{hyperref}

\begin{document}

Bla bla \citet{CK_jme2006}

\bibliography{macro_firstyear_biblio}
%\bibliographystyle{aer} % OK but only bold
\bibliographystyle{plainnat} % OK but only url

\end{document}

Best Answer

You can modify plainnat.bst so that it prints the author/editor list in bold.

  1. Locate plainnat.bst on your machine (with kpsewhich plainnat.bst) or download it from CTAN at http://mirrors.ctan.org/macros/latex/contrib/natbib/plainnat.bst
  2. Copy the file to a location where LaTeX can find it (https://texfaq.org/FAQ-inst-wlcf), the directory of your current document will do just fine.
  3. Rename the copied file to plainnat-boldauthors.bst. This is strongly recommended. Using the old name will only lead to confusion.
  4. Open the new file and add a short header with the current date, your name and a short explanation of the changes.
  5. Add a new function

    FUNCTION {bold}
    { duplicate$ empty$
        { pop$ "" }
        { "\textbf{" swap$ * "}" * }
      if$
    }
    

    after the definition of FUNCTION {emphasize}.

  6. For each entry type <type> add bold after the call to format.authors/format.editors in initial position so that, e.g. in FUNCTION {article}

    format.authors "author" output.check
    

    becomes

    format.authors bold "author" output.check
    

    etc.

You can find a ready-made copy of the modified file at https://gist.github.com/moewew/b5b57513bbe6e4ec51ca70d098b72913, the diff to plainnat.bst is

--- plainnat.bst    2010-09-14 11:10:56.000000000 +0200
+++ plainnat-boldauthors.bst    2018-11-29 18:05:20.659087400 +0100
@@ -1,3 +1,15 @@
+%%%% plainnat-boldauthors.bst
+%%%% plainnat with bold author/editor lists
+%%%% for https://tex.stackexchange.com/q/462393/35864
+%%%% 2018-11-29 MW
+%%%% this version can be distributed under the LPPL version 1.3c or
+%%%% (at your option) any later version
+%%%% the license should be part of your LaTeX installation and is also
+%%%% available at
+%%%% https://www.latex-project.org/lppl.txt
+%%%% the original plainnat.bst can be obtained from CTAN at
+%%%% http://mirrors.ctan.org/macros/latex/contrib/natbib/plainnat.bst
+%%%% original header follows
 %% File: `plainnat.bst'
 %% A modification of `plain.bst' for use with natbib package 
 %%
@@ -211,6 +223,14 @@
   if$
 }

+% new function for bold text
+FUNCTION {bold}
+{ duplicate$ empty$
+    { pop$ "" }
+    { "\textbf{" swap$ * "}" * }
+  if$
+}
+
 INTEGERS { nameptr namesleft numnames }

 FUNCTION {format.names}
@@ -696,9 +716,11 @@
   " \citet{" * crossref * "}" *
 }

+% 2018-11-29 MW: in the following FUNCTIONs 'bold' was added after all
+% format.authors/format.editors in initial position to obtain bold name lists
 FUNCTION {article}
 { output.bibitem
-  format.authors "author" output.check
+  format.authors bold "author" output.check
   author format.key output
   new.block
   format.title "title" output.check
@@ -729,10 +751,10 @@
 FUNCTION {book}
 { output.bibitem
   author empty$
-    { format.editors "author and editor" output.check
+    { format.editors bold "author and editor" output.check
       editor format.key output
     }
-    { format.authors output.nonnull
+    { format.authors bold output.nonnull
       crossref missing$
         { "author and editor" editor either.or.check }
         'skip$
@@ -765,7 +787,7 @@

 FUNCTION {booklet}
 { output.bibitem
-  format.authors output
+  format.authors bold output
   author format.key output
   new.block
   format.title "title" output.check
@@ -784,10 +806,10 @@
 FUNCTION {inbook}
 { output.bibitem
   author empty$
-    { format.editors "author and editor" output.check
+    { format.editors bold "author and editor" output.check
       editor format.key output
     }
-    { format.authors output.nonnull
+    { format.authors bold output.nonnull
       crossref missing$
         { "author and editor" editor either.or.check }
         'skip$
@@ -822,7 +844,7 @@

 FUNCTION {incollection}
 { output.bibitem
-  format.authors "author" output.check
+  format.authors bold "author" output.check
   author format.key output
   new.block
   format.title "title" output.check
@@ -852,7 +874,7 @@

 FUNCTION {inproceedings}
 { output.bibitem
-  format.authors "author" output.check
+  format.authors bold "author" output.check
   author format.key output
   new.block
   format.title "title" output.check
@@ -892,7 +914,7 @@

 FUNCTION {manual}
 { output.bibitem
-  format.authors output
+  format.authors bold output
   author format.key output
   new.block
   format.btitle "title" output.check
@@ -909,7 +931,7 @@

 FUNCTION {mastersthesis}
 { output.bibitem
-  format.authors "author" output.check
+  format.authors bold "author" output.check
   author format.key output
   new.block
   format.title "title" output.check
@@ -926,7 +948,7 @@

 FUNCTION {misc}
 { output.bibitem
-  format.authors output
+  format.authors bold output
   author format.key output
   title howpublished new.block.checkb
   format.title output
@@ -943,7 +965,7 @@

 FUNCTION {phdthesis}
 { output.bibitem
-  format.authors "author" output.check
+  format.authors bold "author" output.check
   author format.key output
   new.block
   format.btitle "title" output.check
@@ -960,7 +982,7 @@

 FUNCTION {proceedings}
 { output.bibitem
-  format.editors output
+  format.editors bold output
   editor format.key output
   new.block
   format.btitle "title" output.check
@@ -981,7 +1003,7 @@

 FUNCTION {techreport}
 { output.bibitem
-  format.authors "author" output.check
+  format.authors bold "author" output.check
   author format.key output
   new.block
   format.title "title" output.check
@@ -998,7 +1020,7 @@

 FUNCTION {unpublished}
 { output.bibitem
-  format.authors "author" output.check
+  format.authors bold "author" output.check
   author format.key output
   new.block
   format.title "title" output.check

Then you just use plainnat-boldauthors instead of plainnat in your documents

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[authoryear]{natbib}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{sigfridsson,
  author  = {Sigfridsson, Emma and Ryde, Ulf},
  title   = {Comparison of methods for deriving atomic charges from the
             electrostatic potential and moments},
  journal = {Journal of Computational Chemistry},
  year    = 1998,
  volume  = 19,
  number  = 4,
  pages   = {377-395},
  doi     = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
}
@misc{elk,
  author   = {Anne Elk},
  title    = {A Theory on Brontosauruses},
  url      = {http://www.example.edu/~elk/bronto.pdf},
  year     = {2016},
}
\end{filecontents}

\begin{document}
Bla bla \citet{sigfridsson,elk}

\bibliography{\jobname}
\bibliographystyle{plainnat-boldauthors}
\end{document}

Bibliography with bold name lists


Since you mention biblatex, version 3.12 makes it very easy to get bold name lists

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[style=authoryear, backend=biber]{biblatex}

\DeclareNameWrapperFormat{sortname}{\mkbibbold{#1}}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson,worman,geer}
\printbibliography
\end{document}

A <code>biblatex</code> bibliography with bold name lists.