[texhax] Trying to find the /right/ piece of LaTeX documentation.]

Peter Hutnick tex at hutnick.com
Fri Jul 9 19:16:49 CEST 2004


Mohamed HOUSSNI wrote:

> \newcommand{\placefig}[2]{
> \marginpar{
> \begin{minipage}[b][\textheight][s]{\marginparwidth}
> #1\par\vfill\par#2
> \end{minipage}
> }}
> 
> This command support two floats without captions. And if you want add 
> caption, you have to define the following command in the preambule
> 
> \makeatletter
> \def\@captype{Figure}
> \def\@captionof#1#2{{\def\@captype{#1}#2}}
> \makeatother
> 
> NB. The whole syntaxe in the text looks like
> 
> \placefig{\includegraphics[....]{...}
> \captionof{figure}{\caption{\label{...}legend's text}}}{...........}

Both of the chunks of code are in my preamble.  When I do:

\placefig{
\captionof{figure}{\caption{\label{1}The Plane.}}}
\begin{figure}[htp]
         \pspicture(-4,-4)(4,4)
\psaxes[labels=none,ticks=none]{<->}(0,0)(-4,-4)(4,4)
\rput(2,2){Quadrant I}
\rput(-2,2){Quadrant II}
\rput(-2,-2){Quadrant III}
\rput(2,-2){Quadrant IV}
         \endpspicture
%\caption{The Plane.}
\end{figure}
}

LaTeX complains:

    ! Undefined control sequence.
    <argument> ... ][s]{\marginparwidth }  \captionof
                                                      {figure}{\caption
    {\label ...
    l.971 \begin
                {figure}[htp]

What am I doing wrong?

-Peter



More information about the texhax mailing list