On 8/14/06, Angus Leeming <[EMAIL PROTECTED]> wrote:
Michael <[EMAIL PROTECTED]> writes: > As a broader question, is there a way to utilize the Latex Instant Preview > feature from outside of the LyX? Hi, Michael. Would it be fair to summarize your requirements as: * Type an equation in LaTeX syntax * Hit return to send it over the wire to your colleague * Have the just received LaTeX snippet converted into a .png file on your colleague's machine for display as an image if conversion was successful, otherwise as your LaTeX text snippet. ? > I am wondering if I can copy the images from the instant equation preview > buffer to OneNote in realtime automatically and programatically. I dunno anything about OneNote, but if you can flag some text received by your colleague with "please try and pass this through the latex.exe compiler and dvipng.exe to generate .png files", then the whole process sounds achievable. Your colleague's machine would need to: 1. Wrap your LaTeX snippet inside more text to make a complete LaTeX document that can be processed by latex.exe. See src/graphics/PreviewLoader.C: 491 of << "\\batchmode\n"; 492 dumpPreamble(of); 493 of << "\n\\begin{document}\n"; 494 dumpData(of, inprogress.snippets); 495 of << "\n\\end{document}\n"; 496 of.close(); 2. Send this complete LaTeX document to a script, something like lib/scripts/lyxpreview2bitmap.py 3. Wait for this script to complete and load the image file into OneNote. Regards, Angus
Angus, Very nice, thanks a lot for the information! I still have questions: 1. How to send this complete Latex document to a script? 2. Does this generated preview image have a reasonably good width and height, I am guessing that as a compiled document, it might have a large white margin? Or it is precisely a snippet of an equation? 3. The LyX's inset math box (the half-WYSIWYG one before the instant preview) is still very good interface, is there a way to single it out? The workflow can be: in OneNote, I place the cursor at a certain point, then hit a button, then a LyX embedded window gets launched so I can use the inset math box to write equations, and the content of the inset math box will be compiled in real time as you've described, and then the image will be copied and pasted into the current drawing region in OneNote. The underlying communication will be done by OneNote, since it is an excellent collaboration tool; it always allows hand-drawing and scribbling... which is great for brain-storming... any more thoughts? Thanks a lot!