On 21/06/2011 12:56 PM, David Thérincourt wrote:
Hi,

I try to write an external template to copy a text data file
(/home/david/Data.txt) from LyX document directory
(/home/david/document.lyx) to
temporary directory where LaTeX is use
(/tmp/lyx_tmpdir.MT2673/lyx_tmpbuf2).

I need it when i use PGFPlot in a command LaTeX box :

\addplot[ultra thick,red] table[x=time,y=V(ve)] {Data.txt};

So LyX don't now LaTeX need the file Data.txt when compiling in temp
directory : error, file Data.txt not present !

I must link (copy) the data file in temp directory.

I try to write this external template :

------------------------
Template Data
         GuiName "Data: $$Basename$$Extension"
         HelpText
                 Link data file.
         HelpTextEnd
         InputFormat text
         FileFilter "*.txt"
         AutomaticProduction true
         Format PDFLaTeX
                 UpdateFormat text
                 UpdateResult "$$Basename.txt"
                 ReferencedFile pdflatex "$$Basename.txt"
         FormatEnd
TemplateEnd
------------------------

Problem : the variable $$Basename work well in GuiName
($$Basename="Data") but not in UpdateResult
$$Basename="0_home_david_Data" !
This is a big problem because LaTeX need the same name.

Thanks for help.

David.



You should have the external template write the line
\addplot[ultra thick,red] table[x=time,y=V(ve)] {Data.txt};

for you. In particular, the "Data.txt" part should be replaced in the template by "$$Basename.txt", or something similar. See what I mean?

--
Julien

Reply via email to