![ocg-p + beamer:隐藏在导航栏后面的图层](https://linux22.com/image/461585/ocg-p%20%2B%20beamer%EF%BC%9A%E9%9A%90%E8%97%8F%E5%9C%A8%E5%AF%BC%E8%88%AA%E6%A0%8F%E5%90%8E%E9%9D%A2%E7%9A%84%E5%9B%BE%E5%B1%82.png)
- 我想
\Acrobatmenu
在每张beamer
幻灯片上显示一个项目。 - 下面的代码原则上是可行的(我在
article
文档类中使用了相同的代码,请参阅使用 ocgx2 而不是 ocg-p:\AddToShipoutPictureBG 无法识别)。 - 但
beamer
在\Acrobatmenu
项目似乎隐藏在“左侧蓝色区域”后面,看第二张截图。 - 有任何想法吗?
% 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}
答案1
根据 Ulrike 的巧妙评论,这是我的“耻辱准则”。
% 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}