[OS X TeX] SVG to LaTeX?

Alain Schremmer Schremmer.Alain at gmail.com
Thu Jul 20 06:52:40 CEST 2006


Ross Moore wrote:

> Yes, it is a viable solution if you use the following
> kind of LaTeX coding.

Indeed, and to sum it up:

In the preamble:

    \begin{filecontents*}{mypicture.svg}

        svg code for mypicture.svg as, for instance, obtained from
        creating, say, mypicture.intaglio, saving it as mypicture.svg
        and opening mypicture.svg with TeXShop, SubEthaEdit or textedit
        and copy-pasting the code.

    \end{filecontents*}

In the body of the document:

    \begin{figure}[H]% H to prevent the figure from floating
         \centering
    \immediate\write18{%
     /Applications/Inkscape.app/Contents/Resources/bin/inkscape -z -E  
    mypicture.eps mypicture.svg}
    \immediate\write18{epstopdf mypicture.eps}%  this creates mypicture.pdf
    \immediate\write18{rm mypicture.eps}%   this removes the
    intermediate .eps file  
            \includegraphics{mypicture.pdf}
    \end{figure}

This .tex file creates all that is needed once Inkscape is installed in 
Applications:

    - the output .pdf for those who just want to print the file,
    - mypicture.pdf for inclusion in the document,
    - mypicture.svg for those who want to edit mypicture but cannot edit
    svg code.

Once again, I must thank someone on this list, this time Moore, for a 
quasi infinite patience in dealing with my obtuseness.

Best regards
--schremmer

------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list