1

I am writing a book that is comprised of a lot of problems. These are numbered within chapters of the book, and are currently formatted as theorem-like environments, each with a label. I would like to use something like the backref option of the hyperref package so that the bibliography entries each say "Cited in problem chapter.problem" (or "cited in problems chapter1.problem1,chapter2.problem2" as appropriate).

I can carry this out just fine, unless the problem has some internal structure, such as an enumerate environment or a sub-problem (also done as a theorem-like environment). In the example below, references [1] and [5] have the right behavior, but the others do not; the back references point to their position in the enumerate environment. Any help would be greatly appreciated!

\documentclass{book} \usepackage{amsthm} \usepackage[pagebackref=true,backref=section]{hyperref} \urlstyle{same} \renewcommand*{\backrefalt}[4]{% \ifcase #1 {Not cited.}% \or {Cited in Problem~#2.} % \else {Cited in Problems~#2.}% \fi} \hypersetup{colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan,} \newtheorem{prob}{Problem}[chapter] % basic unit \theoremstyle{definition} \newtheorem*{definition}{Definition} % not numbered \newtheorem*{remark}{Remarks} % not numbered \newtheorem{Nquestion}{Question} % numbered question %\newenvironment{numquestion}{\begin{Nquestion}}{\end{Nquestion}} \newenvironment{problem}{\setcounter{Nquestion}{0}\begin{prob}}{ \end{prob}} \begin{document} \begin{problem}[Slice genus] \label{torus} Smooth versus topological~ \cite{fellermccoy2016} \begin{enumerate} \renewcommand{\theenumi}{\Alph{enumi}} \item Problem about knots.~\cite{Fox:problems} \item Second problem about knots \end{enumerate} \begin{Nquestion}\label{fox-milnor} A question about knots~\cite{fox-milnor:concordance} \end{Nquestion} \begin{remark} \begin{enumerate} \item The first part of the question is raised as a conjecture in~\cite{greene-jabuka:pretzel}. \end{enumerate} \end{remark} The smooth slice genera of torus knots were determined by Kronheimer and Mrowka using gauge theory: $g_4(T(p,q)) = (p-1)(q-1)/2$ \cite{Kronheimer-Mrowka:Thom}. \end{problem} \begin{thebibliography}{1} \bibitem[1]{fellermccoy2016} Peter Feller and Duncan McCoy. \newblock On 2-bridge knots with differing smooth and topological slice genera. \bibitem[2]{Fox:problems} Ralph Fox. \newblock Some problems in knot theory. \bibitem[3]{fox-milnor:concordance} Ralph~H. Fox and John~W. Milnor. \newblock Singularities \bibitem[4]{greene-jabuka:pretzel} Joshua Greene and Stanislav Jabuka. \newblock The slice-ribbon conjecture for 3-stranded pretzel knots. \bibitem[5]{Kronheimer-Mrowka:Thom} P.~B. Kronheimer and T.~S. Mrowka. \newblock The genus of embedded surfaces in the projective plane. \end{thebibliography} \end{document} 

1 Answer 1

2
+100
\documentclass{book} \usepackage{amsthm} \usepackage[pagebackref=true,backref=section]{hyperref} \urlstyle{same} \renewcommand*{\backrefalt}[4]{% \ifcase #1 {Not cited.}% \or {Cited in Problem~#2.} % \else {Cited in Problems~#2.}% \fi} \hypersetup{colorlinks=true, linkcolor=blue, filecolor=magenta, urlcolor=cyan,} \newtheorem{prob}{Problem}[chapter] % basic unit \theoremstyle{definition} \newtheorem*{definition}{Definition} % not numbered \newtheorem*{remark}{Remarks} % not numbered \newtheorem{Nquestion}{Question} % numbered question \newenvironment{problem} {\setcounter{Nquestion}{0}\begin{prob}} {\end{prob}} \usepackage{etoolbox} \makeatletter \patchcmd{\Hy@backout}{{\thepage}{\@currentlabel}}{{\thepage}{\theprob}}{}{\fail} \makeatother \begin{document} \begin{problem}[Slice genus] \label{torus} Smooth versus topological~ \cite{fellermccoy2016} \begin{enumerate} \renewcommand{\theenumi}{\Alph{enumi}} \item Problem about knots.~\cite{Fox:problems} \item Second problem about knots \end{enumerate} \begin{Nquestion}\label{fox-milnor} A question about knots~\cite{fox-milnor:concordance} \end{Nquestion} \begin{remark} \begin{enumerate} \item The first part of the question is raised as a conjecture in~\cite{greene-jabuka:pretzel}. \end{enumerate} \end{remark} The smooth slice genera of torus knots were determined by Kronheimer and Mrowka using gauge theory: $g_4(T(p,q)) = (p-1)(q-1)/2$ \cite{Kronheimer-Mrowka:Thom}. \end{problem} \begin{thebibliography}{1} \bibitem[1]{fellermccoy2016} Peter Feller and Duncan McCoy. \newblock On 2-bridge knots with differing smooth and topological slice genera. \bibitem[2]{Fox:problems} Ralph Fox. \newblock Some problems in knot theory. \bibitem[3]{fox-milnor:concordance} Ralph~H. Fox and John~W. Milnor. \newblock Singularities \bibitem[4]{greene-jabuka:pretzel} Joshua Greene and Stanislav Jabuka. \newblock The slice-ribbon conjecture for 3-stranded pretzel knots. \bibitem[5]{Kronheimer-Mrowka:Thom} P.~B. Kronheimer and T.~S. Mrowka. \newblock The genus of embedded surfaces in the projective plane. \end{thebibliography} \end{document} 

screenshot of bib

1
  • Thanks--this worked great on small examples! I will try it on the full project and then accept your answer. Commented Apr 12 at 12:13

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.