1

Dears, sorry for the format. I am typing this on my phone as my laptop battery ran out. I am trying to add a custom sentence to my ‘references’ section in my ACM paper.

In my main.tex I have included:

\bibliographystyle{ACM-Reference-Format}
\bibliography{references}

And in my references.bib I have all my bibtex references. Then obviously, as I am citing certain articles, at the end of my paper a reference section is generated.

How can I add a custom text to the reference section on the first line? Currently, I have that custom line above the references section as you can see in the image attached. The custom text I want to get in there is: “All the references were accessed in the months September and October 2019.”

This is what it currently looks like:

1

Taking heavy inspiration from this answer one could patch the bibliography environment as follows.

\documentclass{acmart}

\usepackage{etoolbox}

\patchcmd{\thebibliography}{\list}{\printbibprolog\list}{}{}
\newcommand{\bibprolog}[1]{%
  \def\printbibprolog{%
#1
}%
}
\def\printbibprolog{} % initialize

\begin{filecontents}{references.bib}
@article{hmm,
  authour      = {Bonde, Tonny},
  title        = {How to Hmm Properly},
  journal      = {Serious Scientific Journal},
  year         = {1920},
}
\end{filecontents}

\begin{document}
Yo\cite{hmm}

\bibprolog{All the references were accessed in the months September and October 2019.}


\bibliographystyle{ACM-Reference-Format}
\bibliography{references}
\end{document}

The referenced answer also contains other solutions if you use natbib or the memoir document class. Additionally if you switch to biblatex you could use the \bibsetup command. enter image description here

1

For reference, with biblatex, which is highly customizable, the prenote= option of the \printbibliography command does exactly this. The note needs to be defined with \defbibnote. postnote= is also available.

Example of use:

MWE:

\documentclass{article}
\usepackage[style=numeric,
        ]{biblatex}
\addbibresource{biblatex-examples.bib}

\defbibnote{myprenote}{This is a \textit{pre}-note. It comes before the bibliography.}

\defbibnote{mypostnote}{And this is a postnote.}


\begin{document}
Text\cite{aksin}
\cite{angenendt}
\cite{baez/article}

\printbibliography[
    prenote=myprenote,
    postnote=mypostnote,
    title=A list of my references,
    ]

\end{document}

biblatex

Not an answer, because, ironically, the ACM uses natbib/bibtex (per the manual, section 2.11, p23), not biblatex/biber. Doing otherwise "may delay the processing of the manuscript".

0

You could start your own references section, add your custom text, and then locally redefine \section (as per https://tex.stackexchange.com/a/22654/199342) so that the bibliography doesn't start a new section.

\documentclass{acmart}

\usepackage{filecontents}
\begin{filecontents}{references.bib}
@BOOK{DUMMY,
AUTHOR="John Doe",
TITLE="The Book Title",
PUBLISHER="Dummy Publisher",
YEAR="2019",
}
\end{filecontents}

\begin{document}
\cite{DUMMY}

\section*{\refname}
All the references were accessed in the months September and October 2019.
\begingroup
\renewcommand{\section}[2]{}%
\bibliographystyle{ACM-Reference-Format}
\bibliography{references}
\endgroup
\end{document}

output

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.