[pstricks] conditional graphics

Herbert Voss Herbert.Voss at FU-Berlin.DE
Tue Nov 10 15:32:33 CET 2015


Am 10.11.2015 um 08:27 schrieb piatecki:
> 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 ?

\documentclass{article}
\usepackage{pst-barcode}

\newif\ifcollegues \colleguesfalse

\begin{document}

\begin{pspicture}(1.5in,1in)
	\psbarcode{978-85-85818-86-9}{includetext width=1.5
	height=1}{isbn}
\end{pspicture}	

\ifcollegues
\begin{verbatim}
\begin{pspicture}(1.5in,1in)
\psbarcode{978-85-85818-86-9}{includetext width=1.5 height=1}{isbn}
\end{pspicture}	
\end{verbatim}
\fi

\end{document}


\colleguestrue prints all \ifcollegues ..\fi

Herbert





>
> Thanks
>
> Cyrille Piatecki
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
> archive: http://www.tug.org/pipermail/pstricks/
>



More information about the PSTricks mailing list