Re: [NTG-context] TEI - conTeXt
On Dec 11, 2010, at 8:56 PM, Jon Crump wrote: I've done as you suggest and downloaded the minimals beta leaving the TeX-live distribution behind, so I can be on the same page with you all. Hans's fix has worked. I'm gratified that my intuition about how @xml:id should work was not wrong. The example in my last message now works as expected. If you want to try the latest and greatest, it's indeed better to work with the minimals. You can always keep texlive if you want to use other TeX stuff or if you want a stable fallback in case the latest beta breaks. This looks sensible to me. I'll see if I can't make it work with my document next week. Thanks ever so much. Is that string substitution function a bit of Lua? Indeed, that's a lua function. It's extracting a substring (substitution would be string.gsub). Thomas, I do not take it in a negative way; simply practical. I take seriously both the principle and practice of open-source endeavors like ConTeXt, and the scholarly work it can support. I hope and intend that as I get up to speed, I'll be able to make some small contribution, even if it's only posting the commented example of our project on the wiki. I've done some programming in Python, and am rather keen to learn something about Lua, as they have quite a bit in common. It's unlikely I'll be able to make substantive contributions to the code, but not impossible in the fullness of time. I'm mindful of the generosity of all involved, and all on this list, and offer great thanks and kudos. Your cautionary note on the bilingual edition is taken to heart, and I have recommended that for the time being our project will not try to implement a facing page translation. This remains an important desideratum for us however, and I will attend with great interest your progress, and the insights of any engaged in similar efforts. The specific use-case we have in mind, and the problems associated with it may be of interest to others and I'll post it on the wiki. Good, that's the spirit! Thomas ___ 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 ___
Re: [NTG-context] TEI - conTeXt
On Fri, Dec 10, 2010 at 12:40 PM, Thomas Schmitz tschm...@uni-bonn.de wrote: processing an attribute with the 'xml:' namespace has been fixed by Hans very recently (last weekend), so if you haven't updated to the latest beta version, please do and try again; your syntax \xmlsetsetup{#1}{d...@xml:id='a']} is basically right. I've done as you suggest and downloaded the minimals beta leaving the TeX-live distribution behind, so I can be on the same page with you all. Hans's fix has worked. I'm gratified that my intuition about how @xml:id should work was not wrong. The example in my last message now works as expected. Addressing content that has been set in xml anchors is possible, but not quite easy. I wouldn't have been able to figure it out without Hans. Just to show you an example: here's code that in my TEI document will fetch the content of a witness list: \xmlfirst{#1}{root::/TEI/text/front/d...@type=='sigla']/listWit/witne...@xml:id==string.sub('\xmlatt{#1}{wit}',2)]} This looks sensible to me. I'll see if I can't make it work with my document next week. Thanks ever so much. Is that string substitution function a bit of Lua? Last point: I don't want to sound negative, but what you're attempting is not straightforward and certainly not easy stuff. I am currently planning on doing a long-term project on editing texts in this manner, and I'm quite optimistic that all problems can eventually be solved. But if you need short-term solutions, a perfectly typeset edition within a matter of weeks, this may not be possible right away. E.g., I don't think we really have a solid framework yet for a bilingual edition as you envisage it. It is possible, but not easy, Hans needs the time and many test cases to make the code work. There is a research group here in Germany (with public funding) who are currently working on xml printing of material of exactly this type. I can assure you that for the time being, there's nothing out there which comes even close to ConTeXt in this area, but we're still at the beginning. So: if you want to help and test and be part of this, you are more than welcome, but none of us has a magic bullet; this is work in progress, not drop-in solutions. Thomas, I do not take it in a negative way; simply practical. I take seriously both the principle and practice of open-source endeavors like ConTeXt, and the scholarly work it can support. I hope and intend that as I get up to speed, I'll be able to make some small contribution, even if it's only posting the commented example of our project on the wiki. I've done some programming in Python, and am rather keen to learn something about Lua, as they have quite a bit in common. It's unlikely I'll be able to make substantive contributions to the code, but not impossible in the fullness of time. I'm mindful of the generosity of all involved, and all on this list, and offer great thanks and kudos. Your cautionary note on the bilingual edition is taken to heart, and I have recommended that for the time being our project will not try to implement a facing page translation. This remains an important desideratum for us however, and I will attend with great interest your progress, and the insights of any engaged in similar efforts. The specific use-case we have in mind, and the problems associated with it may be of interest to others and I'll post it on the wiki. ___ 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 ___
[NTG-context] TEI - conTeXt
All, More naive questions about xml and context. I'm finding this slow going and documentation opaque or just thin on the ground. I have XML markup like this: ref target=#N003-06 reference term/ref where the reference text is in div xml:id=notes note xml:id=N003-06reference text/note . . . etc. /div I need to set this as an endnote reference. Can anyone give me a hint as to how a context environment file should look to achieve this? Thomas's excellent tutorial at http://wiki.contextgarden.net/TEI_xml is a great help, but my grasp of the underlying protocols is fragile. More practical examples of TEI (or other xml texts)- ConTeXt - PDF would sure come in handy. thanks, jon ___ 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 ___
Re: [NTG-context] TEI - conTeXt
On Thu, 9 Dec 2010 15:20:06 -0800 Jon Crump jjcr...@uw.edu wrote: All, More naive questions about xml and context. I'm finding this slow going and documentation opaque or just thin on the ground. Before I try and help you with your question: you posted another problem on Nov 24 and got replies. Has this issue been solved? More practical examples of TEI (or other xml texts)- ConTeXt - PDF would sure come in handy. You're more than welcome to contribute such examples. Remember, this is a volunteer effort. Thomas ___ 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 ___
Re: [NTG-context] TEI - conTeXt
Thomas, Thanks for responding. Yes, thanks to some help from Idris, Khaled, et alia, I've got an ara-sty.tex environment file that sets up the Scheherezade font and am getting very nice looking arabic text. I'm now trying to get my arms around some basic elements of the conTeXt system for dealing with xml. Thanks to your TEI tutorial, I've got some good results for flushing elements identified by tag name and by named attribute like this: \xmlsetsetup{#1}{he...@type='chapter']}{xml:head:chapter} \xmlsetsetup{#1}{p}{xml:p} and the like. I'm now trying to figure out how to address elements in the tei more precisely, like how to address the content nodes in the div xml:id=notes, like note xml:id=N012-10, in order to use their contents while setting elements like ref target=#N012-10 with a \footnote command (though we may, in fact, need to put these elsewhere in an 'endnotes' section.). I've sought in vain for the answers to simple questions like how to address nodes identified by xml:id. In setting up a minimal example, I've tried to do this: with the xml: ?xml version=1.0 encoding=utf-8? body text div xml:id=a foo /div div xml:id=b bar /div /text /body set foo and not bar. This, for example, does not work: \startxmlsetups xml:minimalsetups \xmlsetsetup{#1}{*}{-} \xmlsetsetup{#1}{body|text|div}{xml:*} \xmlsetsetup{#1}{d...@xml:id='a']}{xml:div} \stopxmlsetups context complaining that xml:id='a' is not a valid lpath expression. As you can see, I'm not getting some basic things about how to specify and traverse the xml, much less applying the correct context commands to get the content and formatting I need. Another thing I'm going to need to do is to parse the text of certain element attributes. For example, divs to be set in arabic are distinguished from divs to be set in latin only by their xml:lang attributes. I will need to be able to distinguish between ar-Arab, en-Latn, and possibly also ar-Latn and more complex subtags like az-Arab-IR as specified in http://www.rfc-editor.org/rfc/bcp/bcp47.txt Any clues you might care to offer, or examples that you know of, would be gratefully received. I hesitate to attach the xml and tex files I'm working with here, being unfamiliar with the protocols of the list, but if it would help to see what I'm trying to work with, I could certainly do that. More than this, I will certainly post on the wiki some documentation and examples from this current project once I have something to contribute that works. I'd like to extend your tutorial for others who have TEI texts that they would like to typeset; indeed, making public such documentation in their appropriate fora is part of the remit of our project. All at sea in Seattle, Jon On Fri, Dec 10, 2010 at 9:57 AM, Thomas Schmitz tschm...@uni-bonn.de wrote: On Thu, 9 Dec 2010 15:20:06 -0800 Jon Crump jjcr...@uw.edu wrote: All, More naive questions about xml and context. I'm finding this slow going and documentation opaque or just thin on the ground. Before I try and help you with your question: you posted another problem on Nov 24 and got replies. Has this issue been solved? More practical examples of TEI (or other xml texts)- ConTeXt - PDF would sure come in handy. You're more than welcome to contribute such examples. Remember, this is a volunteer effort. Thomas ___ 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 ___
Re: [NTG-context] TEI - conTeXt
On Fri, 10 Dec 2010 12:00:59 -0800 Jon Crump jjcr...@uw.edu wrote: Jon, OK, good to know. I'll need a bit more leisure to look at your example; here are just a few points: processing an attribute with the 'xml:' namespace has been fixed by Hans very recently (last weekend), so if you haven't updated to the latest beta version, please do and try again; your syntax \xmlsetsetup{#1}{d...@xml:id='a']} is basically right. Addressing content that has been set in xml anchors is possible, but not quite easy. I wouldn't have been able to figure it out without Hans. Just to show you an example: here's code that in my TEI document will fetch the content of a witness list: \xmlfirst{#1}{root::/TEI/text/front/d...@type=='sigla']/listWit/witne...@xml:id==string.sub('\xmlatt{#1}{wit}',2)]} The (for you) relevant part is root::/: this is the topmost level of your TEI xml document. You then traverse all the elements and drill down to a witness element whose xml:id attribute is identical to the wit attribute of your current element. So element wit=#foo will pick up the content of witness xml:id=foobar/witness and print bar. This should get you going. Last point: I don't want to sound negative, but what you're attempting is not straightforward and certainly not easy stuff. I am currently planning on doing a long-term project on editing texts in this manner, and I'm quite optimistic that all problems can eventually be solved. But if you need short-term solutions, a perfectly typeset edition within a matter of weeks, this may not be possible right away. E.g., I don't think we really have a solid framework yet for a bilingual edition as you envisage it. It is possible, but not easy, Hans needs the time and many test cases to make the code work. There is a research group here in Germany (with public funding) who are currently working on xml printing of material of exactly this type. I can assure you that for the time being, there's nothing out there which comes even close to ConTeXt in this area, but we're still at the beginning. So: if you want to help and test and be part of this, you are more than welcome, but none of us has a magic bullet; this is work in progress, not drop-in solutions. All best Thomas ___ 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 ___
Re: [NTG-context] TEI - conTeXt - pdf
On Nov 24, 2010, at 11:47 PM, Jon Crump wrote: All, Having abandoned apache's FOP, I've now been trying to get my arms around XML typesetting with conTeXt with the help of Thomas's excellent tutorial at http://wiki.contextgarden.net/TEI_xml. With some difficulty I got the philostratus.xml/lorem ipsum example to work, save for errors like this from the \definemargins command: ! You can't use `\dimexpr' in restricted horizontal mode. (The marginal notations are typeset, but so are the distance arguments) What version of ConTeXt are you using? I don't get this error with the latest beta. Updating your MacTeX (which really is a slightly modified TeXLive) might be difficult, so I would recommend trying the minimals. Arabic: others will be able to help you; there is a number of Arabic users on this list some of whom are regulars. Good luck Thomas ___ 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 ___
[NTG-context] TEI - conTeXt - pdf
All, Having abandoned apache's FOP, I've now been trying to get my arms around XML typesetting with conTeXt with the help of Thomas's excellent tutorial at http://wiki.contextgarden.net/TEI_xml. With some difficulty I got the philostratus.xml/lorem ipsum example to work, save for errors like this from the \definemargins command: ! You can't use `\dimexpr' in restricted horizontal mode. (The marginal notations are typeset, but so are the distance arguments) What I really need help with, however, is Arabic. Can anyone point me to a 'hello world' example of how to typeset TEIxml in Arabic using conTeXt? My TeX skills are very out of date and were never much to begin with, and I'm having a devil of a time getting my head around the welter of available documentation. I haven't even yet worked out how to point context at suitable fonts, or how to invoke them in the --environment .tex file. [I'm using the MacTeX-2010 Distribution on OSX 10.5.8. It took me some time do discover that I had to do: $ luatools --generate before I could run context at the command line thus: $ context --environment=tei-style philostratus.xml] Any hints, examples, or pointers to the relevant documentation would be gratefully received. Thanks, Jon ___ 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 ___