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.

We know the use of [draft] in graphicx package

\usepackage[draft]{graphicx}

Do we have any option like [draft] in tikz? Sothat we need not compile the tikz picture for every run and need not look at the picture...Is it possible to have something like this?

\usepackage[draft]{tikz}

or do i have any other method to do it?

share|improve this question
add comment

1 Answer

up vote 12 down vote accepted

You can use \tikzexternalize which is intended to speed up compile times. It converts each tikzpicture into a separate external graphic which is then imported with \includegraphics. And in [draft] mode graphics that are included from external sources do not get displayed.

Here is an example of enabling \tikzexternalize when in [draft] mode. With \documentclass[draft]{article} the MWE produces:

enter image description here

References:

Code:

\documentclass{article}
\usepackage{ifdraft}

\usepackage{tikz}
\ifoptionfinal{}{%
    \usetikzlibrary{external}\tikzexternalize
}

\begin{document}
\begin{tikzpicture}
    \draw[fill=yellow] (0,0) -- (3,0) -- (3,3) -- cycle;
\end{tikzpicture}
\end{document}
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.