Re: Campi si ma più intelligenti

#95780
franen
Partecipante
    Up
    0
    Down
    ::


    `\RequirePackage{filecontents}
    \begin{filecontents*}{robyclass.cls}
    \NeedsTeXFormat{LaTeX2e}[2005/12/01]
    \ProvidesClass{robyclass}[2014/08/01 v. 0.1 Classe per le prove di Roberto]
    \DeclareOption*{\PassOptionsToClass{\CurrentOption}{book}}
    \ProcessOptions\relax
    \LoadClass[a4paper]{book}
    \RequirePackage{etoolbox, xcolor}
    \newcommand{\set}[2]{\expandafter\def\csname robitex@#1\endcsname{#2}}
    \newcommand{\get}[1]{%
    \ifcsdef{robitex@#1}%
    {\sottolinea{\csname robitex@#1\endcsname}}%
    {\ClassError{robyclass}{Attento, il comando #1 non è definito!}{}}}
    \newcommand{\sottolinea}[1]{\colorbox{green}{#1}}
    \end{filecontents*}
    \documentclass{robyclass}
    \begin{document}
    \set{prova}{re!}
    \get{prova}
    \end{document}`

    Go to top