[OS X TeX] SVG to LaTeX?

Alain Schremmer Schremmer.Alain at gmail.com
Wed Jun 28 16:52:55 EDT 2006


Ross Moore wrote:

> In the preamble:
>
>   \begin{filecontents*}{mypicture.svg}
>    ... SVG coding for a picture ...
>   \end{filecontents*}
>
> In the document body:
>
>  \begin{figure}
>  \centering
>   \immediate\write18{svg2pdf mypicture.svg  mypicture.pdf}%
>   \includegraphics{mypicture.pdf}
>   \caption{...}\label{...}
>  \end{figure}

I just did that but it didn't work. Specifically:

   1) I created a file TestForSVG.tex in a folder called TestFor SVG
   with my usual preamble and with just "TESTING" in the document body
   and typeset it.

   2) I drew a rectangle in Intaglio and saved it as mypicture.svg in
   the TestForSVG folder.

   3) In the preamble of TestForSVG.tex I inserted

       \begin{filecontents*}{mypicture.svg}
          ... SVG coding for a picture ...
       \end{filecontents*}

   4) I opened mypicture.svg with TeXShop which gave me the svg code:

    *Censored*

    5) I copy-pasted this code into TestForSVG.tex in place of

        ... SVG coding for a picture ...

    6) I renamed mypicture.svg as (my)picture.svg

    7) I tried to typeset but I got the error message

        ! Text line contains an invalid character.
        l.266 ^^fe^^ff^^@<^^@
                             ?^^@x^^@m^^@l^^@
        ^^@v^^@e^^@r^^@s^^@i^^@o^^@n^^@=^^@"^^...

        ?

    8) In the folder TestFor SVG, there are now the following files:

        (my)picture.svg      The (renamed) original file
        mypicture.svg         The file LaTeX just created
        TestForSVG.log
        TestForSVG.idx
        TestForSVG.tex  
        TestForSVG.pdf      The output of the original TestForSVG with
        just the text "TESTING"

    9) When TeXShop opens (my)picture.svg, the code is still there but
    when it opens mypicture.svg, the page is empty. This is corroborated
    by Intaglio.

    10) When I try to retypeset, this time I get the error message

        LaTeX Warning: File 'mypicture.svg' already exists on the
        system. Not generating from this source. (By the way, this part
        disappears as soon as I select it but not the following.)

        ! Text line contains an invalid character.
        l.266 ^^fe^^ff^^@<^^@
                             ?^^@x^^@m^^@l^^@
        ^^@v^^@e^^@r^^@s^^@i^^@o^^@n^^@=^^@"^^...

        ? ^^@v^^@e^^@r^^@s^^@i^^@o^^@n^^@=^^@"^^...

        ?

    11) I just sent the svg code to myself and only the same first two
    characters appeared.

What is going on?

I see the light at the end of the tunnel but I am afraid I need some 
serious help here.

Hopeful 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 MacOSX-TeX mailing list