# Use of pdftricks with memoir

below is a (long, non-working) minimal example for use of pdftricks with the memoir document class. It is based directly on the (shorter, working) minimal example of use of pdftricks found at http://www.tug.org/pipermail/macostex-archives/2009-June/040498.html. I get an error as follows:

! Undefined control sequence.
\psinputs ->\verbatimwrite
{tmp.inputs}
l.28   \begin{psinputs}


Any help is appreciated!

\documentclass[article, a4paper, 12pt, twoside]{memoir}

\setlrmarginsandblock{23mm}{23mm}{*}
\setulmarginsandblock{23mm}{28mm}{*}
\checkandfixthelayout
\setcounter{secnumdepth}{1}
\setsecindent{1cm}
\let\footruleskip\relax % for compatibility of memoir and fancyhdr
\let\sl\ttfamily        % for compatibility of memoir and blindtext (silly, but it works) ha ha \ttfamily
\let\sc\scshape
\let\bf\bfseries
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyfoot{}
\cfoot{\thepage}
%%% End of memoir stuff

\usepackage{ifpdf}
\ifpdf%
\usepackage{pdftricks}
\begin{psinputs}
\usepackage{pstricks}
\usepackage{pst-plot}
\end{psinputs}
\else
\usepackage{pstricks}
\usepackage{pst-plot}
\newenvironment{pdfpic}{}{}
\fi

\begin{document}
\centering
\begin{pdfpic}
\begin{pspicture}(-1,-1)(6,6)
\psaxes[showOriginTick=false,showorigin=false,Dx=2,Dy=2,subticks=2](6,6)
\end{pspicture}
\end{pdfpic}
\end{document}

-
Why do you want fancyhdr compatibility? Memoir can do all that stuff itself... – Seamus Mar 21 '11 at 15:19

Add \DisemulatePackage{moreverb} to the preamble, btw: you can reintroduce \sc using the oldfontcommands class option

-
thanks, worked for me. – Joe Corneli Mar 21 '11 at 19:19

use the package auto-pst-pdfinstead of pdftricks. It really simplyfies the use of PSTricks:

...
\usepackage{auto-pst-pdf}

\begin{document}
\centering

\begin{pspicture}(-1,-1)(6,6)
\psaxes[showOriginTick=false,showorigin=false,Dx=2,Dy=2,subticks=2](6,6)
\end{pspicture}
...


run it as usual with pdflatex -shell-escape <file.tex>

-
nice suggestion, I'll try it when I get closer to final draft status. for the moment, installing auto-pst-pdf and all its dependencies is a bit heavy -- I'm using texlive 2007, no tlmgr :(. – Joe Corneli Mar 21 '11 at 19:35
ok, that is really old ... You can try to run pst2pdf. It is a Perl script, which extracts all PostScript specific part of your doc and creates single pdf images which then are used in a last pdflatex run. The script is available from CTAN. – Herbert Mar 21 '11 at 19:45