Inconsistent size PDF/EPS Export

Post questions on how to use or achieve an effect in Inkscape.
divB
Posts: 6
Joined: Mon Nov 29, 2010 7:00 am

Inconsistent size PDF/EPS Export

Postby divB » Mon Dec 06, 2010 10:53 pm

Hi,

When I create an image with Inkscape and export with EPS or PDF (and each with LaTeX option) I get different image sizes.

With the minimum example (see attachment):
EPS 3.33 2.61 inch
EPS+LaTeX 3.33 2.25 inch
PDF 3.34 2.61 inch
PDF+LaTeX 3.34 2.61 inch

Two observations:
1.) EPS and PDF only export is always different but the difference is small (though might cause problems in my case)
2.) With LaTeX options, the PDF export leaves some space for the text, the EPS export not. This is catastrophal because the text inside LaTeX appears to be "anywhere"

Is this a known problem?

Is there a workaround for consistent export?

Regards,
divB
Attachments
sample3.zip
(28.62 KiB) Downloaded 202 times

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: Inconsistent size PDF/EPS Export

Postby ~suv » Tue Dec 07, 2010 2:38 am

Admitteldly, I haven't looked at the details of your problem (nor do I work with LaTeX myself), but possibly this is rooted in the known "issue" that exporting to EPS always uses the smallest possible bounding box (even if 'Export page area' is selected), following the EPS specifiaction (PDf and PS export behave differently).

See these reports in Inkscape's bug tracker, if any of them mention the same or a related issue:
638167 LaTeX text displaced (save as PDF/EPS+LaTeX)
600413 Image placed incorrectly with LaTeX eps output
595821 EPS+LaTeX wrong size when text outside other drawing objects

Also, the section PDF, PostScript, and EPS export in the release notes of 0.47 has some basic information about the subtle differences between the cairo-based export formats.

divB
Posts: 6
Joined: Mon Nov 29, 2010 7:00 am

Re: Inconsistent size PDF/EPS Export

Postby divB » Thu Dec 09, 2010 11:57 pm

Thank you very much.

I found a workaround: PS+LaTeX works as well with latex and does not have this problem!

Regards,
divB

felipebm
Posts: 5
Joined: Sat Mar 12, 2011 4:17 am

Re: Inconsistent size PDF/EPS Export

Postby felipebm » Sat Mar 12, 2011 4:33 am

I didn't had the same luck as divB since I'm using pdfLaTex and it doesnt works with .ps files. Does anybody knows a workaround for this problem?

divB
Posts: 6
Joined: Mon Nov 29, 2010 7:00 am

Re: Inconsistent size PDF/EPS Export

Postby divB » Sun Mar 13, 2011 11:16 pm

Yes, as I have written:

With PDF, everything is alright. With PS as well. The problem only occurs with EPS!

You say you use PdfLatex, so you do NOT need EPS! You only need PDF+LaTeX export which works fine. Clearly PdfLatex+PS does not work because PdfLatex does neither support PS nor EPS. Only PDF!

In case you also need latex (NOT pdflatex) just use PS+LaTeX export instead of EPS+LaTeX export

felipebm
Posts: 5
Joined: Sat Mar 12, 2011 4:17 am

Re: Inconsistent size PDF/EPS Export

Postby felipebm » Mon Mar 14, 2011 11:08 pm

Thank you for your reply divB.

Contrary to you, I do have problems with the PDF format. I'm attaching the files to illustrate my case. As you will see numbers of the X and Y axes are misplaced.

Cheers,
Felipe.
PD. I was willing to include the .tex and .pdf_tex files but for some reason the server rejected these extensions.
Attachments
example-PDFLatex.svg
original file
(251.47 KiB) Downloaded 215 times
example.pdf
results obtained with the PDF+Latex export option on Inkscape 0.48.1 r9760
(66.58 KiB) Downloaded 241 times

divB
Posts: 6
Joined: Mon Nov 29, 2010 7:00 am

Re: Inconsistent size PDF/EPS Export

Postby divB » Tue Mar 15, 2011 9:12 pm

This has nothing to do with with the size of the PDF export (it should be correct) but with a related problem I had: Text positioning.

This is not very flexible and depends on the LaTeX font size. In general (as far as I remember) the export uses the left bottom corner of a textbox as startpoint for the LaTeX text. I think in your case the one option is to move your text more to the left.

Another option: I often had the problem that I needed to center some text (in a box for example). I defined the following macros:

\newcommand{\T}[1]{\scriptsize#1}
\newcommand{\C}[1]{\makebox[0pt]{\T{#1}}}
\newcommand{\CM}[1]{\C{\begin{tabular}{c}#1\end{tabular}}}

When I wanted to create a centered text, I used \C{this text is centered} and when I wanted to create a centered multiline text I used \CM{This text \\ is centerd}.

The centering is done by the \makebox[0pt], maybe you can use this idea to create something that right-aligns text text. Then the text would start from the y-axis and should not intersect the axis line.

Regards,
divB

felipebm
Posts: 5
Joined: Sat Mar 12, 2011 4:17 am

Re: Inconsistent size PDF/EPS Export

Postby felipebm » Fri Mar 18, 2011 6:47 am

Unfortunately shifting numbers around is not an option for me since precision is fundamental in this type of graphs.

I'd managed to solve the problem (partially) by exporting a fresh .svg file from my math software (mathematica 7.0) and everything runs fine. Anyway, after some manipulations (specially scaling) and then exporting to pdf_tex, makes the numbers misplaced again.

So as a conclusion, it seems hard work to include this wonderful option into my thesis. I'll keep working the old way and I hope this options matures with time.

Thanks for your help divB.

divB
Posts: 6
Joined: Mon Nov 29, 2010 7:00 am

Re: Inconsistent size PDF/EPS Export

Postby divB » Sat Mar 19, 2011 10:40 pm

Sorry I can not provide more help.

In fact I also kept many graphs as they were (e.g. MATLAB exports).

I used this feature only for handmade diagrams


Return to “Help with using Inkscape”