[pdftex] pdftricks & slides font issue

Troy Goodson Troy.D.Goodson at jpl.nasa.gov
Fri May 2 12:42:34 CEST 2003


On Tuesday, April 29, 2003, at 03:38  PM, Heiko Oberdiek wrote:

> On Tue, Apr 29, 2003 at 02:08:25PM -0700, Troy Goodson wrote:
>
>> pdftricks doesn't seem to use the right font in the slides document
>> class (should be sans serif).  I've included an example, below.  The
>> font I see looks like the font from article class.  In fact, the
>> *fig1.tex file it makes uses the article class.
>
>> [run  pdflatex -shell-escape badfont.tex]
>> =-=-=-=-=-=[begin badfont.tex]=-=-=-=-=-=-=-=-
>> \documentclass{slides}
>> \usepackage{pdftricks}
>> \begin{psinputs}
>>   \usepackage{pstricks}	
>>   \usepackage{pst-node}
>> \end{psinputs}
>> [...]
>>
>> Here's the file generated by pdftricks: badfont-fig1.tex
>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> \documentclass{article}
>> \input tmp.inputs
>> \pagestyle{empty}
>> \usepackage{amssymb,amsbsy}
>> \begin{document}
>> [...]
>
> Perhaps more hooks can be added to pdftricks for better configuration.
> Until to such a version, copy the definition of \BeforeIncludedStream
> to your document and modify it to your needs (exchanging "article"
> by "slides").
>
> Yours sincerely
>   Heiko <oberdiek at uni-freiburg.de>

Thanks for the suggestion.  I got it to work with the code, below.

This is a fine workaound, although there is a remaining issue. My 
output from "fixfont.tex" (pdfLaTeX) has the words "S/C and Earth" 
nearth the top of the pstricks figure.  My output from "okfont.tex" 
(LaTeX) has the words "S/C and Earth" near the bottom of the pstricks 
figure.


[run  pdflatex -shell-escape fixfont.tex]
=-=-=-=-=-=[begin fixfont.tex]=-=-=-=-=-=-=-=-
\documentclass{slides}
\usepackage{pdftricks}
\begin{psinputs}
   \usepackage{pstricks}	
   \usepackage{pst-node}
\end{psinputs}
% workaound for pdftricks with slides
\def\BeforeIncludedStream
    {\stepcounter{psfig}\xdef\PDFCutFile{\PDFTfigname.tex}%
     \message{Opening PDFStream=\PDFCutFile}%
     \immediate\openout\PDFStream=\PDFCutFile
     \immediate\write\PDFStream{\string\documentclass{slides}}
     \immediate\write\PDFStream{\string\input\space tmp.inputs}
     \immediate\write\PDFStream{\string\pagestyle{empty}}
     \immediate\write\PDFStream{\string\usepackage{amssymb,amsbsy}}
     \immediate\write\PDFStream{\string\begin{document}}
     \let\ThisStream\WriteStreamLine}
\begin{document}
S/C and Earth
\begin{pdfpic}
\begin{pspicture}(-.2,-.5)(5,8.5) \showgrid
    \rput(1,0){\rnode{EAR}{Earth}}
    \rput(1,4){ \rnode{SC}{S/C} }
    \ncline{SC}{EAR}
\end{pspicture}
\end{pdfpic}
\end{document}
=-=-=-=-=-=[end fixfont.tex]=-=-=-=-=-=-=-=-


[run latex okfont.tex]
=-=-=-=-=-=[begin OKfont.tex]=-=-=-=-=-=-=-=-
\documentclass{slides}
   \usepackage{pstricks}	
   \usepackage{pst-node}
\begin{document}
S/C and Earth
\begin{pspicture}(-.2,-.5)(5,8.5)
    \rput(1,0){\rnode{EAR}{Earth}}
    \rput(1,4){ \rnode{SC}{S/C} }
    \ncline{SC}{EAR}
\end{pspicture}
\end{document}
=-=-=-=-=-=[end OKfont.tex]=-=-=-=-=-=-=-=-




More information about the pdftex mailing list