ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Richard Gabriel <rgabriel@kerio.com>
Subject: Re: XML in ConTeXt & verbatim text
Date: Wed, 15 Dec 2004 16:43:31 +0100	[thread overview]
Message-ID: <41C05BA3.9010507@kerio.com> (raw)
In-Reply-To: <20041214172728.20974@news.comp.lancs.ac.uk>


[-- Attachment #1.1: Type: text/plain, Size: 1598 bytes --]

Hi Adam,

I did so right now (thanks for the hint!).
But in that file ther's only solved a case when each line of the 
verbatim text is placed in a special tag:

<verbatim>
  <line>Dit \is nogal verbatim !</line>
  <line>Dit is {nogal} verbatim !</line>
  <line>Dit is <nogal> verbatim !</line>
</verbatim>

This is trivial because you can pass the contents of each <line> element 
as an argument to the \type command ( \defineXMLargument[line]{\type} )

But this solution is unusable e.g. for longer program or configuration 
file listings, and, mainly, the DocBook DTD doesn't define such tags.
I need to process multiline verbatims enclosed in a single tag:

<programlisting>
Line 1
      Line 2
Line 3
</programlisting>

---
Of course I have some "dirty" workaround, but the result is really ugly...

\defineXMLenvironment[programlisting]{
  \bgroup
  \startpacked
  \tttf
  \obeylines\obeyspaces\obeytabs
}{
  \stoppacked
  \egroup
}

The line breaks are processed correctly. But all the tabs and spaces are 
treated as a single space. It seems the \obeyspaces and \obeytabs 
command are ignored or they do not work the way I'd expect. This will 
totally break the indentation and tabulation of the verbatim text...


-Richard





Adam Lindsay wrote:

>Richard Gabriel said this at Tue, 14 Dec 2004 16:48:05 +0100:
>
>  
>
>>So I defined a macro to process the <programlisting> tag from the XML file:
>>\defineXMLenvironment[programlisting]{\starttyping}{\stoptyping}
>>    
>>
>
>Richard, 
>
>Have you taken a look at x-contml to see how it solves this problem with
>verbatim?
>
>adam
>  
>

[-- Attachment #1.2: Type: text/html, Size: 2310 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

  reply	other threads:[~2004-12-15 15:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-14 15:48 Richard Gabriel
2004-12-14 17:27 ` Adam Lindsay
2004-12-15 15:43   ` Richard Gabriel [this message]
2004-12-15 16:57     ` Hans Hagen
2004-12-16 15:36       ` Richard Gabriel
2004-12-16 16:02         ` Hans Hagen
2004-12-17  7:50           ` Richard Gabriel

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=41C05BA3.9010507@kerio.com \
    --to=rgabriel@kerio.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).