From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/37833 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: "Semi-verbatim" - preserve whitespace - don't escape characters Date: Sat, 8 Dec 2007 15:51:55 +0100 Message-ID: <20071208155155.70af344f.schuster.wolfgang@googlemail.com> References: <115224fb0712080124h24b2a37h64ed38a14e7b5245@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1197126702 20234 80.91.229.12 (8 Dec 2007 15:11:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Dec 2007 15:11:42 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sat Dec 08 16:11:51 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1J11LH-0000tz-2L for gctc-ntg-context-518@m.gmane.org; Sat, 08 Dec 2007 16:11:47 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C7E3C1FBB5; Sat, 8 Dec 2007 16:11:21 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 06252-02-2; Sat, 8 Dec 2007 16:10:41 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 258A11FAF5; Sat, 8 Dec 2007 16:10:41 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 575E61FB23 for ; Sat, 8 Dec 2007 16:10:39 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04112-03 for ; Sat, 8 Dec 2007 16:10:04 +0100 (CET) Original-Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by ronja.ntg.nl (Postfix) with ESMTP id 4F6E31FC45 for ; Sat, 8 Dec 2007 15:51:59 +0100 (CET) Original-Received: by nf-out-0910.google.com with SMTP id b2so470189nfb for ; Sat, 08 Dec 2007 06:51:59 -0800 (PST) Original-Received: by 10.86.97.7 with SMTP id u7mr3389102fgb.1197125519081; Sat, 08 Dec 2007 06:51:59 -0800 (PST) Original-Received: from rover ( [84.149.68.179]) by mx.google.com with ESMTPS id 3sm988257fge.2007.12.08.06.51.57 (version=SSLv3 cipher=OTHER); Sat, 08 Dec 2007 06:51:57 -0800 (PST) In-Reply-To: X-Mailer: Sylpheed 2.4.7 (GTK+ 2.10.14; i686-pc-mingw32) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:37833 Archived-At: On Sat, 8 Dec 2007 09:44:52 -0500 (EST) Aditya Mahajan wrote: > On Sat, 8 Dec 2007, Wolfgang Schuster wrote: > > > 2007/12/7, dexterclarke@safe-mail.net : > >> Hi. > >> > >> I'm working on a document processor that has multiple backends > >> for different output formats (XHTML, nroff, plain text, ConTeXt). > >> > >> The processor uses s-expression syntax with commands such as: > >> > >> (para "this is a paragraph") > >> > >> The various backends then convert this statement in their own > >> way (using

tags in XHTML, for example). > >> > >> There is one command that allows rendering of external files > >> based on whatever backend is selected: > >> > >> (render "file") > >> > >> The XHTML backend includes "file", escaping all 'illegal' characters > >> such as <, >, & etc. The ConTeXt backend reads the file and also > >> escapes characters, placing their TeX equivalent in the output - > >> $\}$, $\backslash$ etc. Both backends place the contents of "file" > >> directly in the output, they don't, for example, use the > >> tags in XHTML, or any ConTeXt file inclusion directives. This is > >> desirable for many reasons that are out of scope for this post... > >> > >> The problem I am having is that one may do this: > >> > >> (para-verbatim (render "file")) > >> > >> The para-verbatim tag is meant to preserve whitespace in the output. > >> > >> For example, this becomes: > >> > >>
contents of file
> >> > >> in the XHTML output. Unfortunately, I've hit a wall when it comes > >> to the ConTeXt equivalent: The ConTeXt backend reads > >> in "file" and prints it to the output, escaping all reserved TeX > >> characters, as mentioned earlier, but unfortunately there doesn't > >> seem to be the equivalent of: > >> > >> \preservewhitespace > >> contents of file > >> \stoppreservingwhitespace > >> > >> "\starttyping" is too heavy handed in that it also escapes characters > >> rather than just preserving whitespace (they've already been escaped > >> by my document processor, as mentioned earlier). What I need is a > >> directive that says "preserve whitespace" but does not escape reserved > >> TeX characters. > >> > >> Does any such thing exist in ConTeXt? Unfortunately, I'm inexperienced > >> with TeX so I don't know how feasible this is. > > \setuplines[space=yes] > > followed by > > > \startlines > > verbatin text > > \stoplines > > Note that everything between start-stop lines is normal tex code. you mean start/stoplines need style and color keys. > Aditya Wolfgang ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________