4

I am working with psfrag to do my plots and fncychap to have nice chapter titles.

Here is a minimal example:

\documentclass[12pt,letterpaper,twoside,openright]{report}
\usepackage[dvips]{graphicx}
\usepackage[left=4cm,right=3cm,top=3cm,bottom=3cm]{geometry}
\usepackage{fourier}
\usepackage[Lenny]{fncychap}
\usepackage{psfrag}

% NOTE: 
% The error is related to \fontsize, \usefont and \selectfont
% UNCOMMENT THE FOLLOWING to reproduce the error withoyt the fncychap packages:
% \begin{filecontents*}{fncychap_produce_error.sty}
%  \def\@makechapterhead#1{{\fontsize{60}{62}\usefont{OT1}{ptm}{m}{n}\selectfont 123}}
% \end{filecontents*}
% \usepackage{fncychap_produce_error}

\begin{document}
\chapter{Minimal example}
\centering
   \psfrag{dx}{$dx$}
   \psfrag{dy}{$dy$}
   \psfrag{sx}{$\sigma_x$}
   \psfrag{sy}{$\sigma_y$}
   \psfrag{txy}{$\tau_{xy}$}
   \psfrag{tyx}{$\tau_{yx}$}
   \psfrag{(a)}{(a)}
   \psfrag{(b)}{(b)}
   \psfrag{(c)}{(c)}
   \includegraphics[width=\columnwidth]{esfuerzos2d}
\end{document}

When I compile it with LATEX->DVIPS->PS2PDF, in TeXLive 2009, MikTeX 2009 I get the correct result:

enter image description here

However, when I compile my .tex files with LATEX->DVIPS->PS2PDF, in TeX Live 2013, the resulting PS and PDF files do not render well the psfraged pictures. That is:

enter image description here

Look that all the text is shifted to the right!!!

I have noticed that this error is produced by an incompatibility between psfrag and fncychap.

I have to stick to psfrag because I am writing a book with hundreds of psfraged pictures. All pics suffer the same problem.

Any clue?

  • 2
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Aug 22 '14 at 15:08
  • I've rolled back the 'solved' edit: you can 'accept' egreg's answer to show it works for you, but the general format for the site doesn't encourage editing questions to reflect the fact they have answers (at least unless it helps guide the answers). – Joseph Wright Aug 23 '14 at 7:32
8

The loading of Times done by fncychap conflicts with the font used by psfrag, which is Times as well.

The Lenny chapter style is one of the ugliest I know; using Times for the chapter number is absurd, in any case, unless Times is the main document font.

Just add

\ChNumVar{\normalfont\fontsize{60}{62}\selectfont}

to your document preamble.

\documentclass[12pt,letterpaper,twoside,openright]{report}
\usepackage{graphicx}
\usepackage[left=4cm,right=3cm,top=3cm,bottom=3cm]{geometry}
\usepackage{fourier}
\usepackage[Lenny]{fncychap}
\usepackage{psfrag}

\ChNumVar{\normalfont\fontsize{60}{62}\selectfont}

\begin{document}
\chapter{Minimal example}
\centering
   \psfrag{dx}{$dx$}
   \psfrag{dy}{$dy$}
   \psfrag{sx}{$\sigma_x$}
   \psfrag{sy}{$\sigma_y$}
   \psfrag{txy}{$\tau_{xy}$}
   \psfrag{tyx}{$\tau_{yx}$}
   \psfrag{(a)}{(a)}
   \psfrag{(b)}{(b)}
   \psfrag{(c)}{(c)}
   \includegraphics[width=\columnwidth]{esfuerzos2d}
\end{document}

enter image description here

Please, reconsider your idea of using fncychap.

| improve this answer | |
0

NOTE:

In addition to the option

\ChNumVar{\normalfont\fontsize{60}{62}\selectfont}

that egreg recomended, include as well

\ChNameVar{\normalfont\fontsize{14}{16}\selectfont}

because some fonts may get lost when using psfrag.

| improve this answer | |

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.