1

The amsrefs package allows customizing the bibliography style (Section 4 in their guide), but recommending doing it by "writing a LaTeX package which loads the amsrefs package with...". I would only want to put book names in bold fonts; writing a new package sounds like an overkill. Is there any straight-forward way of achieving this?

(I am using amsrefs with bibtex).

Minimal Working Example

\documentclass{article}
\usepackage[nobysame]{amsrefs}

\begin{filecontents}{mwebib.bib}
 @article{A,
     AUTHOR = {Euler, Leonhard},
      TITLE = {Solutio problematis ad geometriam situs pertinentis},
 }
 @book{B,
     AUTHOR = {Euler, Leonhard},
      TITLE = {Elements of Algebra},
 } 
\end{filecontents}

\begin{document}
  Article \cite{A} and book \cite{B}.

  \bibliography{mwebib}
\end{document}

I want the name Elements of Algebra to appear in bold, without changing anything in the .bib file; just by altering the style of amsrefs to consider books differently.

Bach
  • 1,273

1 Answers1

1

You have to modify the \BibSpec for book. I just copied it from amsrefs.sty and changed the relevant bit.

\documentclass{article}
\usepackage[nobysame]{amsrefs}

\BibSpec{book}{%
    +{}  {\PrintPrimary}                {transition}
    +{,} { \textbf}                     {title} % was \textit
    +{.} { }                            {part}
    +{:} { \textit}                     {subtitle}
    +{,} { \PrintEdition}               {edition}
    +{}  { \PrintEditorsB}              {editor}
    +{,} { \PrintTranslatorsC}          {translator}
    +{,} { \PrintContributions}         {contribution}
    +{,} { }                            {series}
    +{,} { \voltext}                    {volume}
    +{,} { }                            {publisher}
    +{,} { }                            {organization}
    +{,} { }                            {address}
    +{,} { \PrintDateB}                 {date}
    +{,} { }                            {status}
    +{}  { \parenthesize}               {language}
    +{}  { \PrintTranslation}           {translation}
    +{;} { \PrintReprint}               {reprint}
    +{.} { }                            {note}
    +{.} {}                             {transition}
    +{}  {\SentenceSpace \PrintReviews} {review}
}


\begin{filecontents}{mwebib.bib}
 @article{A,
     AUTHOR = {Euler, Leonhard},
      TITLE = {Solutio problematis ad geometriam situs pertinentis},
 }
 @book{B,
     AUTHOR = {Euler, Leonhard},
      TITLE = {Elements of Algebra},
 } 
\end{filecontents}

\begin{document}
  Article \cite{A} and book \cite{B}.

  \bibliography{mwebib}
\end{document}

enter image description here

egreg
  • 1,121,712
  • I wish one could only change the {title} part... thanks! – Bach Mar 28 '16 at 17:13
  • @Bach Actually \patchcmd{\setbib@book}{\textit}{\textbf}{}{} (requires etoolbox and the usual \makeatletter\makeatother) would have worked, but this would be plunging in the implementation details and is not the best path. – egreg Mar 28 '16 at 17:20