パッケージ animate が tcolorbox と競合する

パッケージ animate が tcolorbox と競合する
\PassOptionsToPackage{dvipsnames}{xcolor} 
\documentclass[dvipsnames]{article}
\usepackage[skins]{tcolorbox}
\usepackage{animate}

\providecommand{\actiontext}{Attention}
\newtcolorbox{achtungbox}[1][]{%
  enhanced,
  colframe=white,
  natural height,
  colback=black!10,
  coltitle=black,
  fonttitle=\bfseries\large,
  boxrule=0.3mm,arc=0mm,boxsep=0pt,left=2mm,width=\linewidth,
  leftrule=13mm,
  title={\small{\actiontext}},
  attach title to upper={\par\smallskip},
  underlay={
    \node[inner sep=0pt] (logo) at ([xshift=6mm,yshift=-6mm]frame.north west) {\ifpdf\includegraphics[width=10mm]{warning}\fi};
  },
  #1
}

\providecommand{\achtung}[1]{
\begin{achtungbox}
#1
\end{achtungbox}
}

\begin{document}

\animategraphics[trim=4.75cm 17cm 3.5cm 4.0cm, poster=last,autoplay=false,autoresume=true,autopause=true,loop=false,controls=true,scale=0.75]{8}{pdstestg-pics}{}{}
\achtung{AAA}
% \newpage
\animategraphics[trim=4.75cm 17cm 3.5cm 4.0cm, poster=last,autoplay=false,autoresume=true,autopause=true,loop=false,controls=true,scale=0.75]{8}{pdstestg-pics}{}{}

\achtung{I would expect the same figure in both animates at the start, but it does not. Sure, this is not the real case, but timeline options enables me to start animatens from different frames, this is currently impossible, seems to me. timeline option is not used here..., wanted to show a special animation at the intro of lectorenotes and later at the chapter.}

\end{document}

どうやら私は虫を狩るのがとても上手いようです...

アニメーションを開始する前に、同一の図形が表示されることを期待します。

ダウンロードwarning.pdfpdstestg-pics.pdfhttps://www.dropbox.com/sh/5y5rgralnw1pj8h/AABxTyDrCDUqo80ZtRF_rVTba?dl=0

答え1

グラフィック ファイルを含めると混乱が生じるように見えますanimateが、グラフィック ファイルをボックスに入れると、コンパイル全体が実行され、必要な機能が表示されます。

\PassOptionsToPackage{dvipsnames}{xcolor} 
\documentclass[dvipsnames]{article}
\usepackage[most]{tcolorbox}
\usepackage{animate}

\newsavebox{\mybox}
\savebox{\mybox}{\includegraphics[width=10mm]{warning}}

\providecommand{\actiontext}{Attention}
\newtcolorbox{achtungbox}[1][]{%
  enhanced,
  colframe=white,
  natural height,
  colback=black!10,
  coltitle=black,
  fonttitle=\bfseries\large,
  boxrule=0.3mm,arc=0mm,boxsep=0pt,left=2mm,width=\linewidth,
  leftrule=13mm,
  title={\small{\actiontext}},
  attach title to upper={\par\smallskip},
  underlay={
    \node[inner sep=0pt] (logo) at ([xshift=6mm,yshift=-6mm]frame.north west) {%
      \ifpdf
      \usebox{\mybox}%
      \fi
  };
  },
  #1
}

\providecommand{\achtung}[1]{
\begin{achtungbox}
#1
\end{achtungbox}
}

\begin{document}

\animategraphics[trim=4.75cm 17cm 3.5cm 4.0cm, poster=last,autoplay=false,autoresume=true,autopause=true,loop=false,controls=true,scale=0.75]{8}{pdstestg-pics}{}{}

\achtung{AAA}
% \newpage
\animategraphics[trim=4.75cm 17cm 3.5cm 4.0cm, poster=last,autoplay=false,autoresume=true,autopause=true,loop=false,controls=true,scale=0.75]{8}{pdstestg-pics}{}{}

\achtung{I would expect the same figure in both animates at the start, but it does not. Sure, this is not the real case, but timeline options enables me to start animatens from different frames, this is currently impossible, seems to me. timeline option is not used here..., wanted to show a special animation at the intro of lectorenotes and later at the chapter.}

\end{document}

ここに画像の説明を入力してください

答え2

上記のソリューションに基づいて、storebox を含めて使用できるようにこれを改良しました。

\PassOptionsToPackage{dvipsnames}{xcolor} 
\documentclass[dvipsnames]{article}
\usepackage[skins]{tcolorbox}
\usepackage{animate}

% \usepackage{storebox}
% \AtBeginDocument{{}} % see [2]

\providecommand{\newstorebox}[1]{\newsavebox{#1}} % <- fallback is no storebox is used
\providecommand{\storebox}[1]{\savebox{#1}}  % <- fallback is no storebox is used
\providecommand{\usestorebox}[1]{\usebox{#1}}  % <- fallback is no storebox is used

\newstorebox{\myboxgnA}     

\AfterEndPreamble{%
    \storebox{\myboxgnA}{\includegraphics[width=10mm]{warning}} 
} % see [1]


\providecommand{\actiontext}{Attention}
\newtcolorbox{achtungbox}[1][]{%
  enhanced,
  colframe=white,
  natural height,
  colback=black!10,
  coltitle=black,
  fonttitle=\bfseries\large,
  boxrule=0.3mm,arc=0mm,boxsep=0pt,left=2mm,width=\linewidth,
  leftrule=13mm,
  title={\small{\actiontext}},
  attach title to upper={\par\smallskip},
  underlay={
    \node[inner sep=0pt] (logo) at ([xshift=6mm,yshift=-6mm]frame.north west) {\ifpdf\usestorebox{\myboxgnA}\fi};
  },
  #1
}

\providecommand{\achtung}[1]{
\begin{achtungbox}
#1
\end{achtungbox}
}

\begin{document}

\animategraphics[trim=4.75cm 17cm 3.5cm 4.0cm, poster=last,autoplay=false,autoresume=true,autopause=true,loop=false,controls=true,scale=0.75]{8}{pdstestg-pics}{}{}
\achtung{AAA}
% \newpage
\animategraphics[trim=4.75cm 17cm 3.5cm 4.0cm, poster=last,autoplay=false,autoresume=true,autopause=true,loop=false,controls=true,scale=0.75]{8}{pdstestg-pics}{}{}

\achtung{I would expect the same figure in both animates at the start, but it does not. Sure, this is not the real case, but timeline options enables me to start animatens from different frames, this is currently impossible, seems to me. timeline option is not used here..., wanted to show a special animation at the intro of lectorenotes and later at the chapter.}

\end{document}

今は storebox を使用するかもしれませんが、必ずしもそうする必要はありません。

参照は次のとおりです:

[1]storebox は通常の savebox のように begin{document} の前では動作しません(egregに感謝)

[2]tikz と storebox の組み合わせの問題: 欠落した数値はゼロとして扱われます。animate では、ページはテキスト `graphicx` とともに出荷されます。(egregに感謝)

egreg がなければ、このソリューションを TeX.SE に提供することは不可能でした。

関連情報