On 02/01/2010 05:42 PM, Tommaso Cucinotta wrote:
rgheck wrote:
One question: isn't it possible to handle this case like the other external-material objects ?

I mean, imagine you define another kind of external-material object, the "External Equation" type (e.g., a '*.eq' file), imagine you associate a text editor to such a type, and imagine you define a set of filters which just invoke externally LaTeX for computing the .eps of the file for both preview and print purposes. This way, for example, clicking on the image of the equation, would pop-up the external text editor on the .eq file, and after exiting it would be updated on the screen.
Wouldn't you achieve exactly what this user is looking for ?
In fact, the attached patch achieves such behaviour easily. If you have a ".eq" file with a contents such as:

 \begin{equation}
   U = \frac{C}{T}
 \end{equation}

then you can do Insert->File->External Material->[Equation (LaTeX)], then select your .eq file. Now, if you have "Instant Preview" enabled in preferences, you can see the formatted equation on the screen. Furthermore, right-click on it and select "External Editor" and you can edit it with emacs. The difference w.r.t. an ERT block is that you can see the formatted result on the screen (but editing through an external editor is not as comfortable as a collapsable inset).

Was kind of a learning excercise -- just in case anyone finds such patch useful (btw, I find the built-in LyX WYSIWYG/M equation editor extraordinary).

I think you should post this to devel and commit it. In the case of very complex equations, which would basically be nothing but ERT, it could be very useful. LyX can handle it, of course, but perhaps not with the kinds of comments and so forth one might want. I'm sure there are some people in this sort of predicament.

I hate to be greedy here, but does this handle math macros defined earlier in the document? That would be a good addition, if not. And it would, as it happens, allow me to use exactly this script for exporting little math images during XHTML output (if someone wanted a given equation to be output that way).

Richard

Reply via email to