[NTG-context] Defined command troubles

Wolfgang Schuster schuster.wolfgang at gmail.com
Thu Sep 5 17:52:08 CEST 2013


Am 05.09.2013 um 17:42 schrieb Xan <dxpublica at telefonica.net>:

> Hi,
> 
> I just want to define a shortcut for framedtexts...
> 
> That's it:
> 
> \def\important{\dodoubleempty\doimportant}
> \def\doimportant[#1][#2]{\bgroup
>    \ifsecondargument
>       \startframedtext[background=#2,frame=off,width=broad]%
>       #1
>    \else
>       \startframedtext[background=screen,frame=off,width=broad]%
>       #1
>    \fi
>    \stopframedtext
>    \egroup}
> 
> It works perfectly with \important[Anything] but not with \important[Anything][red].

To set colors for the background you need “background color,backgroundcolor=<name>”.

> By the other hand, I want to define 'important' for use with start and end (startimportant ... \stopimportant) and not with single command. How can I get it?

\defineframedtext
  [important]
  [background=screen,
   frame=off,
   width=broad]

\starttext

\startimportant
\input ward
\stopimportant

\startimportant[background=color,backgroundcolor=red]
\input ward
\stopimportant

\stoptext

Wolfgang


More information about the ntg-context mailing list