# [pstricks] conditional graphics

Luis Sequeira lfsequeira at gmail.com
Tue Nov 10 12:32:43 CET 2015

> I am writting a course and I want that some graphics appears in the text
> I give to my collegues but not in the text I give to my students.
>
> I am thinking of a command which take a general boolean parameter
> defined in the preambula and wich will be interpreted as the
> verbatim.sty command
>
> \begin{comment}                           %\begin{comment}
>                                            or
> \end{comment}                               %\end{comment}
>
> according to the value of the general parameter.
>
> I have tried to do this with ifhen.sty and other package which implement
> conditionals but, obviously, It doesn't work. Does somebody has an idea ?
>
> Thanks
>
> Cyrille Piatecki

I have no problem making something like this work with the ifthen package.
Here is a minimal example. Change the definition of \colleague to 0 if you want to compile the student version.
(I did try this using actual pstricks code in the then and else parts and it worked, too)

\documentclass{article}

\usepackage{ifthen}
\usepackage{pstricks}

\newcommand{\colleague}{1}

\begin{document}
\ifthenelse{\colleague = 1}{pspicture code}{something else}
\end{document}

Luis Sequeira