ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Taco Hoekwater <taco@elvenkind.com>
Subject: Re: How to customize the default verbatim colors
Date: Sat, 27 Aug 2005 11:12:30 +0200	[thread overview]
Message-ID: <43102E7E.2070301@elvenkind.com> (raw)
In-Reply-To: <ecca0b2705082610171e1b764c@mail.gmail.com>

Eugene Toporov wrote:
> Thanks a lot, Taco!
> 
> I knew there should be a good way!
> Maybe it would be useful to add it to 
> http://contextgarden.net/Verbatim_text ?

Be my guest ;-)

> I also noticed that XML verbatim does not correctly handle tags with 
> namespace.
> In the xml like <ns:tag attribute="somevalue"> the "ns" gets colored 
> with tag-color, the "tag" with attr-color. I think the whole "ns:tag" 
> should be of tag-color.

How about this?

   %% allows XML tag names to continue after colons (namespaces)
   \input verb-xml % TRICK
   \appended\gdef\XMLsetspecials{\setpretty`\:=10 }

   \starttext
   \startXML
     <ns:tag attribute="somevalue" />
   \stopXML
   \stoptext
   %%

You can use  \setpretty`\:=17 instead, if you want the colon to be
indistinguisable from the rest of the tag.

The line I've marked 'TRICK' is needed to make sure that the original
definition of \XMLsetspecials is loaded before the new addition takes
place (verbatim definitions are loaded runtime).

Cheers, Taco

  reply	other threads:[~2005-08-27  9:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-24 23:55 Eugene Toporov
2005-08-25  8:40 ` Unable to make cont-en.fmt luigi.scarso
2005-08-25  9:07   ` Taco Hoekwater
2005-08-25  9:37     ` luigi.scarso
2005-08-25 10:43       ` Taco Hoekwater
2005-08-25  9:42   ` Vit Zyka
2005-08-25 11:23 ` How to customize the default verbatim colors Taco Hoekwater
2005-08-26 17:17   ` Eugene Toporov
2005-08-27  9:12     ` Taco Hoekwater [this message]
2005-08-29 11:06       ` Hans Hagen Outside

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=43102E7E.2070301@elvenkind.com \
    --to=taco@elvenkind.com \
    --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).