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.

  • So far I ended up adding \textbf{...} in the title part of the bib entry... – Bach Mar 28 '16 at 6:57
  • Can you add a minimal example of code to play with? – egreg Mar 28 '16 at 8:27
  • @egreg, please see my edit. – Bach Mar 28 '16 at 16:14
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

  • 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

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.