14

Is it possible to change the behaviour/settings of bibtex so that the title (of a book, article, paper, thesis, etc.) is always italic and everyhing else (e.g. author, journal, edition, etc.) is always upright?

Basically: enter image description here

Minimal working example:

Latex File:

\documentclass{article}
\begin{document}
I cite ~\cite{Bre89}.
\nocite{*}
\bibliography{Master}
\bibliographystyle{alpha}
\end{document}

Master.bib:

@book {Bre89,
    AUTHOR = {Bressoud, David M.},
     TITLE = {{Factorization and Primality Testing}},
    SERIES = {Undergraduate Texts in Mathematics},
 PUBLISHER = {Springer-Verlag},
   ADDRESS = {New York},
      YEAR = {1989},
}
@article {CEP83,
    AUTHOR = {Canfield, E. R. and Erd{\H{o}}s, Paul and Pomerance, Carl},
     TITLE = {On a problem of {O}ppenheim concerning ``factorisatio
              numerorum''},
   JOURNAL = {J. Number Theory},
  FJOURNAL = {Journal of Number Theory},
    VOLUME = {17},
      YEAR = {1983},
    NUMBER = {1},
     PAGES = {1--28},
}

My bib-file is actually much larger, so solutions that would involve me changing every single entry would not be ideal.

14

Make a copy of alpha.bst and call it myalpha.bst. In myalpha.bst, search for

FUNCTION {format.title}
{ title empty$
    { "" }
    { title "t" change.case$ }
  if$
}

and replace it with

FUNCTION {format.title}
{ title empty$
    { "" }
    { title emphasize "t" change.case$ }  
  if$
}

Note that addition of emphasize.

Now search for

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { journal emphasize "journal" output.check
      format.vol.num.pages output
      format.date "year" output.check
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

and replace with

FUNCTION {article}
{ output.bibitem
  format.authors "author" output.check
  new.block
  format.title "title" output.check
  new.block
  crossref missing$
    { journal "journal" output.check
      format.vol.num.pages output
      format.date "year" output.check
    }
    { format.article.crossref output.nonnull
      format.pages output
    }
  if$
  new.block
  note output
  fin.entry
}

Here, emphasize is removed from the line: journal emphasize "journal" output.check to prevent journal title from becoming emphasized.

Don't forget to use \bibliographystyle{myalpha}.

Code:

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{Master.bib}
@book {Bre89,
    AUTHOR = {Bressoud, David M.},
     TITLE = {{Factorization and Primality Testing}},
    SERIES = {Undergraduate Texts in Mathematics},
 PUBLISHER = {Springer-Verlag},
   ADDRESS = {New York},
      YEAR = {1989},
}
@article {CEP83,
    AUTHOR = {Canfield, E. R. and Erd{\H{o}}s, Paul and Pomerance, Carl},
     TITLE = {On a problem of {O}ppenheim concerning ``factorisatio
              numerorum''},
   JOURNAL = {J. Number Theory},
  FJOURNAL = {Journal of Number Theory},
    VOLUME = {17},
      YEAR = {1983},
    NUMBER = {1},
     PAGES = {1--28},
}
\end{filecontents*}
\begin{document}
I cite ~\cite{Bre89}.
\nocite{*}
\bibliography{Master}
\bibliographystyle{myalpha}
\end{document}

enter image description here

Follow the same strategy to add/remove emphasizing/removing emphasis as your wish.

  • Thanks, Harish. Your answer teaches something to me, too. +1 :-) – karlkoeller Jul 7 '13 at 5:17
  • one follow-up question: where do i safe this new myalpha.bst? in the same folder as my tex-file or in the original folder C:\Program Files\MiKTeX 2.9\bibtex\bst ? – Phil-ZXX Jul 7 '13 at 11:00
  • Ah, I left it in the original bibtex\bst folder and refreshed my Miktex settings: "Refresh FNDB" and "Update Formats". Now it works! – Phil-ZXX Jul 7 '13 at 11:04
  • @Tom That is a bad idea to put your personal things in miktex folder. That is why we have the concept of localtexmf. Please search this site for details and use it for this case also. Or if it only for once, put the bst file in the same folder as your tex file. – user11232 Jul 7 '13 at 12:55
  • @karlkoeller You made me to blush. I don't think I know as much as you do. Thanks for the kind words :) – user11232 Jul 7 '13 at 12:56
5

One solution, if you don't want to manually create a .bst file on your own, is to replace the alpha style with the corresponding one provided by the AMS: the amsalpha style.

So, just replace

\bibliographystyle{alpha}

with

\bibliographystyle{amsalpha}

and you should have what you want.

Note, however, that this style changes also other things in the formatting of the bibliography entries.

  • Mhm, amsalpha changes more things than i would like it to. But you mentioned .bst files. Could I just use the alpha.bst as a draft for my own bst-file so that titles will always be italic? – Phil-ZXX Jul 6 '13 at 15:27
  • I'm not skilled in creating .bst files, but the answer is yes, if you are. Otherwise, you can try to run tex makebst for creating your own bibliography style. – karlkoeller Jul 6 '13 at 15:53

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.