
これは「あったらいいな」という質問だと思います。
私は、animate
一連のソフトウェア ダイアログ スクリーンショットを表示するためにこのパッケージを使用しています。このシリーズを完了する過程で、便利だが見苦しいコントロール パネルを追加しました (はい、さまざまな背景色を試しましたが、改善されませんでした)。スクリーンショットは、これらの通常の<BACK/NEXT>
ダイアログです。
NEXT>
これらの領域とスクリーンショットのボタン領域にアニメーション コマンド FORWARD/BACKWARD を追加して<BACK
、実際のソフトウェアと同様に、読者がスクリーンショットで「NEXT」をクリックして次の画像を表示し、「BACK」をクリックすると前のスクリーンショットが表示されるようにすることは可能ですか?
わかりやすく表現できればと思います...
答え1
これは、 の JavaScript APIanimate
と\mediabutton
のコマンドを使用する良い例ですmedia9
。
ユーザーCaramdirの優れたオンイメージパッケージは、アニメーション上にボタンを配置するために使用されます。ただし、onimage.sty
を使用しないようにパッチを適用する必要があります\includegraphics
。
以下のコードをコンパイルするには、パッケージからサンプル画像ファイルをmwe
現在のディレクトリにコピーします。
$TEXMF/tex/latex/mwe/example-image-a.png を ./example-image-1.png にコピーします。 $TEXMF/tex/latex/mwe/example-image-b.png ./example-image-2.png を参照 $TEXMF/tex/latex/mwe/example-image-c.png ./example-image-3.png を参照
番号付きの画像が必要なためです\animategraphics
。
\documentclass{beamer}
\usepackage{animate}
\usepackage{media9} % buttons via \mediabutton
%get it from http://bazaar.launchpad.net/~tex-sx/tex-sx/development/view/head:/onimage.dtx
\usepackage{onimage}
%patch onimage.sty not to use \includegraphics
\makeatletter
\def\tikzonimage@opt[#1]#2{%
\begin{tikzpicture}
%\node[inner sep=0] (image) {\includegraphics[#1]{#2}};
\node[inner sep=0] (image) {#2};
\begin{tikzonnode}{image}%
}
\makeatother
\begin{document}
\begin{frame}
\begin{tikzonimage}{%
\animategraphics[method=ocg,label=myGUI,step,nomouse,width=0.8\linewidth]{1}{example-image-}{1}{3}
}[tsx/show help lines]
\node at (0.8 , 0.8) [anchor=south east, inner sep=0pt, outer sep=0pt] {
\mediabutton[
jsaction={try{anim.myGUI.frameNum--}catch(e){}}
]{\fbox{\small\strut back}}};
\node at (0.8 , 0.8) [anchor=south west, inner sep=0pt, outer sep=0pt] {
\mediabutton[
jsaction={try{anim.myGUI.frameNum++}catch(e){}}
]{\fbox{\small\strut next}}};
\end{tikzonimage}
\end{frame}
\end{document}