[Tex/LaTex] Bibtex – Make Title italic, Rest Upright

bibtexitalic

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.

Best Answer

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.