0

Dear stackoverflow community,

I am in the midst of writing my thesis and I want my figures to have the same font as my text in Latex. I have a lot of figures, so I would like the process to be automatic. for that purpose, I have found the neat *.pgf format that Latex can handle with

\usepackage{pgfplots}

and

\begin{figure}
    \input{./example.pgf}
\end{figure}

With *.pgf files the font is automatically adjusted, which is exactly what I want. It works great with the figures that I created with matplotlib.pyplot.

My issue: I have now created figures in CorelDraw such as this one. I also want these figures as *.pgf so Latex automatically knows what is text and converts it to the same font as the rest of the document.

My question: Do you have an idea how to create *pgf files? Or is there another way of editing the font in my figures?

My attempt to solve it: I have tried exporting the file in CorelDraw to *.eps and using eps2pgf converting it to *.pgf. Sadly eps2pgf does not show compability with the *.eps file created by CorelDraw (error report). I thought I might be able to export it to Inkscape and exporting as an *.eps file there, but the conversion doesn't work either.

PS: CorelDraw can export to all of these file formats.

  • Inkscape can export to LaTeX → tex.stackexchange.com/questions/151232/… So maybe you can import your figures in or recreate with inkscape – DG' Nov 6 '18 at 13:39
  • Let me note that pgfplots is here sort of an overkill. It should of course do the job, since it is based on TikZ/pgf, but a slightly more minimal package to load would be tikz. – user121799 Nov 6 '18 at 14:41
  • thanks for the comment, that's why it was slow :) – Benno P. Nov 6 '18 at 14:45
  • Never seen a pgf file, but I suspect that it resembles the legend stored in the aux file. That is, it is full of TikZ basic commands, like \pgfpathmoveto and \pgfpathlineto. – John Kormylo Nov 7 '18 at 14:28
0

The solution via Inkscape worked! Thank you DG' for showing me the right direction! :) I am not converting the file to *pgf, but using the export function of Inkscape like this:

  1. Export the graphic as *.svg file in CorelDraw
  2. Import the *.svg file and edit it in Inkscape
  3. Export it as pdf like DG' mentioned in a comment on my question
  4. After doing these steps I was able to import the figure in latex like this: this:

\usepackage{tikz}

and

\begin{figure}
    \graphicspath{{figures/}}
    \def\svgwidth{\linewidth}
    \input{./figures/example_figure.pdf_tex}
    \caption{}
\end{figure}

(Don't ask me why I had to specify \graphicspath, but without it, latex doesn't find the pdf file.

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.