5

I have an example:

\documentclass{ctexart}

\usepackage{tikz}

\usepackage[
    autoplay,
    autopause,
    nomouse,
    loop
]{animate}

\begin{document}

The first animation.

\begin{animateinline}[
        begin={
                \begin{tikzpicture}[black, scale = 1,line width = 1pt]
                    \useasboundingbox[draw, line width = 0] (0, 0) rectangle(4, 4);
                       },
                    end={\end{tikzpicture}}
    ]{4}
    \newframe \draw[->](0,0)--(1,1);
    \newframe \draw[->](0,0)--(2,2);
    \newframe \draw[->](0,0)--(3,3);
    \newframe \draw[->](0,0)--(4,4);
\end{animateinline}

\end{document}

enter image description here

I know the purpose of \useasboundingbox[draw, line width = 0] (0, 0) rectangle(4, 4); is equivalent to defining the size of the canvas.

I want it to be borderless. I tried to set line width = 0but that didn't have the desired effect.

How can I remove its border.

3
  • 3
    draw=none in useasboundingbox, or just \useasboundingbox (0, 0) rectangle(4, 4);
    – Ignasi
    Apr 5, 2022 at 10:36
  • 1
    And even this will work too \useasboundingbox[line width = 3] (0, 0) rectangle(4, 4);
    – kabenyuk
    Apr 5, 2022 at 11:11
  • @kabenyuk But for which purpose should option line width = 3 be added?
    – AlexG
    Apr 5, 2022 at 11:31

1 Answer 1

1

Following the previous question: How to use tikz and animate to animate in article document class?, and applying the comments to a MWE, we have:

\documentclass{ctexart}

\usepackage{tikz}

\usepackage[
autoplay,
autopause,
nomouse,
loop
]{animate}

\begin{document}
The first animation.

\begin{animateinline}[
  begin={
    \begin{tikzpicture}[black, scale = 1, draw=none]
      \useasboundingbox (0, 0) rectangle(4, 4);
    },
    end={\end{tikzpicture}}
  ]{4}
  \newframe \draw[->](0,0)--(1,1);
  \newframe \draw[->](0,0)--(2,2);
  \newframe \draw[->](0,0)--(3,3);
  \newframe \draw[->](0,0)--(4,4);
\end{animateinline}
\end{document}

which produces:

enter image description here.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .