Hello, Everyone,

The following idea came to me when I was (painfully) updating a table 
in my lyx document with some updated data. I think it has the potential 
to be a good feature of lyx.

executable inset:
1. an executable inset is an inset that contains a piece of shell script.
   It can be, for example, a perl script by way of #!/bin/perl. 
2. the output of the script will be treated as the content of an ERT. 
   Lyx can optionally ignore the output.
3. the script will be executed when lyx is exported to latex, i.e, before
   compilation. 
   
Potential usages:
I can think of the following scenarios in which executable insets are 
useful:
1. instead of inserting the source code, inserting 'cat file'.
   I do not have to update the lyx document when the source code 
   changes. (I am aware of the listing package.)
2. I have a dataset that need to be inserted into lyx as a table. 
   It is easier to turn the dataset into latex table using some script 
   than insert->table and copy, paste. Of course I do not have to 
   re-copy the data when the dataset changes.
3. I need to grab something (latest source code, bib files, pictures generated
   from another machine or put in another directory) automatically from 
   web, cvs repository, another machine etc. The output of such scripts 
   should be ignored.
4. insert dynamic content such as 'date', 'echo $hostname'. M$ Word has 
   a long list of such things but scripts can do much more.

Implementation?
I am not quite familiar with lyx source tree but I guess executable
insets can be inherited from ERT. 

What do you think of this idea?


-- 
Bo Peng

Reply via email to