[OS X TeX] A suggestion for NewPdftricks (or for pdftricks in general)
Ross Moore
ross at ics.mq.edu.au
Fri May 27 02:15:00 CEST 2005
On 26/05/2005, at 4:47 PM, Franck Pastor wrote:
>
> Le 26-mai-05, à 03:28, Herb Schulz a écrit :
>
> <Snip>
>> You can pick up the changed file
>> from my download site, <http://homepage.mac.com/herbs2/>, as
>> NewPdftricks.zip. I will try to make this an option to pdftricks with
>> the
>> default being no auto-rotation but I'll need a little time.
>>
>> Good Luck,
>>
>> Herb Schulz
>> (herbs at wideopenwest.com)
>
> What about making an option to NewPdftricks for the font size (if you
> have time enough, of course, and if it's possible) ? i.e, something
> like
>
> \usepackage[12pt]{pdftricks}
>
> Up to know, even if the principal document begins with
> "\documentclass[12pt]{article}", the header of each pdftricks file
> ("file-fig1.tex", "file-fig2.tex") still is "\documentclass{article}"
> only, without the font size option :-( Hence the labels in the figures
> are far too small...
>
> I have found a workaround : I add "\fontsize{12pt}\selectfont" at the
> beginning of each pspicture :
There is a much easier way to solve this.
pdftricks.sty has a macro \BeforeStream that determines what goes
at the beginning of each job that creates an image; viz.
\def\BeforeStream
{\message{Opening PDFStream=\PDFTfigname.tex}%
\immediate\write\verbatim at out{\string\documentclass{article}}
\immediate\write\verbatim at out{\string\input\space tmp.inputs}
\immediate\write\verbatim at out{\string\pagestyle{empty}}
\immediate\write\verbatim at out{\string\begin{document}}
}
This is defined when the package is loaded.
So to get 12pt sizes, just do a redefinition to include the desired
option;
as follows:
\makeatletter % not necessary if done within a package
\def\BeforeStream
{\message{Opening PDFStream=\PDFTfigname.tex}%
\immediate\write\verbatim at out{\string\documentclass[12pt]{article}}
\immediate\write\verbatim at out{\string\input\space tmp.inputs}
\immediate\write\verbatim at out{\string\pagestyle{empty}}
\immediate\write\verbatim at out{\string\begin{document}}
}
\makeatother
This should fix it for all the images.
>
> \begin{pdfdisplay}
> \begin{pspicture}(0,0),(5,5)
> \fontsize{12pt}\selectfont
> ....
> \end{pspicture}
> \end{pspicture}
>
> But it's a bit annoying if you numerous pictures...
Of course. Doing something in every picture is not the desirable
way to go.
Modifying the \BeforeStream header is one way to avoid this.
Another is to place the \fontsize{12pt}\selectfont coding
into the tmp.inputs file.
This can be done using the {psinputs} environment.
One or more of the following, when placed into your LaTeX
document's preamble, should do what you want:
\begin{psinputs}
\fontsize{12pt}\selectfont
\end{psinputs}
\begin{psinputs}
\AtBeginDocument{\fontsize{12pt}\selectfont}
\end{psinputs}
\begin{psinputs}
\renewcommand{\normalsize}{\fontsize{12pt}\selectfont}
\end{psinputs}
\begin{psinputs}
\AtBeginDocument{%
\renewcommand{\normalsize}{\fontsize{12pt}\selectfont}%
\normalsize }
\end{psinputs}
However, this only affects the size of your main font.
Any other font-switches, such as \small \large, \LARGE,
\footnotesize etc. as well as super-/subscripts in math
will still be setup for a 10pt document.
So it's probably better to use the \BeforeStream solution.
>
> However, NewPdftricks remains the most reliable way (IMO) to get
> pstricks pictures with pdflatex.
An option to NewPdftricks , as Herb says he is preparing,
should be based on adjusting the contents of \BeforeStream .
> For example, ps4pdf still works very badly pst-3dplot, the pstricks
> package I use most of the time...
>
I've not encountered such problems with ps4pdf , which I use extensively
in a very large Encyclopaedia project.
Can you please post an example that gives bad results.
> Best regards,
Hope this helps,
Ross Moore
>
> Franck Pastor
>
> --------------------- Info ---------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
> & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>
>
>
>
------------------------------------------------------------------------
Ross Moore ross at maths.mq.edu.au
Mathematics Department office: E7A-419
Macquarie University tel: +61 +2 9850 8955
Sydney, Australia fax: +61 +2 9850 8114
------------------------------------------------------------------------
--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
& FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
More information about the macostex-archives
mailing list