Layered export for LaTeX
Hello,
welcome everybody. I am new to Inkscape and this list. :)
Let me explain my situation. I am an electrical engineer and currently working towards my PhD degree, for that reason I am using LaTeX very often. Since the very first moment I had a problem to find a proper application to create vector-based graphics in a convenient way. The special problem is that the labels in the graphics should use the LaTeX fonts and macros that I use in my paper.
The only application that supports this (up to my knowledge) is XFig. The vector based graphics itself are being exported as Postscript or PDF. An additonal LaTeX file containing the labels is generated that includes the PS/PDF graphics file. At compile-time, LaTeX puts the text above the PS/PDF graphics, just at the position where it should be. - That is just a great for me (and a lot of others I know)!
The problem with XFig is the following: - Usability (argh!) - Portability (at work I have Windows, I did not find a proper Version of XFig, JFig that did the same job as it does on my Mac)
Form what I have seen from Inkscape it has a very good usability and is platform-independent, a very good place to start from. :)
Since I have seen others requesting this "layered LaTeX export feature" on lists and forums, but I did not see that it was coded, I hereby volunteer to implement this feature. I hope to get some help from this list to implement this feature into Inkscape.
I only had a 2 minutes look at the sources, but my plans are roughly like that: - descent the document tree, find text items, write them to a LaTeX file, remove them form the tree - pass the graphics-only document tree to the standard PS/PDF export routines
Could it work out that way?
Greetings,
Jan
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
On Wed, 16 Aug 2006, Jan Gacnik wrote:
I only had a 2 minutes look at the sources, but my plans are roughly like that:
- descent the document tree, find text items, write
them to a LaTeX file, remove them form the tree
- pass the graphics-only document tree to the standard
PS/PDF export routines
This could work, but I'd suggest a different way to do it. If I were trying the same thing, I'd probably write an effect that was "Put Text nodes on top". Have it so that you can run that effect, and then do what ever you want with the document (export PDF, export to SVG, etc.)
Probably the easiest way to implement that effect is through scripting, but the trick is going to be handling the transformations of parent nodes. So, if the text nodes is in a group that has a transform on it, that transform needs to be applied when you move the text node out of that group. I'd probably solve that by just including the same grouping in your top layer.
--Ted
Hi,
at this point I have implemented a Python script that features basic text export into a LaTeX picture environment. I am also able to remove the text nodes form the tree for later EPS/PDF export.
To complete my prototype cycle, I would like to know: - Is there any way that I can trigger the standard Inkscape export modes (PS/PDF) from within my script? - Will I have access to the calculation results of the bounding box for the current image?
Regards,
Jan
--- Ted Gould <ted@...11...> wrote:
On Wed, 16 Aug 2006, Jan Gacnik wrote:
I only had a 2 minutes look at the sources, but my plans are roughly like that:
- descent the document tree, find text items,
write
them to a LaTeX file, remove them form the tree
- pass the graphics-only document tree to the
standard
PS/PDF export routines
This could work, but I'd suggest a different way to do it. If I were trying the same thing, I'd probably write an effect that was "Put Text nodes on top". Have it so that you can run that effect, and then do what ever you want with the document (export PDF, export to SVG, etc.)
Probably the easiest way to implement that effect is through scripting, but the trick is going to be handling the transformations of parent nodes. So, if the text nodes is in a group that has a transform on it, that transform needs to be applied when you move the text node out of that group. I'd probably solve that by just including the same grouping in your top layer.
--Ted
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
On Tue, 2006-08-29 at 01:13 -0700, Jan Gacnik wrote:
To complete my prototype cycle, I would like to know:
- Is there any way that I can trigger the standard Inkscape export modes (PS/PDF) from within my
script?
If you're using Inkscape scripting, no, the only interface is STDIN and STOUT. As the DOM support finishes up in Inkscape we plan on providing a more feature rich scripting environment where the script will execute in Inkscape, but that is not currently available. You can do that if you implement the extension as a C++ extension though.
- Will I have access to the calculation results of the bounding box for the current image?
That's not passed to the script, but you can call another instance of Inkscape with the command line parameters to calculate the bounding box of any SVG element. If you do "inkscape --help" you can get a list of all the command line parameters available.
--Ted
participants (2)
-
Jan Gacnik
-
Ted Gould