Graphics, Figures & TablesProblem with auto-pst-pdf in template "classicthesis"

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
w_weiss
Posts: 3
Joined: Fri Jan 04, 2013 2:31 pm

Problem with auto-pst-pdf in template "classicthesis"

Post by w_weiss »

Hi!
I want to use \psfrag to replace text in EPS-graphs. This works pretty fine with this code:

Code: Select all

\documentclass[a4paper]{scrartcl}
\usepackage{auto-pst-pdf}
\usepackage{graphicx}
\usepackage{psfrag}

\begin{document}

Some text.

\begin{figure}[h!tbp]
\begin{center}
\scriptsize{
	\psfrag{LS-DYNA keyword deck by LS-PrePost}{}
	\psfrag{Nodal Temperature Data}{\small Knotentemperaturen in ^{\circ}\mathrm{C}}
	\psfrag{Time}{\small Zeit in s}
	\psfragfig[width=0.70\textwidth,keepaspectratio,angle=-90]{timestep_001.eps}
	\caption{Figure from LS-PrePost}
	\label{fig:prepost}
}
\end{center}
\end{figure}

Some more text.

\end{document}
When I use this packages together with the "classicthesis" template from http://www.ctan.org/tex-archive/macros/ ... sicthesis/ the EPS-image is not printed to PDF any more. There must be some issue with the template, but I cannot figure it out. I found some hints to pass the option -enable-write18, but the result stays bad.

I am using "TexnicCenter 2.0 Alpha 4" and MikTex 2.9 64-bit.

Regards, Wolfgang

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Problem with auto-pst-pdf in template "classicthesis"

Post by Stefan Kottwitz »

Hi Wolfgang,

welcome to the board!

Very good that you posted a minimal working example, so we could test it. It would be good to post the .eps file as attachment to a post, so a complete test would be possible.

In this case, please also attach the .log file you got with the classicthesis version.

Stefan
LaTeX.org admin
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Problem with auto-pst-pdf in template "classicthesis"

Post by svend_tveskaeg »

It is better to use

Code: Select all

\begin{figure}[<placement control>]
\centering
...
\end{figure}
instead of

Code: Select all

\begin{figure}[<placement control>]
\begin{center}
...
\end{center}
\end{figure}
The latter results in wrong spacing, i.e., too much vertical space around the figure.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Problem with auto-pst-pdf in template "classicthesis"

Post by cgnieder »

Hi Wolfgang,

welcome to the LaTeX community!

The following (with an EPS I had at hand) works fine with me:

Code: Select all

\documentclass[a4paper]{scrbook}
\usepackage{classicthesis}
\usepackage{auto-pst-pdf}
\usepackage{graphicx}
\usepackage{psfrag}

\begin{document}

Some text.

\begin{figure}[ht]
 \centering
 \scriptsize
 \psfrag{TMP}{\small TMP replacement}
 \psfrag{TMP2}{\small TMP2 replacement}
 \psfragfig[width=0.70\textwidth,keepaspectratio,angle=-90]{I010.eps}
 \caption{Figure from LS-PrePost}
 \label{fig:prepost}
\end{figure}

Some more text.

\end{document}
A few notes:
  • `classicthesis' needs \chapter defined so the class should provide it
  • \scriptsize does not take an argument! Its effect is confined to the scope of the {figure} environment anyway.
  • as svend said: the {center} environment should be avoided here as it inserts additional space before and after the environment. \centering will suffice nicely.
  • I compiled with pdflatex --shell-escape
Regards
site moderator & package author
w_weiss
Posts: 3
Joined: Fri Jan 04, 2013 2:31 pm

Problem with auto-pst-pdf in template "classicthesis"

Post by w_weiss »

Thank you very much for the fast replies. The solution of Clemens works fine - thank you. Thanx also to sven for the hint.

But the problem I have now is, that I still do not know, where the actual problem was coming from. I also use the classicthesis-config.tex from http://www.ctan.org/tex-archive/macros/ ... sicthesis/, where some standard settings are made. If I use the configurations of this classicthesis-config.tex together with \usepackage{auto-pst-pdf} and \usepackage{psfrag}, I get an error from auto-pst-pdf saying: Creation of ClassicThesis-autopp.dvi failed.

Attached you find the files for a "minimum" example. I did not remove all the comments from classicthesis-config.tex - sorry for that.

Regards, Wolfgang
Attachments
timestep_001.eps
(36.97 KiB) Downloaded 454 times
ClassicThesis.tex
(262 Bytes) Downloaded 291 times
classicthesis-config.tex
(13.38 KiB) Downloaded 318 times
testchapter.tex
(430 Bytes) Downloaded 335 times
Last edited by cgnieder on Sun Jan 06, 2013 2:39 pm, edited 2 times in total.
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Problem with auto-pst-pdf in template "classicthesis"

Post by cgnieder »

If I get it right the classicthesis-config.tex file is for personal adjustments, definitions and stuff? I'm not sure I like everything in there (like setting of the input encoding for example -- this should be done at document level, imho, or loading a driver for hyperref and graphicx -- better to let them decide for themselves).

Anyway, I can reproduce the problem with a much shorter Infominimal working example:

Code: Select all

\documentclass{scrreprt}

\usepackage{graphicx}
\usepackage{hyperref}
\usepackage[runs=2]{auto-pst-pdf}
\usepackage{psfrag}
\usepackage{blindtext}
\usepackage{classicthesis}

\begin{document}

\chapter{Einleitung}

\blindtext

See figure~\ref{fig:prepost} bla

\begin{figure}[htbp]
 \centering
  \scriptsize
  \psfrag{LS-DYNA keyword deck by LS-PrePost}{}
  \psfrag{Nodal Temperature Data}{\small Knotentemperaturen in ^{\circ}\mathrm{C}}
  \psfrag{Time}{\small Zeit in s}
  \psfragfig[width=0.70\textwidth,keepaspectratio,angle=-90]{timestep_001.eps}
  \caption{Figure from LS-PrePost}
  \label{fig:prepost}
\end{figure}

\blindtext

\end{document}
The problem vanishes if you comment the hyperref package. It should be loaded as late as possible and is loaded by classicthesis later anyway.

In my opinion it's better not to use the ready made config file but to create an own adding stuff as one goes along. That way you will detect immediately if a new addition causes problems or not.

Regards
site moderator & package author
w_weiss
Posts: 3
Joined: Fri Jan 04, 2013 2:31 pm

Re: Problem with auto-pst-pdf in template "classicthesis"

Post by w_weiss »

Thank you very much for your input, Clemens. I agree with you to create an own "config" file.
Post Reply