I am trying to draw certain types of graphs in latex, and want to use them in mathematical expressions. I already used a lot the software IPE (found here http://ipe.otfried.org/). It allows me to draw perfectly what i want. Here is an example :

A graph

I include these pictures in Latex using epsfbox :

\usepackage{epsfig} \begin{document} \epsfxsize=X ex \epsfbox{Tree1.eps} \end{document}

X is the size of my item.

Now, here are my problems : First, i can't master the size of the item in Latex. Is there a way to obtain the size in any unity of the object i create in IPE?

Then i can't choose how to position the item in formulas. For the example i drew earlier, i would like the bottom nodes to be on the same height as the mathematical symbols.

I have tried to draw directly those graphs using Latex, but drawing curves is terribly hard! And I do not have the time to draw my dozens of graphs using this method...

Any help would be greatly appreciated !


2 Answers 2


You should use \includegraphics[width=…]{Tree1.eps} or \includegraphics[scale=…]{Tree1.eps}. The epsfig package is obsolete and should be replaced with graphicx.

That said, it is rather simple to obtain the above graph with pstricks, and more specifically with pst-node. Further, you can compile the code with pdflatex, loading auto-pst-pdf and compiling with the --enable-write18 switch under MiKTeX, or -shell-escape under TeX Live and MacTeX. This way your image is in pdf format.

Here is a code with the .png image posted in the question, and with the .pdf image compiled as standalone:


    \[ a = b + c \quad\includegraphics[width=15pt]{Tree1.png} \]%
    \[ a = b + c \quad\includegraphics[width=15pt]{Tree1.pdf} \]%

Graphics with width in math mode

The pstricks code:

\documentclass[ x11names]{standalone}


\psset{yunit=0.8, dotsize=8pt}

\nccircle[angle = 180]{O}{0.4}
\psset{linestyle=dashed, dash=6pt 5pt}
\ncarc[arcangleA=-20, arcangleB=-30]{A1}{C}
\ncarc[arcangleA=40, arcangleB=60]{O}{B}

  • Thanks for your answer. There is much more than I need but it really helps! Two more questions maybe : what does \documentclass[ x11names]{standalone} means. I do not know this document class. And why do i need to change Miktex to run the package auto-pst-pdf? Oct 31, 2016 at 13:37
  • The standalone class produces graphic files with a bounding box. The x11names should have been deleted (I started from an old code). For you information, pstricks loads the xcolor package, without option. If I load it with this option, there well be an option clash message. Declaring the option with the class is a way to avoid this option clash. For the last question, you have to change the way pdflatex is launched from your editor. This parameter is not set by default for security reasons. It allows to delegate a task to an external application, then resume compilation.
    – Bernard
    Oct 31, 2016 at 13:56

The general way of using Ipe seems to be that you enter any LaTeX elements directly into the editor where they are rendered. You can position the rendered elements in the same way as text nodes (using the 'translate' mode).

enter image description here

If you need any packages for the inline LaTeX you can list them in Edit-Document properties under Latex preamble.

Then, in your main LaTeX document, you can use \includegraphics from the graphicx package to add the eps figure you exported from Ipe (instead of epsfbox). The scale can be set in \includegraphics. You can find many examples of this on TeX.SE and elsewhere. MWE:

No scaling:


Scale by factor 0.5:


Scale by absolute width:



enter image description here

  • I should have done that from the beginning. epsfbox just brought problems. Thanks! Oct 31, 2016 at 13:33
  • @Marijin: I am drawing some figure in IPE and I want to draw a dashed line. How I can draw it. Also, I want to text bold letters in IPE but I did not saw the options of bold alphabets in IPE.
    – Struggler
    May 31, 2020 at 3:55
  • @Struggler it would be best if you ask a new question about this (using the Ask Question button on the top of the screen).
    – Marijn
    May 31, 2020 at 7:53
  • Do you know how can I use \overbrace commant in IPE?
    – MariyaKav
    Jan 4, 2021 at 13:40
  • @MariyaKav in the 'Edit text object' window you can type something like \overbrace{a+b}. If you can't make it work then it is better to ask a new question however, instead of posting a comment in another question.
    – Marijn
    Jan 4, 2021 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.