## LaTeX forum ⇒ General ⇒ PDF Document Properties

LaTeX specific issues not fitting into one of the other forums of this category.
justastudent
Posts: 3
Joined: Mon Nov 21, 2011 2:18 pm

### PDF Document Properties

Hello,

Including a figure in EPS format generated by Gnuplot and creating a PDF using LaTeX -> DVI -> PS -> PDF, the document properties (title, subject, creator etc.) of the generated PDF are taken from the last EPS figure included.

If I try another figure in EPS format not created by Gnuplot (Adobe or so), the document properties are correct.
\documentclass{article}\usepackage{graphicx} \begin{document}   \begin{figure}[h]     \centering     \includegraphics{figure.eps}                    \caption{Test EPS}     \label{fig:test}   \end{figure}\end{document}

I tried \hypersetup, but still getting the same output.

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
With current versions of the common TeX distributions it should be possible to compile with PDFLaTeX while including EPS figures. At least with TeX Live 2011 it works. EPS figures are converted to PDF on the fly.

Best regards and welcome to the board
Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

justastudent
Posts: 3
Joined: Mon Nov 21, 2011 2:18 pm
Well, it is possible to use pdflatex on .eps, but then psfrag won't work.

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
justastudent wrote:Well, it is possible to use pdflatex on .eps, but then psfrag won't work.

That is something you should have mentioned right at the beginning. Then I wouldn't have proposed this approach.

There is a much smarter way to get nice plots by the pgfplots package. It uses Gnuplot as back-end. Perhaps you can upload a data set and a sample plot to the forum server so that we can see how your plots should look like. We then would be able to reproduce it with the package and do other additions for which you used psfrag.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

justastudent
Posts: 3
Joined: Mon Nov 21, 2011 2:18 pm
Next time, I would do it that way as you suggested or use other ways like create a tex file with gnuplot. But the fundamental question remains, why the ps2pdf conversion creates a pdf with the document properties changed (i.e. inherit the properties of the last gnuplot-created .eps image in the file) instead of taking the properties of the original .ps file?

Could you check the properties of the pdf created using the following code and eps file attached ? In document properties, you get Title: comp.eps (original name of the eps before renamed to figure.eps), Subject: gnuplot plot etc. instead of the expected Title: filename.pdf etc.

\documentclass{article}\usepackage{graphicx}\usepackage{psfrag}\begin{document} \begin{figure}[h]   \centering       \psfrag{Percentage}{\scriptsize Graphs (\%) }    \psfrag{Rho}[bl][bl]{\scriptsize $\rho$ }\includegraphics{figure.eps}                   \caption{Test EPS}   \label{fig:test}\end{figure}\end{document}
Attachments
figure.eps
Gnuplot created eps
Last edited by Stefan Kottwitz on Tue Nov 22, 2011 3:08 pm, edited 1 time in total.
Reason: code marked

Posts: 140
Joined: Thu Jul 16, 2009 12:39 am
This is a known problem with dvips' interpretation of the pdfmark set by Gnuplot, i.e. it's a bug on the LaTeX side. The only way I've been able to overcome it is to edit the EPS file directly in a text editor before including it in a LaTeX document. Specifically, look in the EPS file for a section that looks like this:
SDict begin [   /Title (something.tex)   /Subject (gnuplot plot)   /Creator (gnuplot 4.4 patchlevel 3)   /Author (someone)   /Producer (gnuplot)   /Keywords ()   /DOCINFO pdfmarkend

Comment out the /Title, /Subject, /Creator, /Author, /Producer, and /Keywords commands with a percent sign:
SDict begin [%  /Title (something.tex)%  /Subject (gnuplot plot)%  /Creator (gnuplot 4.4 patchlevel 3)%  /Author (someone)%  /Producer (gnuplot)%  /Keywords ()   /DOCINFO pdfmarkend

If you then run LaTeX -> dvips -> ps2pdf the PDF should have the correct meta data. It's a little inconvenient to remember to do this all the time for Gnuplot-generated files, but I'm used to it by now.
System: TeX Live 2012, Fedora 18 x86_64, GNU Emacs 24.2