Conflitos de animação de pacotes com tcolorbox

Conflitos de animação de pacotes com 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}

Parece-me que sou capaz de caçar insetos com muito sucesso...

Eu esperaria ver figuras idênticas antes de iniciar a animação.

Baixe warning.pdfe pdstestg-pics.pdfem https://www.dropbox.com/sh/5y5rgralnw1pj8h/AABxTyDrCDUqo80ZtRF_rVTba?dl=0

Responder1

A inclusão do arquivo gráfico parece perturbar animate- porém, se o arquivo gráfico for colocado em uma caixa, toda a compilação é executada e o recurso desejado é mostrado.

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

insira a descrição da imagem aqui

Responder2

Com base na solução acima, melhorei esta para ser usada incluindo 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}

Agora você pode usar o storebox, mas não é necessário.

referências são:

[1]storebox não funciona antes de começar {document} como savebox normal(graças a egreg)

[2]Problemas ao combinar tikz e storebox: Número ausente, tratado como zero. Com animação, a página é enviada com o texto `graphicx`,(graças a egreg)

Sem egreg não seria possível fornecer esta solução ao TeX.SE.

informação relacionada