%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -*- Mode: Latex -*- %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% test-pst.tex --- Various PSTricks tests, from the PSTricks chapter
%%                  of "The LaTeX Graphics Companion" (by Goossens, Rahtz,
%%                  Mittelbach, Addison Wesley, 1997)
%%
%% Author          : Sebastian RAHTZ (Elsevier - GB) <s.rahtz@elsevier.co.uk>
%% Created the     : Tue Feb  3 20:37:47 1998
%% Last mod. by    : Denis GIROU (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
%% Last mod. the   : Thu Feb 26 15:15:11 1998
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                          %%%
%% The examples in this set have been slightly rearranged and modified      %%%
%% to ensure that this file works on VTeX installations where not all       %%%
%% fonts have been installed. MV 07-11-98                                   %%%
%% Slightly changed to work with VTeX/Free WaS 2001-03-19                   %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\documentclass{report}
\documentclass[a4paper]{article}
\usepackage[latin1]{inputenc}
%\usepackage{hyperref} % MK

\usepackage{calc}         % From LaTeX distribution
\usepackage{graphicx}     % From LaTeX distribution
\usepackage{ifthen}       % From LaTeX distribution
%\usepackage{subfigure}   % From CTAN/macros/latex/contrib/supported/subfigure
\usepackage{pst-all}      % From PSTricks
%\usepackage{pst-poly}     % From pstricks/contrib/pst-poly
\usepackage{multido}      % From PSTricks
\input{random.tex}        % From CTAN/macros/generic


\makeatletter
{\catcode`\ =\active%
\gdef\@vobeyspaces{\catcode`\ \active\let \@xobeysp}}
\begingroup \catcode `|=0 \catcode `[= 1
\catcode`]=2 \catcode `\{=12 \catcode `\}=12
\catcode`\\=12 |gdef|@xverbatim#1ASDFGHJKL[#1]
|endgroup

\let\old@xverbatim\@xverbatim
\def\verbatimfile#1{%
        \par
        \bgroup
        \ttfamily\selectfont
        \catcode`\{=12 \catcode `\}=12 \catcode`\\=12
        \catcode`\^=12 \catcode`\_=12\catcode`\#=12\catcode`\~=12
        \catcode`\$=12\catcode`\&=12\catcode`\%=12
        \frenchspacing\@vobeyspaces\obeylines\expandafter\old@xverbatim\input #1
        ASDFGHJKL
        \egroup
        }%
\makeatother

\newcommand\ExampleSubFigure[2][0.3333]{%
\section{Example #2}
%\begin{figure}[!htbp]%
% \centering
 % \begin{minipage}[t]{#1\textwidth}%
 %   \parbox[b]{\textwidth}{%
      \begin{center}
      \input{lgc/#2.inl}%
      \end{center}
 % \end{minipage}
  \bigskip
  \noindent Source:\par\smallskip\noindent
  \verbatimfile{lgc/#2.inl}%
%  \caption{Example #2}%
  \medskip
%  \begin{center}
%  Example #2
%  \end{center}
%  \end{figure}%
  \vfill\eject
  }

\newpsobject{showgrid}{psgrid}{subgriddiv=1,griddots=10,gridlabels=6pt}

% New colors defined
\definecolor{brown}{rgb}{.65, .16, .16}
\definecolor{lightblue}{rgb}{.68, .85, .9}
\definecolor{palegreen}{rgb}{.6, .98, .6}
\definecolor{pink}{rgb}{1, .75, .8}
\definecolor{wheat}{rgb}{.96, .87, .7}

% Layout changes
\textheight=23cm
\topmargin=-2cm
\textwidth=16cm
\oddsidemargin=0cm
\evensidemargin=0cm

\begin{document}

\title{Test file for the PSTricks 97 distribution:\\
       most of the PSTricks examples of\\
       \emph{The \LaTeX{} Graphics Companion}}
\author{Sebastian \textsc{Rahtz} --- March 1997}
\date{Version 1.0 (February 23, 1998)}
\maketitle
\centerline{Modified for V\TeX\ distribution by MV \& MK --- July 1998}
\section{Introduction}
This document was originally written by Sebastian Rahtz and included
in PSTricks beta distribution as a comprehensive demonstration and test example.
MicroPress adapted this document for V\TeX\ distribution. Changes include:
\begin{itemize}
\item Writing this introduction.
\item Splitting examples, so that every one forms a separate
section and starts a new page.
\item We include source of the example.
\item Minor changes made to some of the examples in order to
adapt to V\TeX's font layout.
\end{itemize}

Most of \TeX\ typesetting systems have a way to include PostScript
graphics in \TeX\ document.
PSTricks is a macro package that provides user-level interface to
PostScript capabilities of \TeX\ backend.
PSTricks is a \LaTeX2e{} package, and in order to use it one have
just to say
\verb|\usepackage{pstricks}|.
\smallskip

Unfortunately, the documentation for the \texttt{pstricks} package is
still under development by PSTricks authors
(and the package itself is under development
as well).
Our own documentation is under development as well.
%That is why MicroPress can not provide the documentation right now.
However, within this document you will find examples of both
\texttt{pstricks} pictures
and sources that produced it.
This information may be useful for those who
intend to use capabilities
provided by PSTricks right now, without waiting for the release
of documentation.

\vfill\eject

% \centering

  \ExampleSubFigure{4-2-1}
  \ExampleSubFigure{4-2-2}

  \ExampleSubFigure{4-2-3}
  \ExampleSubFigure{4-2-4}
  \ExampleSubFigure{4-2-5}

  \ExampleSubFigure{4-3-1}
  \ExampleSubFigure{4-3-2}

  \ExampleSubFigure{4-4-1}
  \ExampleSubFigure{4-4-2}
  \ExampleSubFigure{4-4-3}
  \ExampleSubFigure{4-4-4}
  \ExampleSubFigure{4-4-5}
  \ExampleSubFigure{4-4-6}
  \ExampleSubFigure{4-4-7}
  \ExampleSubFigure{4-4-8}
  \ExampleSubFigure{4-4-9}
  \ExampleSubFigure{4-4-10}
  \ExampleSubFigure{4-4-11}
  \ExampleSubFigure{4-4-12}

  \ExampleSubFigure[0.5]{4-5-1}
  \ExampleSubFigure[0.5]{4-5-2}
  \ExampleSubFigure[0.75]{4-5-3}%
  \ExampleSubFigure[0.25]{4-5-4}
  \ExampleSubFigure[0.2]{4-5-5}
  \ExampleSubFigure[0.2]{4-5-6}
  \ExampleSubFigure[0.2]{4-5-7}
  \ExampleSubFigure[0.2]{4-5-8}
  \ExampleSubFigure[0.2]{4-5-9}
  \ExampleSubFigure[0.5]{4-5-10}
  \ExampleSubFigure[0.5]{4-5-11}
  \ExampleSubFigure[1]{4-5-13}
  \ExampleSubFigure[1]{4-5-14}
  \ExampleSubFigure[1]{4-5-16}  %

  \ExampleSubFigure{4-6-1}%
  \ExampleSubFigure{4-6-2}
  \ExampleSubFigure{4-6-3}
  \ExampleSubFigure{4-6-4}
  \ExampleSubFigure{4-6-5}
  \ExampleSubFigure{4-6-6}
  \ExampleSubFigure{4-6-7}
  \ExampleSubFigure{4-6-8}
  \ExampleSubFigure{4-6-9}
  \ExampleSubFigure{4-6-10}%
  \ExampleSubFigure{4-6-11}%
  \ExampleSubFigure{4-6-12}
  \ExampleSubFigure{4-6-13}%
  \ExampleSubFigure{4-6-14}%
  \ExampleSubFigure{4-6-15}
  \ExampleSubFigure{4-6-16}%
  \ExampleSubFigure{4-6-17}%
  \ExampleSubFigure{4-6-18}
  \ExampleSubFigure{4-6-19}%
  \ExampleSubFigure{4-6-20}%
  \ExampleSubFigure{4-6-21}
  \ExampleSubFigure{4-6-22}%
  \ExampleSubFigure{4-6-23}%
  \ExampleSubFigure{4-6-24}
  \ExampleSubFigure{4-6-25}
  \ExampleSubFigure[1]{4-6-26}
  \ExampleSubFigure{4-6-27}%
  \ExampleSubFigure{4-6-28}%
  \ExampleSubFigure{4-6-29}
  \ExampleSubFigure[0.3333]{4-6-30}
  \ExampleSubFigure[0.6667]{4-6-31}
  \ExampleSubFigure[1]{4-6-32}
  \ExampleSubFigure[1]{4-6-33}
  \ExampleSubFigure[0.5]{4-6-34}
  \ExampleSubFigure[0.5]{4-6-35}
  \ExampleSubFigure[0.5]{4-6-36}
  \ExampleSubFigure[0.5]{4-6-37}
  \ExampleSubFigure[1]{4-6-38}
  \ExampleSubFigure[1]{4-6-39}
  \ExampleSubFigure[0.5]{4-6-40}
  \ExampleSubFigure[0.5]{4-6-41}
  \ExampleSubFigure[0.5]{4-6-42}
  \ExampleSubFigure[0.5]{4-6-43}
  \ExampleSubFigure{4-6-44}%
  \ExampleSubFigure{4-6-45}%
  \ExampleSubFigure{4-6-46}

  \ExampleSubFigure[1]{4-7-1}
  \ExampleSubFigure[1]{4-7-2}
                                                   
  \ExampleSubFigure[1]{4-7-4}

  \ExampleSubFigure[0.5]{4-8-1}
  \ExampleSubFigure[0.25]{4-8-2}
  \ExampleSubFigure[0.25]{4-8-3}
  \ExampleSubFigure[1]{4-8-4}
  \ExampleSubFigure[1]{4-8-5}

  \ExampleSubFigure[0.5]{4-9-1}%
  \ExampleSubFigure[0.5]{4-9-2}

  \ExampleSubFigure[0.4]{4-10-1}
  \ExampleSubFigure[0.2]{4-10-2}
  \ExampleSubFigure[0.2]{4-10-3}
  \ExampleSubFigure[0.2]{4-10-4}
  \ExampleSubFigure[0.4]{4-10-5}
  \ExampleSubFigure[0.2]{4-10-6}
\input pst-poly.tex          %% Due to DC's bug, have to do this only here
  \ExampleSubFigure[0.3]{4-10-7}
  \ExampleSubFigure[1]{4-10-8}
  \ExampleSubFigure[1]{4-10-9}   %
  \ExampleSubFigure[1]{4-10-10}

\end{document}
