1

I have a rather complicated LaTeX document with many figures, tables and citation links provided courtesy of \hyperref.

I would like to provide a "back" button from these document items using the Adobe Acrobat option of \hyperref. For example: \Acrobatmenu{GoBack}{$\blacktriangle$}. (I know that simply typing command-up arrow does the same thing, but I would like to provide the reader with a convenient signpost.)

My problem is that I cannot find a (simple way to) place the \Acrobatmenu button in-line at the beginning of the figure legends, references and tables in the final PDF document. No matter where I place the code, the button ends up in the center of the page on a new line.

Is there anyway to accomplish my goal?

mwe:


\documentclass[12pt]{amsart}
\usepackage{geometry} % see geometry.pdf on how to lay out the page. There's lots.
\geometry{a4paper} % or letter or a5paper or ... etc

\usepackage{graphicx}
\usepackage{mathtools} 
\usepackage{amssymb} 

\usepackage{hyperref} % use command left arrow to return to exact reference in Adobe Reader
\hypersetup{
     colorlinks=true,
    %hidelinks=true, 
    linkcolor=blue,
    citecolor=blue,
    filecolor=magenta,      
    urlcolor=blue,
}


\usepackage[all]{hypcap}

%%% BEGIN DOCUMENT
\begin{document}

\begin{figure}[htb!]
\includegraphics[width = 0.85\textwidth]{Cat.png}
\caption{
\textbf{The cat sat on the mat.} What a wonderful cat.
}
\label{fig:Cat}
\Acrobatmenu{GoBack}{$\blacktriangle$}
\end{figure}



\end{document}

Result of cat is shown below. I would like the red triangle, which triggers an Acrobat GoBack command, to be situated immediately to the left of, and on the same line as, "FIGURE 1."

Here is a cat. I would like the red triangle, which triggers an Acrobat GoBack command, to be situated immediately to the left of "FIGURE 1."

Bob
  • 263

1 Answers1

3

You could edit the figurename macro that contains the text Figure. For tables, it works similarly. I don’t know what you mean with “citations” though …

\documentclass[12pt]{amsart}

\usepackage{graphicx}
\usepackage{amssymb} 

\renewcommand{\figurename}{\Acrobatmenu{GoBack}{$\blacktriangle$} Figure}
\renewcommand{\tablename}{\Acrobatmenu{GoBack}{$\blacktriangle$} Table}

\usepackage{hyperref} 
\hypersetup{
    colorlinks=true,
    % hidelinks=true, 
    linkcolor=blue,
    citecolor=blue,
    filecolor=magenta,      
    urlcolor=blue,
}

\begin{document}

\begin{figure}
\includegraphics[width = 0.5\textwidth]{example-image-a}
\caption{
 \textbf{The cat sat on the mat.} What a wonderful cat.
}
\label{fig:Cat}
\end{figure}

\begin{table}
\begin{tabular}{ r r r }
\hline 
one & two & three \\
\hline
\end{tabular}
\caption{
 \textbf{The cat sat on the table.} What a wonderful cat.
}
\label{tab:Cat}
\end{table}

\end{document}

enter image description here

  • Wonderful, thanks so much @JasperHabicht! Yes, the citations question was unclear. Here is an example in an answer using biblatex, with GoBack button at end of reference: https://tex.stackexchange.com/questions/237485/how-to-go-back-to-body-after-visiting-a-reference -- if it were possible to do the same with bibtex and as an extra ask put the button at either the beginning or end of the reference, it would be so groovy. – Bob Oct 19 '19 at 09:14
  • OK. Can’t you just use the code over there for citations? You should be fine with \renewbibmacro*{pageref}{ \printtext{ \Acrobatmenu{GoBack}{$\blacktriangle$} } } or something similar. – Jasper Habicht Oct 19 '19 at 09:18
  • Thanks again, @JasperHabicht. Unfortunately that answer uses biblatex. I need to use bibtex, so am not sure if the same incantation will hold? – Bob Oct 19 '19 at 09:32
  • It really depends on the setting and on the style you use. Could you perhaps post your set up? It is important to know this and also where exactly you want the go-back button to appear. In the footnotes or only in the bibliography at the end? – Jasper Habicht Oct 19 '19 at 09:56
  • 1
    Thanks @JasperHabicht! I would like the go-back button to appear at the end of every reference at the bibliography at the end. Perhaps I should make this a separate question, because it is getting complicated. And also my eyelids are drooping... Thanks again! – Bob Oct 19 '19 at 10:12