Now I have a solution that works :
preamble:
\usepackage{tikz}
\usepackage{pgfplots}
ERT:
\begin{tikzpicture}
\begin{axis}[]
\addplot[]
External Input to have file{datadir/myfile.csv};
ERT:
\end{axis}
\end{tikzpicture}
with external_templates:
Template file(PgfPlots)
GuiName "file{$$FName}"
HelpText
file input to use for pgfplots
HelpTextEnd
InputFormat tex
FileFilter "*.csv"
AutomaticProduction true
Format PDFLaTeX
Product "file{$$FPath$$Basename.csv};"
UpdateFormat latex
UpdateResult "$$FPath$$Basename.csv"
FormatEnd
TemplateEnd
My question is still:
why: InputFormat tex
why: UpdateFormat latex
Does anyone can help me please?
Am 09.01.2011 21:08, schrieb [email protected]:
> Dir Lyx-users and developers,
>
> I get always errors, please help me.
> I want to use the EXTERNAL TEMPLATE function.
> I just want to copy a text file to lyx temp dir, so that I can use that
> file containing data to plot a function with pgfplots. there is no need
> to convert anything, just copy.
>
> In the document, I want to have the code:
> file{myfile.txt};
> maybe a relative path from the lyx file like this:
> file{textfiles\myfile.txt};
>
> I have tryed this:
>
>
> Template file(PgfPlots)
> GuiName "file{myFName}"
> HelpText
> file input for pgfplots
> HelpTextEnd
> InputFormat txt
> FileFilter "*.txt"
> AutomaticProduction true
> Format PDFLaTeX
> Product "file{$$Basename.txt};"
> UpdateFormat pdf
> UpdateResult "$$Basename.txt"
> Requirement "pgfplots"
> FormatEnd
> TemplateEnd
>
>
> In the Lyx document I then have this
>
> ERT:
> \begin{tikzpicture}
> \begin{axis}[
> \addplot
> file{myfile.txt}; %Here I then use the external template input
> ERT:
> \end{axis}
> \end{tikzpicture}
>
>
> my problem is... I do not understand the documentation, so would you
> please help me?
> another question.. is there a difference between the lyx versions from
> 1.6 to 2.0?
> I'm using windows at the moment.
> and I'm bad english speaking german user :-)
> Thanks for any help!
>