13

Has anyone done a biblatex bibliography style that matches the stock acm.bst as far as formatting? I want biblatex's more sophisticated handling of things like URLs, but the journal I'm submitting to specifies ACM-style formatting.

13

With Alan Munn's cautionary note in mind, here's something that should get you started. First, an example of traditional BibTeX using acm.bst:

\documentclass{article}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Bli74,
  author = {Blinder, Alan S.},
  year = {1974},
  title = {The economics of brushing teeth},
  journal = {Journal of Political Economy},
  volume = {82},
  number = {4},
  pages = {887--891},
}
@book{Kot11,
  author = {Kottwitz, Stefan},
  year = {2011},
  title = {\LaTeX\ Beginner's Guide},
  address = {Birmingham},
  publisher = {Packt Publishing},
}
\end{filecontents}

\begin{document}

\nocite{*}

\bibliographystyle{acm}
\bibliography{\jobname}

\end{document}

enter image description here

And the same example using biblatex and its configuration possibilities. (Note the differences in the .bib file: journal is replaced with journaltitle, address is replaced with location.)

Some additional tweaks are specified here for multiple-author works, but more may be needed for other entry categories; see Guidelines for customizing biblatex styles for further advice.

\documentclass{article}

\usepackage[style=numeric,firstinits=true]{biblatex}% "style=numeric" is default

\DeclareNameAlias{default}{last-first}

\AtBeginBibliography{%
  \renewcommand*{\mkbibnamelast}[1]{\textsc{#1}}%
  %% commas between authors
  \renewcommand{\multinamedelim}{\addcomma\space}
  \renewcommand{\finalnamedelim}{\addcomma\addspace\textsc{and}\space}
}

\DefineBibliographyStrings{english}{%
 andothers = {\addcomma\addspace\textsc{et\addabbrvspace al}\adddot},
 and = {\textsc{and}}
}

\renewcommand*{\labelnamepunct}{\space\space}

\DeclareFieldFormat
  [article,inbook,incollection,inproceedings,patent,thesis,unpublished]
  {title}{#1}

\renewbibmacro{in:}{%
  \ifentrytype{article}{%
  }{%
    \printtext{\bibstring{in}\intitlepunct}%
  }%
}

\renewbibmacro*{volume+number+eid}{%
  \printfield{volume}%
  \setunit*{\addcomma\space}%
  \printfield{number}%
  \setunit{\addcomma\space}%
  \printfield{eid}}

\DeclareFieldFormat{pages}{#1}

\renewbibmacro*{publisher+location+date}{%
  \printlist{publisher}%
  \setunit*{\addcomma\space}%
  \printlist{location}%
  \setunit*{\addcomma\space}%
  \usebibmacro{date}%
  \newunit}

\usepackage{filecontents}

\begin{filecontents}{\jobname.bib}
@article{Bli74,
  author = {Blinder, Alan S.},
  year = {1974},
  title = {The economics of brushing teeth},
  journaltitle = {Journal of Political Economy},
  volume = {82},
  number = {4},
  pages = {887--891},
}
@book{Kot11,
  author = {Kottwitz, Stefan},
  year = {2011},
  title = {\LaTeX\ Beginner's Guide},
  location = {Birmingham},
  publisher = {Packt Publishing},
}
\end{filecontents}

\addbibresource{\jobname.bib}

\nocite{*}

\begin{document}

\printbibliography

\end{document}

enter image description here

  • I can probably figure out any glitches from here. Thanks. – zwol Dec 4 '11 at 18:16
  • lockstep, Zack, I've updated it with some code that takes care of multiple authors and et al. -- I'm not sure if anything else special is actually needed for other entry types. 'Twould be nice to have a more complete MWE for testing... – Joe Corneli Sep 10 '14 at 19:52
  • The \DefineBibliographyStrings affects the entire document, which means that and and et al. appear in small caps when using \textcite. Removing that set and placing \renewcommand{\andothersdelim}{\addcomma\addspace\sc} inside \AtBeginBibliography is a hackish way around that. – schester Nov 5 '15 at 11:58

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.