[Tex/LaTex] Trouble with PNAS template and accents in body and references

accentsfont-encodingsfonts

This has been driving me nuts. I use the PNAS template and compile with pdflatex under MacOSX 10.9.2 and MacTeX 2013 or 2014 (tried both). Here's the very simple .tex file:

\documentclass{pnastwo}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pnastwof}
\begin{document}

\title{Title}

\begin{article}
As introduced by Rodrigu\`{e}s \cite{rodr} initially ...

\begin{thebibliography}{10}
\bibitem{rodr}Rodrigu\`{e}s B (2006) Title, \emph{Journal} 1(1):1--10.
\end{thebibliography}

\end{article}
\end{document}

The pnastwof.sty was edited to use the correct font names (phv* instead of ph* and ptm*8t instead of ti*).

The problem is that the accented è appears fine in the body but not in the references (appears as a strikeout Ł). If I use OT1 instead of T1 in fontenc (or do not use the fontenc package at all), then the situation reverses: fine in references, wrong in body. The inputenc package makes no difference.

The log warns about:

       : No file T1phvr.fd. on input line 12.
line 12: Font shape `T1/phvr/m/n' undefined(Font) using `T1/cmr/m/n' instead
       : Some font shapes were not available, defaults substituted.

Is there a way to fix this cleanly without editing the pnastwo class or pnastwof package? Are the \DeclareFontShape definitions in the pnastwof package incomplete or wrong?

My (ugly) solution was to hack the pnastwof package and force the font encoding and family using \def\bibfont{\fontencoding{T1}\fontfamily{phv}\fontsize{6pt}{8pt}\selectfont} (overwriting the old \def\bibfont{…}). This change also gets rid of the missing font warnings in the log …

Any help will be greatly appreciated.

Best Answer

The pnastwof package is full of \font declarations that are evil. The accent problem is due to the fact that the default font is a proprietary version of Frutiger that apparently has accents moved in different places.

If you want a preprint that is similar to the final result, avoid loading pnastwof and change the font setup. I really can't understand why the class and the package are written in this improper style. Leave to the copy editors do the appropriate changes.

\documentclass{pnastwo}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

%%% font setup in order to make the article printable
\usepackage{mathptmx}
\usepackage{helvet}
\renewcommand\bibfont{\fontsize{6pt}{9pt}\bfseries\sffamily}
\renewcommand{\bibitfont}{\bibfont\slshape}
\renewcommand{\bibbffont}{\bibfont}
%%%

\begin{document}

\title{Title}

\begin{article}
As introduced by Rodrigu\'{e}s \cite{rodr} initially ...

\begin{thebibliography}{10}
\bibitem{rodr} Rodrigu\'{e}s B (2006) Title, \emph{Journal} 1(1):1--10.

\end{thebibliography}

\end{article}
\end{document}

enter image description here