[cstex] ako prepisat kod do makra s 2 parametrami

peter knezel peter.knezel at gmail.com
Sun Jul 4 00:40:10 CEST 2021


Zdravim,

dalo by sa prepisat kod nizsie:

\documentclass{article}
\usepackage{framed,color,verbatim}

\newenvironment{com}%
   {\snugshade\verbatim}%
   {\endverbatim\endsnugshade}

\newenvironment{res}%
   {\snugshade\verbatim}%
   {\endverbatim\endsnugshade}

\begin{document}

\setlength\topsep{-3pt}
\definecolor{shadecolor}{rgb}{1, .49, 0.0}
\begin{com}
prikaz
\end{com}
\definecolor{shadecolor}{rgb}{.66, .66, .66}
\begin{res}
vysledok prikazu
\end{res}

\end{document}

tak, ze zadefinujem novy prikaz s 2 parametrami este
nad riadkom:
\begin{document}


newcommand{\skus}[2]{#1}{

\setlength\topsep{-3pt}

\definecolor{shadecolor}{rgb}{1, .49, .5}

\begin{com}

#1

\end{com}

\definecolor{shadecolor}{rgb}{.66, .66, .9}

\begin{res}

#2

\end{res}

}

a neskor zavolam:

\skus{prikaz}{vysledok}

\skus{prikaz2}{vysledok2}

Zatial sa mi nedari dostat vhodny vysledok.
Dakujem vopred za pomoc,

Peter Knezel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.felk.cvut.cz/pipermail/cstex/attachments/20210704/e7e983b7/attachment.htm>


More information about the csTeX mailing list