2

I'd like my back references in my bibliography to include some custom formatting.

My current code is:

\documentclass{article}
\usepackage[english]{babel}

\usepackage{natbib}
\usepackage[backref=page]{hyperref}

\usepackage{filecontents}
\begin{filecontents*}{jobname.bib}
  @book{joe,
    author = {Smith, Joe},
    year = {2017},
    title = {Automotive Safety Handbook},
  }
\end{filecontents*}


\begin{document}
  "Hello, my name is Joe!", said Joe \citep{joe}.
  \bibliographystyle{apalike}
  \bibliography{jobname}
\end{document}

which produces:

enter image description here

What I want instead is: "(see page 1)"or for multiple references for a single bibitem I want "(see pages 1, 2)".

I already found some proposed solutions on stackexchange but they only seem to be applicable for biblatex.

0

1 Answer 1

3

You can redefine the hook \backrefalt:

\documentclass{article}
\usepackage[english]{babel}

\usepackage{natbib}
\usepackage[backref=page]{hyperref}

\renewcommand\backreftwosep{, }
 \renewcommand\backrefsep{, }
 \renewcommand*{\backrefalt}[4]{%
    \ifcase #1%
     \or (see page:~#2)%
     \else (see pages:~#2)%
    \fi%
    }

\usepackage{filecontents}
\begin{filecontents*}{jobname.bib}
  @book{joe,
    author = {Smith, Joe},
    year = {2017},
    title = {Automotive Safety Handbook},
  }

    @book{alice,
    author = {Smith, alice},
    year = {2017},
    title = {Automotive Safety Handbook},
  }

\end{filecontents*}


\begin{document}
  "Hello, my name is Joe!", said Joe \citep{joe}.
  \citep{alice} \newpage \cite{alice}

  \bibliographystyle{apalike}
  \bibliography{jobname}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .