Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have the following code:

\documentclass{beamer}

\usepackage{tikz}
\usetikzlibrary{calc}

\begin{document}

\begin{frame}
  \begin{tikzpicture}
    \fill[white] (1,1) circle (2pt);
    \foreach \n in {1,2,...,10}{
      \pgfmathsetmacro{\ang}{(10-\n)*90/10}
      \draw<\n>[thick,dashed,->] (1,0) node[below]{%
        Rotating by $90^\circ$%
      } arc (0:\ang:1);
    }
    \end{tikzpicture}
\end{frame}

\end{document}

Which yields a nice(?) animation of a growing arrow. Now, I want to generate one PDF file where each page contains one cropped slide - as if I was using standalone. Cropped means for me that it will contain only the result of the tikz environment, and nothing else (not even border or something like that).

I tried to use standalone with the multi=true but then it doesn't crop the page, and I don't know how to generate a loop there...

What is the best way to do it?

share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

E. g., by means of the preview package.

Instead of placing an invisible dot at the top edge you could use something like

%\fill[white] (1,1) circle (2pt);
\useasboundingbox (-0.25,-0.45) rectangle (2.2,1.05);

to fine-tune the picture bounding box.

\documentclass{article}

\usepackage[active,tightpage]{preview}
\usepackage{tikz}
\usetikzlibrary{calc}

\PreviewEnvironment{tikzpicture}

\begin{document}

\foreach \n in {1,2,...,10}{%
  \begin{tikzpicture}
    \fill[white] (1,1) circle (2pt);
    \pgfmathsetmacro{\ang}{(10-\n)*90/10}
    \draw[thick,dashed,->] (1,0) node[below]{%
      Rotating by $90^\circ$%
    } arc (0:\ang:1);
  \end{tikzpicture}%
}

\end{document}
share|improve this answer
add comment

The standalone class does understand the option tikz.

Code

\documentclass[tikz]{standalone}
\usetikzlibrary{calc}
\begin{document}
\foreach \n in {1,2,...,10}{
  \begin{tikzpicture}
    \fill[white] (1,1) circle (2pt);
      \pgfmathsetmacro{\ang}{(10-\n)*90/10}
      \draw [thick,dashed,->] (1,0) node[below]{%
        Rotating by $90^\circ$%
      } arc (0:\ang:1);
    \end{tikzpicture}
  }
\end{document}

Outputenter image description here

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.