# [cairo] Inkscape eps export for Latex

Jose Aliste jose.aliste at gmail.com
Tue Sep 1 13:23:09 PDT 2009

Hi All,

>>> This could be fixed if Inkscape also embedded the LaTex equation in the
>>> SVG file and automatically rerendered it when the font is changed. I'm
>>> not an SVG expert but reading the SVG 1.1 specification there is a
>>> "Foreign namespaces and private data" feature that can be used for
>>> "Application-specific information so that authoring applications can
>>> include model-level data in the SVG content to serve their
>>> "roundtripping" purposes".
>>
>> I think I agree with Bernd that such solutions break the batch-processing
>> nature of TeX systems and are suboptimal. ?If you want to change the formula
>> in the drawing, instead of typing in vim and running make, you now need to
>> open Inkscape, change something, export to EPS, run make.

I would like to recall (sorry if you are already of the functionaly I
am going to describe and there is some missing point)
that there is an OLD and GOODIE app called XFIG to do vector graphics.
It has the following functionality. When you add a text in it, you can
mark it "special" and when you export your figure you can use
PDF+Latex or PS+Latex. When you use these options, two files are
generated: a graphics file (either PS or PDF according to your choice)
and a text file with some LaTeX code in it. Then the only thing you
have to do in your latex is:

\input{thetextfile}

How it works? Xfig takes all the texts with the special flag,
calculate its coordinates and then writes the textfile with some LaTex
code containing the includegraphics and the texts with some commands
to place them in the right coordinates  (extract at the end)
This solution work Ok for me and the worflow, if you want to edit only
the formulas, or correct its positions, or fontsizes,  you only edit
the textfile and then rerun LaTex, so it s good for batch processing.

So this is the solution that works best for me, the good thing is that
you only need to modify inskcape, not cairo since the text that will
be processed by LaTex is in the textfile, not in the graphicsfile!!!!!
Unhappily, up to my knolewdge, this can't be done with the inkscape
plugin API and should be coded in core inskcape.

>> Another option, one I like to see instead, is a solution similar to TeX's
>> \special. ?That is, have a way in cairo PS backend to inject arbitrary
>> Postscript code. ?The Inkscape can have a kind of external object
>> placeholder that it would inject into cairo's output, and psfrag changed to
>> understand that. ?Similar features for PDF is also desired, but should be
>> flexible enough to allow PDF forms, etc, for example.
>

Although the ala Xfig solution I pointed above does not need this, it
certainly can have a lot of other applications.

>
>>> 2) Changes to cairo subsetting
>>>
>>> One of the items on my TODO list is to look into providing the option to
>>> allow embedding non-subsetted fonts in PDF. This is so the PDF output
>>> can be roundtripped though applications that modify the PDF file.
>>

---extract of code---
\begin{picture}(0,0)%
\includegraphics{graphicsfile.pdf}%
\end{picture}%
\begin{picture}(13379,2346)(2011,-8476)
\put(10576,-6361){\makebox(0,0)[lb]{\smash{{\SetFigFontNFSS{8}{9.6}{\rmdefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}$\t_V(Fib-\s)$}%
}}}}
\put(7426,-6361){\makebox(0,0)[lb]{\smash{{\SetFigFontNFSS{8}{9.6}{\rmdefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}$\s=\t_V(Fib)$}%
}}}}
\put(2026,-7186){\makebox(0,0)[lb]{\smash{{\SetFigFontNFSS{8}{9.6}{\rmdefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}$Fib$}%
}}}}
\put(2026,-8311){\makebox(0,0)[lb]{\smash{{\SetFigFontNFSS{8}{9.6}{\rmdefault}{\mddefault}{\updefault}{\color[rgb]{0,0,0}$\sigma_V(Fib)$}%
}}}}
\end{picture}%

Grettings,

José