Hello.
First of all: Thanks to all developers. I enjoy using lyx nearly each day.

But I also like to draw pictures and plots with pgf/tikz as input-tex file to lyx which works fine, too.

My problem:
when I have a lot of complex pictures and a lot of  plots with thousands of data points, that makes compiling take extremely long time and sometimes don't work because pdflatex has not enough memory.

There is a very nice solution in the actual tikz package where we just put to preamble:
    \usetikzlibrary{external}
    \tikzexternalize
And compile with:    
    pdflatex -shell-escape $$i

This automatically starts a single compiler run for each tikzpicture and produces a pdf-file when there isn't already the corresponding pdf-file to the tikzpicture.
In the document the tikzpicture is automatically replaced with \includegraphics{the existing pdf-file} in compilation.
So if the plots or pictures need not to be updated this speeds up the compilation with about factor 100 for my case.

Lyx-solution:
As I read in http://www.lyx.org/announce/2_0_1.txt there is an interesting new option for read external files from ERT that could be used to get it working. But I wasn't lucky till now.  Could you please help a bit. I suppose a solution would make Lyx more attractive for others user, too.

Example file, compiled in Kile: with    
    pdflatex -interaction=nonstopmode -shell-escape '%source'
===========================
\documentclass{article}
\usepackage{tikz}

\usetikzlibrary{external}
%\tikzexternalize[prefix=./myfolder/]
\tikzexternalize

\begin{document}

A line, drawn with tikz:

%\tikzsetnextfilename{myfigname}
\begin{tikzpicture}
    \draw (0,0) -- (1,0);
\end{tikzpicture}

\end{document}
===========================
I tryed to use a ./ before the individual filename or folder command (myfolder must exist) to get it working in Lyx and also the Converter-Option: "pdflatex -shell-escape $$i" but that did not work.  Hope you have an idea where to look for the solution. Therefore you may have a look at

tex/latex/pgf/utilities/tikzexternal.sty
tex/latex/pgf/utilities//pgfexternalwithdepth.tex
and others.. don't know.
Documentation of the package can be found in http://mirror.its.uidaho.edu/pub/tex-archive/graphics/pgf/base/doc/generic/pgf/pgfmanual.pdf (Version 2.10) chapter 32 page 343


Best regards.
Tobias

Reply via email to