ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: processing style inside verbatim in XML
Date: Fri, 21 Oct 2011 22:18:35 +0200	[thread overview]
Message-ID: <CALBOmsZyN-YzjqhWXGo4x_F=p2bZh4R=xB1BJtw0at7yQAK6BA@mail.gmail.com> (raw)
In-Reply-To: <CALBOmsbUjEJkuRJAAgsdKk6_FMjGRe_E3fSniqr9gOMVWfHixA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

Hello,

Is there any simple way to typeset the following example properly in ConTeXt?

I have an example of text that has to obey lines and spaces, but I
would like to apply some color to make it more readable. The
attachment contains an example of HTML which displays fine in my
browser, and it should look similar with ConTeXt.

I have problems with literal typesetting of <span class=...> (that
should have applied style instead), but maybe I only have wrong
settings in my parser.

When I use \xmlsetfunction{main}{pre}{lxml.displayverbatim}, then I
cannot color the numbers. When I use, according to Wolfgang's
suggestion,

\startxmlsetups pre
\setuplines[style=mono,space=yes]
\startlines
\xmlflush{#1}
\stoplines
\stopxmlsetups

then all the spaces are eaten up by XML parser (or somewhere else), so
that I don't get the desired result. Any ideas about this?

I'm also sending a self-contained example with \setuplines which
doesn't really work in the desired way.

Thank you very much,
    Mojca

[-- Attachment #2: hyp.html --]
[-- Type: text/html, Size: 936 bytes --]

[-- Attachment #3: hyp.tex --]
[-- Type: application/x-tex, Size: 1432 bytes --]

[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

       reply	other threads:[~2011-10-21 20:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CALBOmsbUjEJkuRJAAgsdKk6_FMjGRe_E3fSniqr9gOMVWfHixA@mail.gmail.com>
2011-10-21 20:18 ` Mojca Miklavec [this message]
2011-10-24 11:59   ` Hans Hagen

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='CALBOmsZyN-YzjqhWXGo4x_F=p2bZh4R=xB1BJtw0at7yQAK6BA@mail.gmail.com' \
    --to=mojca.miklavec.lists@gmail.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).