From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/74040 Path: news.gmane.org!not-for-mail From: Michael Guravage Newsgroups: gmane.comp.tex.context Subject: typesetting verbatim code snippets in xml mkiv Date: Fri, 20 Jan 2012 08:43:41 +0100 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0166981429==" X-Trace: dough.gmane.org 1327045448 18223 80.91.229.12 (20 Jan 2012 07:44:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 20 Jan 2012 07:44:08 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Jan 20 08:44:04 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ro98k-0005IW-Up for gctc-ntg-context-518@m.gmane.org; Fri, 20 Jan 2012 08:44:03 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 45C68CB203; Fri, 20 Jan 2012 08:44:02 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tVAkTgAfc7nF; Fri, 20 Jan 2012 08:43:58 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A1CEDCB1E2; Fri, 20 Jan 2012 08:43:58 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2A389CB1E2 for ; Fri, 20 Jan 2012 08:43:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id p6SnlJst28D2 for ; Fri, 20 Jan 2012 08:43:43 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 509CDCB1D9 for ; Fri, 20 Jan 2012 08:43:43 +0100 (CET) Original-Received: from mail-tul01m020-f169.google.com (mail-tul01m020-f169.google.com [209.85.214.169]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id q0K7hfsk026936 for ; Fri, 20 Jan 2012 08:43:42 +0100 Original-Received: by obbta7 with SMTP id ta7so468116obb.14 for ; Thu, 19 Jan 2012 23:43:41 -0800 (PST) Original-Received: by 10.182.43.10 with SMTP id s10mr25716345obl.43.1327045421079; Thu, 19 Jan 2012 23:43:41 -0800 (PST) Original-Received: by 10.182.227.9 with HTTP; Thu, 19 Jan 2012 23:43:41 -0800 (PST) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rGnHHGhT - a9628ff1c336 - 20120120 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:74040 Archived-At: --===============0166981429== Content-Type: multipart/alternative; boundary=f46d04463116ec9d3d04b6f0d654 --f46d04463116ec9d3d04b6f0d654 Content-Type: text/plain; charset=UTF-8 In attempting to use Thomas's xml presentation style he presented at C5M, I would like to add the ability to typeset verbatim code snippets. In the xml:code setup example below, using commands like \startlinenumbering-\stoplinenumbering work fine, but using \starttyping-\stoptyping breaks. Can someone please enlighten me as to the correct way to accomplish this sort of thing? \startxmlsetups xml:codesetups \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{document|code}{xml:*} \stopxmlsetups \xmlregistersetup{xml:codesetups} % document \startxmlsetups xml:document \xmlflush{#1} \stopxmlsetups % xml code \startxmlsetups xml:code \starttyping \xmlflush{#1} \stoptyping \stopxmlsetups int x; x = 42; -- With kind regards, Michael Guravage --f46d04463116ec9d3d04b6f0d654 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In attempting to use Thomas's xml presentation style he presented at C5= M, I would like to add the ability to typeset verbatim code snippets. In th= e xml:code setup example below, using commands like \startlinenumbering-\st= oplinenumbering work fine, but using \starttyping-\stoptyping breaks. Can s= omeone please enlighten me as to the correct way to accomplish this sort of= thing?


\startxmlsetups xml:codesetups
=C2=A0 \xmlsetsetup{#1}{*}{-}
= =C2=A0 \xmlsetsetup{#1}{document|code}{xml:*}
\stopxmlsetups

\xml= registersetup{xml:codesetups}

% document
\startxmlsetups xml:docu= ment
=C2=A0 \xmlflush{#1}
\stopxmlsetups

% xml code
\startxmlsetups= xml:code
=C2=A0 \starttyping
=C2=A0=C2=A0=C2=A0 \xmlflush{#1}
=C2= =A0 \stoptyping
\stopxmlsetups



<?xml version=3D"1= .0" encoding=3D"UTF-8" standalone=3D"yes"?>
<document>
=C2=A0 <code>
=C2=A0=C2=A0=C2=A0 int x;
=C2= =A0=C2=A0=C2=A0 x =3D 42;
=C2=A0 </code>
</document>
<= br>
--
With kind regards,

Michael Guravage
--f46d04463116ec9d3d04b6f0d654-- --===============0166981429== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0166981429==--