Bo Peng wrote:

>> Bo, the 1.3.x external inset doesn't give you any eye candy but it
>> will enable you to do all that your require. The 1.4.x version will
>> give you the eye candy too.
> 
> I realized the 'virus' problem after I sent the email. But I was
> thinking something like 'manual activation' ... Anyway, security
> will be a hard-to-overcome problem.
> 
> I am curious about how external inset can handle 'all that I
> require'. For example, there is a program called csv2latex which can
> turn a csv formated table into latex code. How exactly can I insert
> a csv2latex generated (dynamic) table with external inset?

Look at file lib/external_templates. This file contains definitions of 
all templates that are shipped with LyX.

Off the top of my head, a minimal CSV template for LyX 1.3.x would 
look like:

Template CSVTable
        GuiName "[CVS formatted table]"
        HelpText
                Generate a latex table from a CSV one and 
                \include it in the LyX file.
        HelpTextEnd
        FileFilter "*.csv"
        AutomaticProduction true
        Format LaTeX
                Product "\\include{$$Basename.tex}"
                UpdateCommand "csvlatex $$FName > $$Basename.tex"
                UpdateResult "$$Basename.tex"
        FormatEnd
TemplateEnd

The point is we only distribute templates that we TRUST. You could 
write your own template that executed "rm -rf ${HOME}/*" in the 
UpdateCommand line, but this template would not become part of the 
official external_templates file so no unlucky person out there would 
suffer if they opened your evil lyx file with its bogus CSVTable 
external inset.

Interestingly, the LyX 1.4.x series uses the converter mechanism to 
convert files. Ie, the "Update Command" line no longer exists in the 
template file so the templates themselves are now perfectly safe. Ie, 
it is perfectly reasonable to modify the lyx document format to 
include any 'user-specified' templates.

Angus


-- 
Angus

Reply via email to