El paquete animar entra en conflicto con tcolorbox

El paquete animar entra en conflicto con 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}

Me parece que puedo cazar errores con mucho éxito...

Esperaría ver figuras idénticas antes de comenzar la animación.

Descargar warning.pdfy pdstestg-pics.pdfen https://www.dropbox.com/sh/5y5rgralnw1pj8h/AABxTyDrCDUqo80ZtRF_rVTba?dl=0

Respuesta1

La inclusión del archivo gráfico parece molesta animate; sin embargo, si el archivo gráfico se coloca en una caja, se ejecuta toda la compilación y se muestra la característica deseada.

\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}

ingrese la descripción de la imagen aquí

Respuesta2

Basado en la solución anterior, he mejorado esta para usarla, incluido 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}

Ahora puedes usar storebox ahora, pero no es necesario.

las referencias son:

[1]storebox no funciona antes de comenzar {document} como savebox normal(gracias a egreg)

[2]Problemas al combinar tikz y storebox: número faltante, tratado como cero. Con animación, la página se envía con el texto "graphicx",(gracias a egreg)

Sin egreg no sería posible proporcionar esta solución a TeX.SE.

información relacionada