[cstex] ako prepisat kod do makra s 2 parametrami
peter knezel
peter.knezel at gmail.com
Sun Jul 4 15:54:28 CEST 2021
Dobry den pan Wagner,
vdaka za pripomienky. Prepisal som tex subor:
\documentclass{article}
\usepackage{framed,color,verbatim}
%...define color of command background for next environment
\newenvironment{com}%
{\snugshade\verbatim}%
{\endverbatim\endsnugshade}
\newenvironment{res}%
{\snugshade\verbatim}%
{\endverbatim\endsnugshade}
\newcommand{\skus}[2]{
\setlength\topsep{-5pt}
\definecolor{shadecolor}{rgb}{1, .49, .5}
\begin{com}
#1
\end{com}
\definecolor{shadecolor}{rgb}{.66, .66, .9}
\begin{res}
#2
\end{res}
}
\begin{document}
\skus{prikaz}{vysledok}
\skus{prikazx}{vysledokx}
\\
Vzor - priamo zapisany text
\setlength\topsep{-5pt}
\definecolor{shadecolor}{rgb}{1, .49, 0.0}
\begin{com}
line one
\end{com}
\definecolor{shadecolor}{rgb}{.66, .66, .66}
\begin{res}
res line one
res line two
res line two
\end{res}
text pisany za tabulkou.
\end{document}
konci chybou:
)
Runaway argument?
vysledok \end {res}
! Paragraph ended before \verbatim@ was complete.
<to be read again>
\par
l.28 \skus{prikaz}{vysledok}
a) aspon nieco dostanem na vystupe - aj ked zly vysledok, ak pouzijem v 14.
riadku:
\newcommand{\skus}[2]{#1}{
alebo:
b) \newcommand{\skus}[2]{#1#2}{
S pozdravom,
PeterKnezel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.felk.cvut.cz/pipermail/cstex/attachments/20210704/0656a773/attachment.htm>
More information about the csTeX
mailing list