I was wondering, is there a way that it could be possible to generate 
box scripts. What I mean by this is, say there was a small feature that 
I wanted to add, and it consisted of some latex code with arguments 
passed to it.  A good example would be this acronym feature.  The box 
script could look something like:

newlyxfunction insert_acronym
  no_argin = 1
  \begin{argnames}
   \arg{Acronym}{/home/pmdumuid/lyx/acronym.aclst}
  \end{argnames}

  \begin{latex}
   \ac{$inarg[1]}
  \end{latex}

  \boxdisplay $inarg[1]
  \noexpandbox

This may seem confusing at first, what I mean by box script is a script 
that is developed that sits behind a box, (box being those boxes used 
for citations, references, ert, margin, figures and tables)

These scripts would be loaded into function listing, then attached to 
key bindings as appropriately desired.

Say if I attached this to the key binding C-S-A then I would press 
Control, Shift and A.  It would then run ask me at the bottom for each 
argument specified in the "argnames" section of the script above, (i.e. 
Acronym ...)  If I pressed the tab key, it would look up the file
"/home/pmdumuid/lyx/acronym.aclst" and resolve a auto-completion.

After each argument, it would lyx could then store these variables as 
raw in the .lyx file.
When it came to generating the tex file, at every occurence, it would 
replace the expression with the latex code between the \begin{latex} and 
  \end{latex}

The text appearing in the box within the lyx viewing area could defined 
by the boxdisplay line (in this case it would simply display the first 
argument.

Control could also be made over weather the box would expand (as per 
margin notes etc..) and what it displayed in the expanded box.

But using such a technique, additional small features would be easier to 
add, and a greater number of users could develop scripts for all the 
various packages, and create a library if desired.


I have filed this as a bug report, but was advised to file it for lyx.devel:

http://bugzilla.lyx.org/show_bug.cgi?id=513
------- Additional Comments From [EMAIL PROTECTED]  2002-07-11 13:34 
-------
I'm not sure it's useful to have this on bugzilla until a more
concrete proposal has been threshed out.

i.e. can you send this to lyx-devel mailing list instead for discussion

thanks.





Reply via email to