From: Hans Hagen <pragma@wxs.nl>
Cc: ntg-context@ntg.nl
Subject: Re: more problems ;-)
Date: Fri, 09 Feb 2001 10:51:07 +0100 [thread overview]
Message-ID: <3.0.6.32.20010209105107.01924c90@server-1> (raw)
In-Reply-To: <3A839AFA.60C7DF83@elvenkind.com>
[-- Attachment #1: Type: text/plain, Size: 1176 bytes --]
At 08:23 AM 2/9/01 +0100, Taco Hoekwater wrote:
>Uwe Koloska wrote:
>>
>> I get the error:
>> Runaway argument?
>> {
>> ! Paragraph ended before \command was complete.
>> <to be read again>
>> \par
>> l.39 \command{\par
>> }).
>
>This is standard TeX behaviour: If you don't explicitly allow
>\par's in arguments (by using \long\def), you get a runaway
>error it the \par appears in the argument anyway.
>
>\define does not have support for prefixes, so you need
>to use the old-fashioned TeX command:
>
>\long\def\command#1{\type{#1}}
>
>or, alternatively, you can use \let:
>
>\let\command\type
>
>which is faster (it assigns \command to the current meaning of \type)
If you want more fancy things:
\define\mytype
{\bgroup**\processinlineverbatim{**\egroup}}
\mytype {test \par \rubish{}}
Now, what you really want is:
\setupcolors[state=start]
\definetype[rubish][color=red]
\rubish{some tex \xxtext{} met $math$}
\definetype[morerubish][color=green,style=\ttsl]
\morerubish{some tex \xxtext{} met $math$}
see attachment [these kind of extensions fall in the category trivial]
Hans
[-- Attachment #2: moretype.tex --]
[-- Type: text/plain, Size: 1762 bytes --]
% output=pdftex interface=en
\unprotect
\def\setuptype%
{\dodoubleempty\dosetuptype}
\def\dosetuptype[#1][#2]%
{\ifsecondargument
\getparameters[\??ty#1][#2]%
\else
\getparameters[\??ty][#1]%
\fi}
\def\definetype%
{\dodoubleempty\dodefinetype}
\def\dodefinetype[#1][#2]%
{\unexpanded\setvalue{#1}{\dotype{#1}}%
\copyparameters
[\??ty#1][\??ty]
[\c!spatie,\c!kleur,\c!letter,\c!pagina,\c!tab,\c!optie]%
\getparameters[\??ty#1][#2]}
\let\@@currenttype\empty
\def\initializetype%
{\let\obeylines=\ignorelines
\setupcommonverbatim{\??ty\@@currenttype}%
\setupinlineverbatim}
\unexpanded\def\type%
{\dotype\empty}
\def\dotype#1%
{\bgroup
\def\@@currenttype{#1}%
\catcode`\<=\@@other
\catcode`\>=\@@other
\futurelet\next\dodotype}
\def\dodotype%
{\ifx\next\bgroup
\initializetype
\initializetypegrouping
\def\next%
{\afterassignment\protectfirsttype\let\next=}%
\else\if\next<%
\doifelsevalue{\??ty\@@currenttype\c!optie}{\v!geen}
{\initializetype
\setupnotypegrouping
\def\next%
{\let\next=}}
{\def\next<##1%
{\initializetype
\if##1<%
\else
\setupalternativetypegrouping
##1%
\fi}}%
\else
\def\next##1%
{\initializetype
\catcode`##1=\@@endgroup}%
\fi\fi
\verbatimcolor
\next}
\def\setgroupedtype%
{\initializetype
\catcode`\{=\@@begingroup
\catcode`\}=\@@endgroup}
\protect
\starttext
\setupbodyfont[pos]
\setupcolors[state=start]
\definetype[rubish][color=red]
\rubish{some tex \xxtext{} met $math$}
\definetype[morerubish][color=green,style=\ttsl]
\morerubish{some tex \xxtext{} met $math$}
\stoptekst
[-- Attachment #3: moretype.pdf --]
[-- Type: application/pdf, Size: 3142 bytes --]
[-- Attachment #4: Type: text/plain, Size: 370 bytes --]
-------------------------------------------------------------------------
Hans Hagen | PRAGMA ADE | pragma@wxs.nl
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
prev parent reply other threads:[~2001-02-09 9:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-08 18:03 Uwe Koloska
2001-02-09 7:23 ` Taco Hoekwater
2001-02-09 9:51 ` Hans Hagen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3.0.6.32.20010209105107.01924c90@server-1 \
--to=pragma@wxs.nl \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).