* [NTG-context] ConTeXt source from XML @ 2024-06-04 11:51 Christoph Edenhauser 2024-06-04 15:21 ` [NTG-context] " Pablo Rodriguez via ntg-context 0 siblings, 1 reply; 22+ messages in thread From: Christoph Edenhauser @ 2024-06-04 11:51 UTC (permalink / raw) To: ntg-context Dear list, I am currently trying to get into Context and XML. I would like to do the typographical fine-tuning in Context and not in the XML document. My question is: Is it possible to have ConTeXt output a (preliminary) ConTeXt file instead of typesetting a PDF file, for further editing? Christoph ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-04 11:51 [NTG-context] ConTeXt source from XML Christoph Edenhauser @ 2024-06-04 15:21 ` Pablo Rodriguez via ntg-context 2024-06-04 19:21 ` Christoph Edenhauser 0 siblings, 1 reply; 22+ messages in thread From: Pablo Rodriguez via ntg-context @ 2024-06-04 15:21 UTC (permalink / raw) To: ConTeXt users; +Cc: Pablo Rodriguez On 6/4/24 13:51, Christoph Edenhauser wrote: > Dear list, > > I am currently trying to get into Context and XML. I would like to do > the typographical fine-tuning in Context and not in the XML document. My > question is: Is it possible to have ConTeXt output a (preliminary) > ConTeXt file instead of typesetting a PDF file, for further editing? Hi Christoph, not clear to me whether you meant an environment (a format file) with the ConTeXt generated file. In that case, this might help: context --extra=xml --analyze --template your-file.xml With that template, you may run: context --environment=xml-analyze-template.tex your-file.xml BTW, there are two typos in xml-analyze-template.tex (lines 8-9): - \startxmlsetup should read \startxmlsetups. - \xmlsetsetups should read \xmlsetsetup. But consider that this only flushes text with no formatting (you will have all text in a single paragraph. If this is not what you need, a more detailed (or simply more verbose) explanation) might help. Just in case it might help, Pablo ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-04 15:21 ` [NTG-context] " Pablo Rodriguez via ntg-context @ 2024-06-04 19:21 ` Christoph Edenhauser 2024-06-04 20:09 ` Hans Hagen 0 siblings, 1 reply; 22+ messages in thread From: Christoph Edenhauser @ 2024-06-04 19:21 UTC (permalink / raw) To: Pablo Rodriguez via ntg-context [-- Attachment #1.1: Type: text/plain, Size: 1752 bytes --] 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'. Best regards, Christoph Am 04.06.24 um 17:21 schrieb Pablo Rodriguez via ntg-context: > Hi Christoph, > > not clear to me whether you meant an environment (a format file) with > the ConTeXt generated file. > > In that case, this might help: > > context --extra=xml --analyze --template your-file.xml > > With that template, you may run: > > context --environment=xml-analyze-template.tex your-file.xml > > BTW, there are two typos in xml-analyze-template.tex (lines 8-9): > > - \startxmlsetup should read \startxmlsetups. > - \xmlsetsetups should read \xmlsetsetup. > > But consider that this only flushes text with no formatting (you will > have all text in a single paragraph. > > If this is not what you need, a more detailed (or simply more verbose) > explanation) might help. > > Just in case it might help, > > Pablo [-- Attachment #1.2: Type: text/html, Size: 2384 bytes --] [-- Attachment #2: Type: text/plain, Size: 511 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-04 19:21 ` Christoph Edenhauser @ 2024-06-04 20:09 ` Hans Hagen 2024-06-05 10:00 ` Christoph Edenhauser 2024-06-05 16:30 ` Pablo Rodriguez via ntg-context 0 siblings, 2 replies; 22+ messages in thread From: Hans Hagen @ 2024-06-04 20:09 UTC (permalink / raw) To: ntg-context 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-04 20:09 ` Hans Hagen @ 2024-06-05 10:00 ` Christoph Edenhauser 2024-06-05 12:16 ` Henning Hraban Ramm 2024-06-05 14:34 ` Pablo Rodriguez via ntg-context 2024-06-05 16:30 ` Pablo Rodriguez via ntg-context 1 sibling, 2 replies; 22+ messages in thread From: Christoph Edenhauser @ 2024-06-05 10:00 UTC (permalink / raw) To: ntg-context [-- Attachment #1.1: Type: text/plain, Size: 4123 bytes --] 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 \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 [-- Attachment #1.2: Type: text/html, Size: 8304 bytes --] [-- Attachment #2: Type: text/plain, Size: 511 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-05 10:00 ` Christoph Edenhauser @ 2024-06-05 12:16 ` Henning Hraban Ramm 2024-06-05 14:13 ` Christoph Edenhauser 2024-06-05 15:08 ` Hans Hagen 2024-06-05 14:34 ` Pablo Rodriguez via ntg-context 1 sibling, 2 replies; 22+ messages in thread From: Henning Hraban Ramm @ 2024-06-05 12:16 UTC (permalink / raw) To: ntg-context Am 05.06.24 um 12:00 schrieb Christoph Edenhauser: > 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 Hi, I don’t find it hard to understand, but I don’t think it’s possible within ConTeXt (while Hans keeps surprising me). Maybe try XSLT or pandoc. The latter can already read DocBook and write ConTeXt; it doesn’t read TEI (yet). There are also XSL style sheets for TEI, e.g. https://github.com/TEIC/Stylesheets I don’t know if you would loose too much information going TEI-(something else)-ConTeXt. Maybe it makes sense to adapt the LaTeX stylesheets. Hraban ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-05 12:16 ` Henning Hraban Ramm @ 2024-06-05 14:13 ` Christoph Edenhauser 2024-06-05 15:08 ` Hans Hagen 1 sibling, 0 replies; 22+ messages in thread From: Christoph Edenhauser @ 2024-06-05 14:13 UTC (permalink / raw) To: ntg-context Dear Hraban, dear List Thank you for your suggestions. I suppose, it would have been too nice if I could have left the XSLT path. Thank you very much for your patience and help, Christoph ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-05 12:16 ` Henning Hraban Ramm 2024-06-05 14:13 ` Christoph Edenhauser @ 2024-06-05 15:08 ` Hans Hagen 1 sibling, 0 replies; 22+ messages in thread From: Hans Hagen @ 2024-06-05 15:08 UTC (permalink / raw) To: ntg-context On 6/5/2024 2:16 PM, Henning Hraban Ramm wrote: > Am 05.06.24 um 12:00 schrieb Christoph Edenhauser: >> 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 > > Hi, I don’t find it hard to understand, but I don’t think it’s possible > within ConTeXt (while Hans keeps surprising me). well, as one needs to do some work one can as well do this: % oeps.tex \startbuffer[test] <something> <what> test </what> </something> \stopbuffer \startxmlsetups xml:mysetups \xmlsetsetup{\xmldocument}{*}{xml:*} \stopxmlsetups \xmlregistersetup{xml:mysetups} \startxmlsetups xml:something \tex{StartSomething}\par \xmlflush{#1}\par \tex{StopSomething}\par \stopxmlsetups \startxmlsetups xml:what \tex{StartWhat}\par \xmlflush{#1}\par \tex{StopWhat}\par \stopxmlsetups \setuppapersize[A1] \setupbodyfont[dejavu,ss,1pt] \setuplayout[tight] \setupalign[verytolerant,flushleft,nothyphenated] \starttext \xmlprocessbuffer{main}{test}{} \stoptext and then run >context oeps >mutool draw -F txt oeps.pdf and get \StartSomething \StartWhat test \StopWhat \StopSomething so now you need to wikify it ... 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-05 10:00 ` Christoph Edenhauser 2024-06-05 12:16 ` Henning Hraban Ramm @ 2024-06-05 14:34 ` Pablo Rodriguez via ntg-context 2024-06-05 18:23 ` Christoph Edenhauser 1 sibling, 1 reply; 22+ messages in thread From: Pablo Rodriguez via ntg-context @ 2024-06-05 14:34 UTC (permalink / raw) To: ntg-context; +Cc: Pablo Rodriguez On 6/5/24 12:00, Christoph Edenhauser wrote: > [...] > 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. Hi Christoph, as far as I know (and as Hraban has already mentioned), this is not possible. Either XSLT or pandoc would be a way to do that. That being said, I would avoid conversion (a second source) in all cases. I use ConTeXt to typeset XML sources typing Markdown sources. pandoc generates XML and then ConTeXt typesets these XML sources. > 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: I‘m afraid this is not possible (it works in a different way) > 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. Different spaces are Unicode characters. As entities, &nnbsp; or   (narrow no-breaking space and thin space, respectively). > 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. I don’t mean the proofreader personally, but TeX code may not be inherenlty more readable that XML code. Compile the following: \starttext \startXML <?xml version="1.0"?> <chapter class="foo">St.&nnbsp;Martin</chapter> <paragraph id="first-par">A comprehensive treatise</paragraph> <section other="anoter">The medieval part of the church</section> \stopXML \startTEX \starttext \startchapter[title=St.\, Martin] \stopchapter \startsection[title=The medieval part of the church]\stopsection \stoptext \stopTEX \stoptext I think that a text editor with reasonable highlighting for XML is key to your issue. I mean, XML sources tend to be highlighted leaving pure text as uncolored and unformatted (no bold or italics). In that case, I think the text to be proofread may be recognized as not having any format at all (besides not enclosed inside "<" and ">"). > 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? No, these are formatting commands after the mapping. In short, there are three steps involved in XML typesetting. First, you select which elements you would like to select from the XML source in an XML setup (with a mapping to your configuration commands). Second, you register this XML setup. Third, your configure the selected elements with ConTeXt commands. Here is a sample (using a buffer instead of an external file): \startbuffer[demo] <foo> <bar>line 1</bar> <bar>line 2</bar> <bar>line 3</bar> </foo> \stopbuffer \starttext \startxmlsetups abc:def \xmlsetsetup{#1}{foo|bar}{xyz:*} \stopxmlsetups \xmlregistersetup{abc:def} \startxmlsetups xyz:foo \xmlflush{#1} \stopxmlsetups \startxmlsetups xyz:bar \startparagraph \xmlflush{#1} \stopparagraph \stopxmlsetups \xmlprocessbuffer{main}{demo}{} \stoptext First of all, XML has no hardcoded names for any element (from a certain point of view, XML are only rules on how to use the "<>" tags). This is why, <foo> and <bar> are perfectly valid element names (although they have no meaning for people). Second, the mapping may use any name for destination setups. \xmlsetsetup does the mappings, the second group of parentheses contains the lpath (an Lua version of XPath [how XML is selected]) and the third group of parentheses is setups. The command \xmlsetsetup{#1}{foo|bar}{xyz:*} above is bound to existing elements (or paths) in the XML source, but both "xyz:foo" and "xzy:bar" may read as the user wants. Third, after that you need specify the setup for each mapping (or it won’t appear in your final document). The setup is what you defined as the second part of the mapping, may it be "xml:title" or "xyz:bar". Nothing here is hardcoded. XML is not HTML (elements with meaning). In order to deal with XML, ConTeXt has to provide the tools to select elements (and more complex constructs) and map them to configurable setups. How both tools (construct selection and setup configurations) may be deployed, this is up to each individual. Hardcoding this would be a real problem in the short run. > If this is the case, can this intermediate context representation be > exported, and how would this be done? Nice try, but I’m afraid this is not how it works. I hope my explanation may be minimally clear to understand why your approach is different from what ConTeXt offers. Feel free to ask, if my explanation wasn’t clear enough. I hope it helps, Pablo PS: if now the fancy thing may be about digital competences, the ability to read XML sources is way more useful than being able to read TeX 😅. ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-05 14:34 ` Pablo Rodriguez via ntg-context @ 2024-06-05 18:23 ` Christoph Edenhauser 2024-06-06 15:33 ` Pablo Rodriguez via ntg-context 0 siblings, 1 reply; 22+ messages in thread From: Christoph Edenhauser @ 2024-06-05 18:23 UTC (permalink / raw) To: ntg-context Dear Pablo, Thank you very much for your very clear, detailed and elaborate explanations. - Over the next few days I will meditate on the ConTeXt way to handle XML and on my workflow and take a look at lpath (never heard of it). And somehow I have the impression that the next few days will last a few weeks. Best regards, Christoph ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-05 18:23 ` Christoph Edenhauser @ 2024-06-06 15:33 ` Pablo Rodriguez via ntg-context 2024-06-06 15:42 ` Hans Hagen via ntg-context 2024-06-06 20:53 ` [NTG-context] " Christoph Edenhauser 0 siblings, 2 replies; 22+ messages in thread From: Pablo Rodriguez via ntg-context @ 2024-06-06 15:33 UTC (permalink / raw) To: ntg-context; +Cc: Pablo Rodriguez On 6/5/24 20:23, Christoph Edenhauser wrote: > Dear Pablo, > > Thank you very much for your very clear, detailed and elaborate > explanations. - Over the next few days I will meditate on the ConTeXt > way to handle XML and on my workflow and take a look at lpath (never > heard of it). And somehow I have the impression that the next few days > will last a few weeks. Dear Christoph, just in case it might help to your meditation. First of all, lpaths are XPath implemented with Lua in ConTeXt. XPath seems to have as it primary purpose to address the nodes of XML trees. About your sources, the real issue here is to define whether you want TEI or TeX to be the format containing them. I mean, if you add explaining footnotes to your TeX file(s), XML won’t be source anymore. If you don’t want this to happen, you have to encode them in the TEI XML sources. One last suggestion about proofreading. This is something I learnt from personal experience. The first reading is much better to catch errors in the text than the subsequent ones. Having the text properly formatted and printed on paper helps a lot to spot errors. Reading source code is cheaper (no doubt), but the results will be poorer too. Just in case it might help, Pablo ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-06 15:33 ` Pablo Rodriguez via ntg-context @ 2024-06-06 15:42 ` Hans Hagen via ntg-context 2024-06-06 20:53 ` [NTG-context] " Christoph Edenhauser 1 sibling, 0 replies; 22+ messages in thread From: Hans Hagen via ntg-context @ 2024-06-06 15:42 UTC (permalink / raw) To: Pablo Rodriguez via ntg-context; +Cc: Hans Hagen On 6/6/2024 5:33 PM, Pablo Rodriguez via ntg-context wrote: > On 6/5/24 20:23, Christoph Edenhauser wrote: >> Dear Pablo, >> >> Thank you very much for your very clear, detailed and elaborate >> explanations. - Over the next few days I will meditate on the ConTeXt >> way to handle XML and on my workflow and take a look at lpath (never >> heard of it). And somehow I have the impression that the next few days >> will last a few weeks. > > Dear Christoph, > > just in case it might help to your meditation. > > First of all, lpaths are XPath implemented with Lua in ConTeXt. > > XPath seems to have as it primary purpose to address the nodes of XML trees. > > About your sources, the real issue here is to define whether you want > TEI or TeX to be the format containing them. > > I mean, if you add explaining footnotes to your TeX file(s), XML won’t > be source anymore. > > If you don’t want this to happen, you have to encode them in the TEI XML > sources. > > One last suggestion about proofreading. This is something I learnt from > personal experience. > > The first reading is much better to catch errors in the text than the > subsequent ones. > > Having the text properly formatted and printed on paper helps a lot to > spot errors. > > Reading source code is cheaper (no doubt), but the results will be > poorer too. > > Just in case it might help, fwiw, context supports 'synctex' to xml files / nodes so that might help a bit 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 ----------------------------------------------------------------- ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] ConTeXt source from XML 2024-06-06 15:33 ` Pablo Rodriguez via ntg-context 2024-06-06 15:42 ` Hans Hagen via ntg-context @ 2024-06-06 20:53 ` Christoph Edenhauser 2024-06-07 19:41 ` [NTG-context] " Pablo Rodriguez via ntg-context 1 sibling, 1 reply; 22+ messages in thread From: Christoph Edenhauser @ 2024-06-06 20:53 UTC (permalink / raw) To: ntg-context [-- Attachment #1.1: Type: text/plain, Size: 1857 bytes --] Dear Pablo, > Dear Christoph, > > just in case it might help to your meditation. > > First of all, lpaths are XPath implemented with Lua in ConTeXt. > > XPath seems to have as it primary purpose to address the nodes of XML trees. > > About your sources, the real issue here is to define whether you want > TEI or TeX to be the format containing them. > > I mean, if you add explaining footnotes to your TeX file(s), XML won’t > be source anymore. > > If you don’t want this to happen, you have to encode them in the TEI XML > sources. In my case, the connection to the original source will be lost. While we will still try to backport corrections, the connection will be lost at the very moment when we will annotate the source text. From this point of view, an independent source is created here anyway, so I have the freedom to choose between TEI or TeX. At the moment I'm leaning strongly towards TEI, also because I could try to remove the annotations via XSLT once the work is complete, diff the result with the original source and improve it). And besides, XML+ConTeXt looks quite elegant from the distance of my ignorance. (Although reading xml-mkiv.pdf creates a pleasant frictional heat in my cerebral convolutions, but leaves at least as many knots in them as XML data have nodes). > One last suggestion about proofreading. This is something I learnt from > personal experience. > > The first reading is much better to catch errors in the text than the > subsequent ones. > > Having the text properly formatted and printed on paper helps a lot to > spot errors. Same here: It's the paper! (I for myself prefer for the first proof reading a page lots of white space, in monospaced font like Courier, while my proofreader wants to see the font that will be used in the end.) Thank you very much for your suggestions, Christoph [-- Attachment #1.2: Type: text/html, Size: 2535 bytes --] [-- Attachment #2: Type: text/plain, Size: 511 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-06 20:53 ` [NTG-context] " Christoph Edenhauser @ 2024-06-07 19:41 ` Pablo Rodriguez via ntg-context 2024-06-07 20:34 ` Henning Hraban Ramm 2024-06-08 7:14 ` Denis Maier via ntg-context 0 siblings, 2 replies; 22+ messages in thread From: Pablo Rodriguez via ntg-context @ 2024-06-07 19:41 UTC (permalink / raw) To: ntg-context; +Cc: Pablo Rodriguez On 6/6/24 22:53, Christoph Edenhauser wrote: >> [...] >> XPath seems to have as it primary purpose to address the nodes of XML trees. >> [...] >> If you don’t want this to happen, you have to encode them in the TEI XML >> sources. > > In my case, the connection to the original source will be lost. While > we will still try to backport corrections, the connection will be lost > at the very moment when we will annotate the source text. Dear Christoph, well, in your case, your source will be a new one, the annotated one. > At the moment I'm leaning strongly towards TEI, also because I could try > to remove the annotations via XSLT once the work is complete, diff the > result with the original source and improve it). And besides, > XML+ConTeXt looks quite elegant from the distance of my ignorance. If you are familiar with XSLT (and XPath), you will have no problem typesetting XML sources with ConTeXt. > (Although reading xml-mkiv.pdf creates a pleasant frictional heat in my > cerebral convolutions, but leaves at least as many knots in them as XML > data have nodes). Well, xml-mkiv.pdf isn’t exactly a piece of cake. It isn’t an introduction and it has to be written that way. After trying to read it for the n-th time and having learnt only very little from it (exclusively my fault), I think it assumes a good XPath background. Again, xml-mkiv.pdf is documenting the way of handling XML in ConTeXt and it has to be written that way. It is part of our task (the one reserved to final users) to compose a proper introduction on how to typeset XML sources with ConTeXt. Borrowing the title from other work, “XML in Proper ConTeXt” (actually taken from https://www.berenddeboer.net/tex/LaTeX2ConTeXt.pdf). All I can say is that I have read xml-mkiv.pdf and I know I will learn way more from this document than the huge amount of things I have already discovered reading it. >> [...] >> Having the text properly formatted and printed on paper helps a lot to >> spot errors. > > Same here: It's the paper! > (I for myself prefer for the first proof reading a page lots of white > space, in monospaced font like Courier, while my proofreader wants to > see the font that will be used in the end.) Sorry for insisting. If the text is not fully formated, it is very easy to overlook formatting errors with commands (or simple errors with commands directly). The most basic sample may read (wrong spacing after command): \starttext \ConTeXt is awesome! \stoptext This is one in a bunch of errors that may be unnoticed. Just in case it might help, Pablo ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-07 19:41 ` [NTG-context] " Pablo Rodriguez via ntg-context @ 2024-06-07 20:34 ` Henning Hraban Ramm 2024-06-08 7:14 ` Denis Maier via ntg-context 1 sibling, 0 replies; 22+ messages in thread From: Henning Hraban Ramm @ 2024-06-07 20:34 UTC (permalink / raw) To: ntg-context Am 07.06.24 um 21:41 schrieb Pablo Rodriguez via ntg-context: > It is part of our task (the one reserved to final users) to compose a > proper introduction on how to typeset XML sources with ConTeXt. Have a look at the XMl related articles in https://articles.contextgarden.net/journal/2019.html Thomas’ “Presentations in XML” is a good introduction IMO. Taco’s articles are more specialized but give further insights. Hraban ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-07 19:41 ` [NTG-context] " Pablo Rodriguez via ntg-context 2024-06-07 20:34 ` Henning Hraban Ramm @ 2024-06-08 7:14 ` Denis Maier via ntg-context 2024-06-08 7:49 ` Wolfgang Schuster 1 sibling, 1 reply; 22+ messages in thread From: Denis Maier via ntg-context @ 2024-06-08 7:14 UTC (permalink / raw) To: mailing list for ConTeXt users; +Cc: Denis Maier [-- Attachment #1: Type: text/html, Size: 1641 bytes --] [-- Attachment #2: Type: text/plain, Size: 511 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-08 7:14 ` Denis Maier via ntg-context @ 2024-06-08 7:49 ` Wolfgang Schuster 2024-06-08 8:49 ` vm via ntg-context 2024-06-08 9:04 ` Pablo Rodriguez via ntg-context 0 siblings, 2 replies; 22+ messages in thread From: Wolfgang Schuster @ 2024-06-08 7:49 UTC (permalink / raw) To: mailing list for ConTeXt users, Denis Maier via ntg-context [-- Attachment #1.1: Type: text/plain, Size: 842 bytes --] Denis Maier via ntg-context schrieb am 08.06.2024 um 09:14: >> Pablo Rodriguez via ntg-context <ntg-context@ntg.nl >> <mailto:ntg-context@ntg.nl>> hat am 07.06.2024 21:41 CEST geschrieben: >> Again, xml-mkiv.pdf is documenting the way of handling XML in ConTeXt >> and it has to be written that way. >> It is part of our task (the one reserved to final users) to compose a >> proper introduction on how to typeset XML sources with ConTeXt. >> Borrowing the title from other work, “XML in Proper ConTeXt” (actually >> taken from https://www.berenddeboer.net/tex/LaTeX2ConTeXt.pdf). > Hi, > I've read Thomas Schmitt's My Way as an excellent introduction in XML > processing with ConteXt, but I can't find it anywhere anymore... Does > anyone know what happened to it? > https://wiki.contextgarden.net/images/8/8c/xhtml.pdf Wolfgang [-- Attachment #1.2: Type: text/html, Size: 1986 bytes --] [-- Attachment #2: Type: text/plain, Size: 511 bytes --] ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-08 7:49 ` Wolfgang Schuster @ 2024-06-08 8:49 ` vm via ntg-context 2024-06-08 8:59 ` Thomas A. Schmitz 2024-06-08 8:59 ` Pablo Rodriguez via ntg-context 2024-06-08 9:04 ` Pablo Rodriguez via ntg-context 1 sibling, 2 replies; 22+ messages in thread From: vm via ntg-context @ 2024-06-08 8:49 UTC (permalink / raw) To: ntg-context; +Cc: vm in the document https://wiki.contextgarden.net/images/8/8c/xhtml.pdf near the end an essential line got truncated: \startxmlsetups xml:img \placefigure[here] [\xmlatt{#1}{src}] {\xmlatt{#1}{alt}} {\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla \stopxmlsetups how should this line continue ? {\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla .F ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-08 8:49 ` vm via ntg-context @ 2024-06-08 8:59 ` Thomas A. Schmitz 2024-06-08 8:59 ` Pablo Rodriguez via ntg-context 1 sibling, 0 replies; 22+ messages in thread From: Thomas A. Schmitz @ 2024-06-08 8:59 UTC (permalink / raw) To: mailing list for ConTeXt users On 6/8/24 10:49, vm via ntg-context wrote: > in the document > https://wiki.contextgarden.net/images/8/8c/xhtml.pdf > > near the end an essential line got truncated: > > \startxmlsetups xml:img > \placefigure[here] > [\xmlatt{#1}{src}] > {\xmlatt{#1}{alt}} > {\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla > \stopxmlsetups > > > > > how should this line continue ? > {\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla > > That would be {\externalfigure[\xmlatt{#1}{src}] [width=\ctxlua{getmeas("\xmlatt{#1}{width}")}]} Thomas ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-08 8:49 ` vm via ntg-context 2024-06-08 8:59 ` Thomas A. Schmitz @ 2024-06-08 8:59 ` Pablo Rodriguez via ntg-context 1 sibling, 0 replies; 22+ messages in thread From: Pablo Rodriguez via ntg-context @ 2024-06-08 8:59 UTC (permalink / raw) To: ntg-context; +Cc: Pablo Rodriguez On 6/8/24 10:49, vm via ntg-context wrote: > in the document > https://wiki.contextgarden.net/images/8/8c/xhtml.pdf > > near the end an essential line got truncated: > [...] > how should this line continue ? > {\externalfigure[\xmlatt{#1}{src}][width=\ctxlua{getmeas("\xmla As this comes from https://wiki.contextgarden.net/images/8/8c/xhtml.pdf#page=16 and it seems to be previously defined on This comes from https://wiki.contextgarden.net/images/8/8c/xhtml.pdf#page=10, I would say: \startxmlsetups xml:img \placefigure [here] [\xmlatt{#1}{src}] {\xmlatt{#1}{alt}} {\externalfigure[\xmlatt{#1}{src}] [width=\ctxlua{getmeas("\xmlatt{#1}{width}")}]} \stopxmlsetups But this is my uneducated guess (and not having checked whehter this may make sense). Just in case it might help, Pablo ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-08 7:49 ` Wolfgang Schuster 2024-06-08 8:49 ` vm via ntg-context @ 2024-06-08 9:04 ` Pablo Rodriguez via ntg-context 1 sibling, 0 replies; 22+ messages in thread From: Pablo Rodriguez via ntg-context @ 2024-06-08 9:04 UTC (permalink / raw) To: ntg-context; +Cc: Pablo Rodriguez On 6/8/24 09:49, Wolfgang Schuster wrote: > Denis Maier via ntg-context schrieb am 08.06.2024 um 09:14: >> [...] >> Hi, >> I've read Thomas Schmitt's My Way as an excellent introduction in XML >> processing with ConteXt, but I can't find it anywhere anymore... Does >> anyone know what happened to it? > > https://wiki.contextgarden.net/images/8/8c/xhtml.pdf Many thanks for the new reference, Wolfgang. Many thanks for mentioning it, Denis. I’m going to fix the wiki links right now (https://wiki.contextgarden.net/XML). Many thanks again, Pablo ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
* [NTG-context] Re: ConTeXt source from XML 2024-06-04 20:09 ` Hans Hagen 2024-06-05 10:00 ` Christoph Edenhauser @ 2024-06-05 16:30 ` Pablo Rodriguez via ntg-context 1 sibling, 0 replies; 22+ messages in thread From: Pablo Rodriguez via ntg-context @ 2024-06-05 16:30 UTC (permalink / raw) To: ntg-context; +Cc: Pablo Rodriguez On 6/4/24 22:09, Hans Hagen wrote: > [...] > There is a xml-mkiv-tricks.tex file in the distribution (no pdf is > seems so I need to add that one.) Hans, sorry, I forgot to reply earlier. I think this is already included in https://www.pragma-ade.com/general/manuals/xml-mkiv.pdf#page=53 (as chapter 5 from xml-mkiv.pdf). The file from the distribution is the same as the one online (same SHA512, just in case). Many thanks for your help, Pablo ___________________________________________________________________________________ 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 ___________________________________________________________________________________ ^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2024-06-08 9:10 UTC | newest] Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2024-06-04 11:51 [NTG-context] ConTeXt source from XML Christoph Edenhauser 2024-06-04 15:21 ` [NTG-context] " Pablo Rodriguez via ntg-context 2024-06-04 19:21 ` Christoph Edenhauser 2024-06-04 20:09 ` Hans Hagen 2024-06-05 10:00 ` Christoph Edenhauser 2024-06-05 12:16 ` Henning Hraban Ramm 2024-06-05 14:13 ` Christoph Edenhauser 2024-06-05 15:08 ` Hans Hagen 2024-06-05 14:34 ` Pablo Rodriguez via ntg-context 2024-06-05 18:23 ` Christoph Edenhauser 2024-06-06 15:33 ` Pablo Rodriguez via ntg-context 2024-06-06 15:42 ` Hans Hagen via ntg-context 2024-06-06 20:53 ` [NTG-context] " Christoph Edenhauser 2024-06-07 19:41 ` [NTG-context] " Pablo Rodriguez via ntg-context 2024-06-07 20:34 ` Henning Hraban Ramm 2024-06-08 7:14 ` Denis Maier via ntg-context 2024-06-08 7:49 ` Wolfgang Schuster 2024-06-08 8:49 ` vm via ntg-context 2024-06-08 8:59 ` Thomas A. Schmitz 2024-06-08 8:59 ` Pablo Rodriguez via ntg-context 2024-06-08 9:04 ` Pablo Rodriguez via ntg-context 2024-06-05 16:30 ` Pablo Rodriguez via ntg-context
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).