2
  • I want to show an \Acrobatmenu item on every beamer slide.
  • The code below works in principle (I used the same code in an article document class, see Using ocgx2 instead of ocg-p: \AddToShipoutPictureBG not recognized).
  • But in beamer, the \Acrobatmenu item seems to be hidden behind the "left blue area", see the second screenshot.
  • Any ideas?

% Compile with pdftex (because of ocg-p).
\documentclass{beamer}
\usetheme{Berkeley}
\setbeamertemplate{navigation symbols}{}

\usepackage{fontawesome5}

\usepackage{tikz}
\usepackage{ocg-p}

%https://tex.stackexchange.com/questions/276532
\AddToShipoutPictureBG
{\begin{ocg}[printocg = never]{PDF Navigation Elements}{oc1}{1}
    \begin{tikzpicture}[remember picture, overlay]
    \node [anchor = west, font = \large, align = left] () at (current page.west){\Acrobatmenu{GoBack}{\faArrowAltCircleLeft}\\\Acrobatmenu{GoForward}{\faArrowAltCircleRight}};    
    \end{tikzpicture}   
 \end{ocg}%
 }

\begin{document}

\section{Section 1}    
\begin{frame}
\frametitle{\insertsection}
\textbackslash \texttt{Acrobatmenu\{GoBack\}\{\textbackslash faArrowAltCircleLeft\}}: \Acrobatmenu{GoBack}{\faArrowAltCircleLeft}
\end{frame} 

\section{Section 2}   
\begin{frame}
\frametitle{\insertsection}
\textbackslash \texttt{Acrobatmenu\{GoBack\}\{\textbackslash faArrowAltCircleLeft\}}: \Acrobatmenu{GoBack}{\faArrowAltCircleLeft}
\end{frame} 
    
\end{document}

enter image description here

enter image description here

3
  • 1
    the first thing that I would try is to change from background (BG) to foreground (FG) ... Feb 24, 2023 at 8:16
  • @UlrikeFischer I feel embarrassed. Will try this when I get to the office. Feb 24, 2023 at 14:21
  • @UlrikeFischer I provided below a "code of shame" (community) answer following your (of course) working advice :). If you want, then you can provide an answer and I will accept (and delete the community answer). Feb 24, 2023 at 19:22

1 Answer 1

1

Following Ulrike's ingenious comment, this is my "code of shame".

% Compile with pdftex (because of ocg-p).
\documentclass{beamer}
\usetheme{Berkeley}
\setbeamertemplate{navigation symbols}{}

\usepackage{fontawesome5}

\usepackage{tikz}
\usepackage{ocg-p}

% https://tex.stackexchange.com/questions/276532
\AddToShipoutPictureFG % <-- Changed to FG!
{\begin{ocg}[printocg = never]{PDF Navigation Elements}{oc1}{1}
    \begin{tikzpicture}[remember picture, overlay]
    \node [anchor = west, font = \large, align = left] () at (current page.west){\Acrobatmenu{GoBack}{\faArrowAltCircleLeft}\\\Acrobatmenu{GoForward}{\faArrowAltCircleRight}};    
    \end{tikzpicture}   
 \end{ocg}%
 }

\begin{document}

\section{Section 1}    
\begin{frame}
\frametitle{\insertsection}
\textbackslash \texttt{Acrobatmenu\{GoBack\}\{\textbackslash faArrowAltCircleLeft\}}: \Acrobatmenu{GoBack}{\faArrowAltCircleLeft}
\end{frame} 

\section{Section 2}   
\begin{frame}
\frametitle{\insertsection}
\textbackslash \texttt{Acrobatmenu\{GoBack\}\{\textbackslash faArrowAltCircleLeft\}}: \Acrobatmenu{GoBack}{\faArrowAltCircleLeft}
\end{frame} 
    
\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 .