From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from cgl.ntg.nl (Cgl.ntg.nl [5.39.185.202]) by inbox.vuxu.org (Postfix) with ESMTP id 1C0A629D0C for ; Wed, 5 Jun 2024 12:01:52 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 7C669485097 for ; Wed, 5 Jun 2024 12:01:51 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Authentication-Results: cgl.ntg.nl (amavisd-new); dkim=fail (2048-bit key) reason="fail (message has been altered)" header.d=edenhauser.net Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GWHNtIsIfK2Y for ; Wed, 5 Jun 2024 12:01:49 +0200 (CEST) Received: from cgl.ntg.nl (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id DA7CF484C3C for ; Wed, 5 Jun 2024 12:01:01 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cgl.ntg.nl (Postfix) with ESMTP id 35ABA484BC8 for ; Wed, 5 Jun 2024 12:00:49 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at cgl.ntg.nl Received: from cgl.ntg.nl ([127.0.0.1]) by localhost (cgl.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LnACZpbLdz_k for ; Wed, 5 Jun 2024 12:00:48 +0200 (CEST) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=83.223.78.233; helo=mailout2.hostsharing.net; envelope-from=info@edenhauser.net; receiver= Received: from mailout2.hostsharing.net (mailout2.hostsharing.net [83.223.78.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cgl.ntg.nl (Postfix) with ESMTPS id 7ADD2484BC2 for ; Wed, 5 Jun 2024 12:00:47 +0200 (CEST) Received: from h02.hostsharing.net (h02.hostsharing.net [IPv6:2a01:37:1000::53df:5f1e:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by mailout2.hostsharing.net (Postfix) with ESMTPS id AF5B410189C85 for ; Wed, 5 Jun 2024 12:00:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=edenhauser.net; s=default; t=1717581647; bh=nGaJGKclNeJCtQ5Yg3W0lLp7yDL4Lo/hKWM3RXIuhvc=; h=Date:Subject:To:References:From:In-Reply-To:From; b=Pb2a/F1EaVts4PQDY6sxwNGjGwM02S4/ZNefMJQoh3iU6ER/8gasiHSoUQqyjX0yk guNjrCX3N6iwQsTc2AYo65dgIGyLOnvKqtwbt7hEQ9bm3VWI+Jhh+PGb+lAHbegcdf JWaOlcoCvBJHeM3o6Gtdx9qMRVLRHUXuK1iwfrvfNvt08NIw/+mUx5hDmQT3kKZnvE st5HF9oAldh+MxzFAunMLd3g/kgqjJAO7Zfpw3txP+7N31yBBQOvh+XjUw0PGY2HJV Om9y3K+xQvYQcbuw0V9ZwFxU35sCn1kwJGUkdf5fzWT5awWOcEVP2gX0b2rK/ITBGq ZGAZvTesk8rpQ== Received: from [172.20.10.2] (178.165.200.181.wireless.dyn.drei.com [178.165.200.181]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by h02.hostsharing.net (Postfix) with ESMTPSA id 1191A60C4DCD for ; Wed, 5 Jun 2024 12:00:45 +0200 (CEST) Message-ID: <8a3d411d-7f08-4fdb-9d8d-d017900902ba@edenhauser.net> Date: Wed, 5 Jun 2024 12:00:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: ntg-context@ntg.nl References: <9ec847c8-d48f-4a4a-bf32-de940af93934@edenhauser.net> <25ded686-f033-4a9e-a657-26abbb2bcfe7@gmx.es> <05f81be3-911e-4faa-9158-0b3ba26e4e1c@edenhauser.net> <76bfe0ea-91cd-498a-bc2b-1b282a10d104@xs4all.nl> From: Christoph Edenhauser In-Reply-To: <76bfe0ea-91cd-498a-bc2b-1b282a10d104@xs4all.nl> Message-ID-Hash: CPFJK3IK3RKIMO574KOGAY24A6W7ZLZL X-Message-ID-Hash: CPFJK3IK3RKIMO574KOGAY24A6W7ZLZL X-MailFrom: info@edenhauser.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list Reply-To: mailing list for ConTeXt users Subject: [NTG-context] Re: ConTeXt source from XML List-Id: mailing list for ConTeXt users Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: multipart/mixed; boundary="===============2674944130264241075==" This is a multi-part message in MIME format. --===============2674944130264241075== Content-Type: multipart/alternative; boundary="------------COIORBM5wibnIGjmwRat9VaI" This is a multi-part message in MIME format. --------------COIORBM5wibnIGjmwRat9VaI Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Dear Hand, dear list Am 04.06.24 um 22:09 schrieb Hans Hagen: > On 6/4/2024 9:21 PM, Christoph Edenhauser wrote: >> Dear Pablo, dear list >> >> That's great, thank you very much for your suggestion. >> That seems to me to be a very elegant solution to the next two >> problems that were actually still ahead of me. >> >> And now to my initial question, which I didn't specify precisely enough. >> >> I have the following workflow in mind: >> 1. I have an XML file (TEI-XML), >> 2. then, following your brilliant suggestion, I will create an >> xml-analyze-template.tex file and customise it. >> 3. As you suggest, now one would actually use >>      context --environment xml-analyze-template.tex file.xml >>      to typeset in a pdf file. >> But I would like to convert all the XML nodes into the ConTeXt >> typesetting language, and then edit/correct the text and maybe some >> structure in this *.tex file. >> >> And here comes my question: Can I use context to convert my XML-file >> 'file.xml' into a ConTeXt-file 'file.tex' instead of typesetting it >> as a 'file.pdf'. > > What do you want to tweak. HEre is the lowest level approach: > > > >    

test 1

>     >     >    

test 2

>     >    

test 3

>
> > But quite some can be done when processing and there are mechanisms to > inject e.g. page breaks using processing instruction. Probablyh not > all is documented. > > There is a xml-mkiv-tricks.tex file in the distribution (no pdf is > seems so I need to add that one.) > > Hans > > ----------------------------------------------------------------- >                                           Hans Hagen | PRAGMA ADE >               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands >        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > ----------------------------------------------------------------- I realise that it is somehow difficult for me to describe what I would like to achieve, perhaps what I have in mind is not even possible. Let' say i have an xml File with something like this St. Martin A comprehensive treatise
The medieval part of the church
I would now like to create a first file1.tex with all the necessary xmlsetups like e.g. something like this \startxmlsetupsxml:chapter \startchapter[title={\xmlflush{#1}}]\stopchapter \stopxmlsetups \startxmlsetupsxml:section \startsection[title={\xmlflush{#1}}]\stopsection \stopxmlsetups I can now generate a pdf file with context. But: My Question is, is it possible to generate a second context file2.tex with the help of this first xml-mapping file1.tex, where all the xml-nodes from the xml file are mapped to contex commands which then looks something like this: \starttext \startchapter[title=St. Martin]\stopchapter \startsection[title=The medieval part of the church]\stopsection \stoptext I would then like to edit the Text in such a more "TeXish" result  manually, e.g. insert small spaces as in ‘St.\,Martin’, explain unknown words in \footnote{comment}, etc. I know you could or even should do the text corrections in the xml file, but XML would overwhelm my proofreader. (He has learnt to leave LaTeX code untouched, that should then work with ConTeXt code as well). So for me, the main reason for having a TeX-ish file2.tex is, that the Text could be corrected directly from the proofreader in this file2.tex file, but won't do that in the xml file. And now a second approach to my question: Are all these \startxmlsetups like '\startxmlsetup xml:chapter' internally mapped to standard context commands like \startchapter ... \stopchapter before they are converted to pdf? If this is the case, can this intermediate context representation be exported, and how would this be done? Thank you very much for your help, best regards, Christoph --------------COIORBM5wibnIGjmwRat9VaI Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Dear Hand, dear list

Am 04.06.24 um 22:09 schrieb Hans Hagen:
On 6/4/2024 9:21 PM, Christoph Edenhauser wrote:
Dear Pablo, dear list

That's great, thank you very much for your suggestion.
That seems to me to be a very elegant solution to the next two problems that were actually still ahead of me.

And now to my initial question, which I didn't specify precisely enough.

I have the following workflow in mind:
1. I have an XML file (TEI-XML),
2. then, following your brilliant suggestion, I will create an xml-analyze-template.tex file and customise it.
3. As you suggest, now one would actually use
     context --environment xml-analyze-template.tex file.xml
     to typeset in a pdf file.
But I would like to convert all the XML nodes into the ConTeXt typesetting language, and then edit/correct the text and maybe some structure in this *.tex file.

And here comes my question: Can I use context to convert my XML-file 'file.xml' into a ConTeXt-file 'file.tex' instead of typesetting it as a 'file.pdf'.

What do you want to tweak. HEre is the lowest level approach:

<?xml version='1.0'?>
<whatever>
    <p>test 1</p>
    <?context-tex-directive start ?>
    <?context-tex-directive red   ?>
    <p>test 2</p>
    <?context-tex-directive stop ?>
    <p>test 3</p>
</whatever>

But quite some can be done when processing and there are mechanisms to inject e.g. page breaks using processing instruction. Probablyh not all is documented.

There is a xml-mkiv-tricks.tex file in the distribution (no pdf is seems so I need to add that one.)

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------


I realise that it is somehow difficult for me to describe what I would like to achieve, perhaps what I have in mind is not even possible.

Let' say i have an xml File with something like this

<?xml version='1.0'?>
<chapter>St. Martin</chapter>
<paragraph>A comprehensive treatise</paragraph>
<section>The medieval part of the church</section>

I would now like to create a first file1.tex with all the necessary xmlsetups like e.g. something like this

\startxmlsetups xml:chapter
\startchapter[title={\xmlflush{#1}}]\stopchapter
\stopxmlsetups
\startxmlsetups xml:section
\startsection[title={\xmlflush{#1}}]\stopsection
\stopxmlsetups

I can now generate a pdf file with context. But: 

My Question is, is it possible to generate a second context file2.tex with the help of this first xml-mapping file1.tex, where all the xml-nodes from the xml file are mapped to contex commands which then looks something like this:

\starttext
\startchapter[title=St. Martin] \stopchapter
\startsection[title=The medieval part of the church]\stopsection
\stoptext

I would then like to edit the Text in such a more "TeXish" result  manually, e.g. insert small spaces as in ‘St.\,Martin’, explain unknown words in \footnote{comment}, etc.

I know you could or even should do the text corrections in the xml file, but XML would overwhelm my proofreader. (He has learnt to leave LaTeX code untouched, that should then work with ConTeXt code as well). So for me, the main reason for having a TeX-ish file2.tex is, that the Text could be corrected directly from the proofreader in this file2.tex file, but won't do that in the xml file.

And now a second approach to my question:
Are all these \startxmlsetups like '\startxmlsetup xml:chapter' internally mapped to standard context commands like \startchapter ... \stopchapter before they are converted to pdf?
If this is the case, can this intermediate context representation be exported, and how would this be done?

Thank you very much for your help,

best regards, Christoph

--------------COIORBM5wibnIGjmwRat9VaI-- --===============2674944130264241075== 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 / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror) archive : https://github.com/contextgarden/context wiki : https://wiki.contextgarden.net ___________________________________________________________________________________ --===============2674944130264241075==--