Hello Johan,
It is very nice to see this export option in Inkscape. Up till now I have been using svgfrags from the pydvi2svg package [1]. It processes all the <text> that appears in an SVG file according to some rules. I am using LyX to typeset LaTeX documents. LyX is able to display SVG files (I don't know whether internally by QT SVG support or externally with the aid of some converter) and has a nice feature called "File Handling", specifically "Converters". Whenever it encounters a non-native LaTeX file format, it looks for the converters defined for that type of file and then converts it to a native format. I have defined an "SVG to PS" converter and configured it to use Inkscape's --export- ps option. LyX also handles the "file changed" stuff. It keeps a cache of conversion results and updates it whenever the included file (image) changes. Basically my workflow was: 1. "$ some equation $" in Inkscape drawings. 2. Apply svgfrags.py to convert the equations by means of LaTeX->dvi->SVG conversions (relying on pydvi2svg). 3. Include the result into the LyX document. 4. Repeat step 2 everytime an image is changed.
I became quite used to this flow, but was considering writing another TeX Render extension using svgfrags, as it provided the possibility to massively convert LaTeX equations. This was something I need because I keep a library of basic figures (electronic components) which already have LaTeX text (equations), and it would be very tedious to convert manually every single LaTeX equation using the existing TeX render extension.
I tried to use your extension in LyX. Here are some difficulties I'm having:
- my LaTeX doesn't detect correctly whether or not "\svgwidth" is defined. It doesn't detect it as "@empty" when I don't define it. On the other hand testing it like this: "\ifx \svgwidth \undefined" works correctly. I don't really know much about LaTeX/TeX syntax/programming. Would it affect other users if you would use "\undefined" instead of "@empty" ? - my ps output differs from the pdf output. In my pdf output everything is ok, but in the ps output the text is shifted down. Is there something wrong with my LaTeX install (I use Ubuntu Jaunty packages) ? Or maybe for ps to work correctly I have to include some more packages? Actually this might also be related to the way LyX invokes LaTeX.... - is it right to undefine the "\svgwidth" variable (\global\ let \svgwidth @empty) ? I mean, if I set a global value (by putting at the beginning a "\def \svgwidth{...}", wouldn't it get reset after an "\input{some_file.tex}" (this is what happens to me - including twice the same drawing results in different sizes because "\svgwidth" is reset).
I added the necessary templates for LyX for using Inkscape's LaTeX export capability automatically. In the close future I could share in the wiki the necessary steps to configure LyX for this (or would it be better to do that on the LyX website?). Also, in LyX, you have the command "edit externally" for an image in the document, so it is quite comfortable to use, as it automatically invokes Inkscape (the sole unconvenience is that it loads quite slowly).
[1] http://wm.ite.pl/proj/pydvi2svg/index.html
Thank you, Arcadie Cracan
În data de Vineri 26 Februarie 2010 12:40:13 am J.B.C.Engelen@...1578... a scris:
Hello all,
For all who use LaTeX, please read the text below from the Release Notes 0.48. Or read http://wiki.inkscape.org/wiki/images/SVG_in_LaTeX.pdf . (the new feature will be available in development test builds from this evening on)
===New LaTeX export for PDF/EPS/PS===
Similar to GNUPlot's `epslatex' output terminal, Inkscape can now export graphics to PDF with an accompanying LaTeX file that overlays the text over the PDF when inputted in LaTeX. The image's text is typeset by LaTeX, so for example mathematical expressions are rendered correctly, and all text will be in the font and style of the LaTeX document (even when changing the document's font afterwards).
''(the following description assumes export to PDF, but will work the same for EPS and PS)'' Two files will be created: a PDF file containing all graphics, without text; and a LaTeX file with the same name, containing all text, and code to include the PDF and overlay the text. To include the exported image in LaTeX, one writes
\begin{figure} \centering \def\svgwidth{\columnwidth} % sets the image width, this is optional \input{image.tex} \end{figure}
A more thorough description of how to use the new feature (and automate the exporting/inclusion of the image in LaTeX) is given in this PDF: http://wiki.inkscape.org/wiki/images/SVG_in_LaTeX.pdf
====From the GUI==== When exporting to PDF/EPS/PS from Inkscape's GUI, the usual dialog pops up after selecting to which PDF/EPS/PS file to export to. In this dialog, you can find the PDF/EPS/PS+LaTeX option.
====Command line option==== When exporting to PDF/EPS/PS from the command line, adding --export-latex will turn the LaTeX export on. For example
inkscape image.svg -z -D --export-pdf=image.pdf --export-latex
Cheers! Johan Engelen
--- Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel