I have to import a picture into LaTeX which is in the format graphml
created using yEd. I would like to avoid converting it in a .pdf since then LaTeX would import the whole A4 page. Could you help me?
2 Answers
As you can see here LaTeX only supports a limited set of graphics.
If you can easily convert your graphml
file to PDF or EPS, then convert it. Then you can use the trim
option to \includegraphics{}
to trim all the extra space around it:
%trim option's parameter order: left bottom right top
\includegraphics[trim = 10mm 80mm 20mm 5mm, clip, width=3cm]{yourpdffile.pdf}
You can try various trimming sizes until the included image has no extra white space.
But in general, I would suggest you to take a look at the pgfplots package in LaTeX if you want to put plots in a LaTeX document. It will make the plots in LaTeX and has an excellent and easy to learn manual. So all the fonts, line widths, colors and all the settings in your graph will be identical to your document.
You open the graphml with yEd and export it as example.eps
. In LaTeX you can then do
\usepackage{graphicx}
\usepackage{epstopdf}
...
\includegraphics{example}
EPS is Encapsulated PostScript and this works with different ways creating the pdf including running pdflatex
and latex
. When using pdflatex epstopdf will create a pdf from the eps on the fly with the name example-eps-converted-to.pdf
.
Note that you can't export from command line with yEd. That feature is explicitely not available due to licensing reasons [1].
\includegraphics
from packagegraphicx
(if running in non-DVI-mode)graphml
intoTikZ
with findbestopensource.com/product/yworks2pgf