[OS X TeX] SVG to LaTeX?

Alain Schremmer Schremmer.Alain at gmail.com
Sun Jun 25 23:09:27 EDT 2006

Joanna Rycko wrote:

> Hello,
> On 2006-06-23, at 20:45, Alain Schremmer wrote:
>> So, my question, triggered by the  threads  "Should I install X11"  
>> and "making pictures", is whether there is a way automatically to  
>> convert SVG graphics into code that could then be inserted into the  
>> LaTeX source which would then result in a single source file that  
>> you would then be able both to print and edit.
> Maybe it is not the best solution, but you could try to write a small  
> makefile, which would convert your graphic files (if those files  
> aren't up to date already) using some command line programms (such as  
> imagemagic or svg2pdf) and after that, make will compile your  
> document. I think it's the easiest way, if there is no way to do it  
> automatically from TeX.

Alan Litchfield wrote:

I think from Alain's initial post that he wants to be able to  transfer 
files that include embedded code. Instead he has the .tex  file plus 
various graphic file formats from the graphic development  and file 
transfer phases. I think he feels that these can provide  opportunities 
for errors, omissions and generally make file  management difficult.

I have suggested jPicEdt1.4, which provides a graphic interface and  can 
output LaTeX code, pic and eepic. It also outputs for pstricks.  Using 
this Alain can remove at least portions of his image file  requirements.

However, the underlying issue is not resolved and this is possibly  
because he has not accepted that TeX is a text based system, unlike  
other systems that incorporate binary data in them, such as most DTP  
and word processors.

Litchfield understands my question but I am not sure I understand his 
answer (see below) nor Rycko's (I already have pdf versions of the 
graphics). So, to make sure, and as promised to Dyballa, here is my 

Suppose I wanted to draw a red circle with radius R and center (x_0, 
y_0) in a LaTeX document.

Currently, the way I do it is:

    Draw the picture in Intaglio,
    Save As Circle.svg for possible editing,
    Save A Copy As Circle.pdf for inclusion in the source
    Type \includegraphics{Circle.pdf} in the source of the LaTeX document

If I knew how to write it, I would just type in the source (under the 
appropriate preamble.)

    $$\psset{unit=.6pc} \psaxes[labels=none,
    \rput(3.5,3){\pscircle[linewidth=2pt, linecolor=red](0,0){4}
    \uput[d](0,0){(x_0,y_0)} \pcline[offset=5pt]{**->}(0,
    \vspace{1cm}\footnotesize\hangcaption{A circle with centre $(x_0,
    y_0)$ and radius $R$. } \label{fig:circle}

My question: since Circle.svg is vector graphics and therefore already a 
few line of code in some language, is there a way to translate these few 
lines of code (i.e. the svg code that specifies a "red circle with 
radius R and center (x_0, y_0)") into the above LaTeX code.

The advantage would be that

    - there would be a single LaTeX document for uploading and
    downloading (as opposed to the current collection of graphics in
    addition to the source which currently only
    - would also satisfy GPL requirements
    - wouldn't force me to learn to write stuff like the above code.


------------------------- 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