Re: [NTG-context] Feynman Diagrams
Hi Aditya, Thanks for the suggestions. I hadn’t thought to dig into the MetaPost produced when typesetting a LaTeX document. > In principle, it should be easier to adapt the feynmp.mp (attached) code to > make it work with LMTX. This sounds like a good summer project for me. I’ll be doing a lot of MetaPost this summer. Gavin ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Feynman Diagrams
On Wed, 12 Apr 2023, Gavin via ntg-context wrote: > Hi Aditya, > > > Have you tried using feynmp (the metapost macros) directly instead of the > > LaTeX wrapper? Can you create an example that works with metapost but fails > > in ConTeXt? > > No, I’m not sure how to do that. I looked at the manual, and it has some > examples where new styles are written in MetaPost, but every diagram is drawn > with the LaTeX wrapper. I looked in the source files, and maybe feynmf.dtx > has everything to produce documentation for the MetaPost macros, but if so, > I’m not sure how to generate that documentation. > > Can you point me to an example that works with metapost macros directly? I have never used feynMP, so I am just copy-pasting an example from https://osksn2.hep.sci.osaka-u.ac.jp/~taku/osx/feynmp/fmfsamples.pdf \documentclass{article} \usepackage{feynmp} \begin{document} \unitlength = 1mm \begin{fmffile}{simple} \begin{fmfgraph}(40,25) \fmfleft{i1,i2} \fmfright{o1,o2} \fmf{fermion}{i1,v1,o1} \fmf{fermion}{i2,v2,o2} \fmf{photon}{v1,v2} \end{fmfgraph} \end{fmffile} \end{document} This creates a file simple.mp in the same directory (kind of like the old mkii way of including MP in context): % simple.mp -- do not edit, generated automatically by test1.tex input feynmp require_RCS_revision "1.30"; beginchar(1, 40*2.84526pt#, 25*2.84526pt#, 0); "feynmf: 1"; LaTeX_unitlength:=2.84526pt; subgraph (0, 0, w, h); vinit; pickup pencircle scaled thin; vleft (__i1, __i2); vright (__o1, __o2); vconnect ("fermion", __i1, __v1, __o1); vconnect ("fermion", __i2, __v2, __o2); vconnect ("photon", __v1, __v2); vfreeze; vdraw; endsubgraph; endchar; % the end. end. endinput; So, I created a context file: \startMPinclusions input feynmp; require_RCS_revision "1.30"; \stopMPinclusions \starttext \startMPpage beginchar(1, 40*2.84526pt#, 25*2.84526pt#, 0); "feynmf: 1"; LaTeX_unitlength:=2.84526pt; subgraph (0, 0, w, h); vinit; pickup pencircle scaled thin; vleft (__i1, __i2); vright (__o1, __o2); vconnect ("fermion", __i1, __v1, __o1); vconnect ("fermion", __i2, __v2, __o2); vconnect ("photon", __v1, __v2); vfreeze; vdraw; endsubgraph; endchar; \stopMPpage \stoptext but compiling that fails with metapost> trace > metapost> trace > loading metafun for lmtx, including the plain 1.004 base definitions metapost> trace > metafun > log > metafun > log > error: Isolated expression metafun > log > metapost> trace > 1 metapost> trace > # metafun > log > metafun > log > I couldn't find an '=' or ':=' after the expression that is shown above this error message, so I guess I'll just ignore it and carry on. metafun > log > metapost> trace > bp# := bp; metapost> trace > My guess is that it could be something to do with bp# being used as a variable, but I am not 100% sure on that. In principle, it should be easier to adapt the feynmp.mp (attached) code to make it work with LMTX. The feynmp.sty package, simply provide a high level macro wrapper around this mp code, and it is relatively simply to do something similar in context; but the MP file isn't that different from the latex code anyways. Aditya%% %% This is file `feynmp.mp', %% generated with the docstrip utility. %% %% The original source files were: %% %% feynmf.dtx (with options: `base,mp') %% %% Copyright (C) 1989, 1990, 1992-1995 by thorsten@physik.th-darmstadt.de %% %% This file is NOT the source for feynmf, because almost all comments %% have been stripped from it. It is NOT the preferred form of feynmf %% for making modifications to it. %% %% Therefore you can NOT redistribute and/or modify THIS file. You can %% however redistribute the complete source (feynmf.dtx and feynmf.ins) %% and/or modify it under the terms of the GNU General Public License as %% published by the Free Software Foundation; either version 2, or (at %% your option) any later version. %% %% As a special exception, you can redistribute parts of this file for %% the electronic distribution of scientific papers, provided that you %% include a short note pointing to the complete source. %% %% Feynmf is distributed in the hope that it will be useful, but %% WITHOUT ANY WARRANTY; without even the implied warranty of %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the %% GNU General Public License for more details. %% %% You should have received a copy of the GNU General Public License %% along with this program; if not, write to the Free Software %% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %% %% \CheckSum{924} %% \CharacterTable %% {Upper-case
Re: [NTG-context] Feynman Diagrams
Hi Aditya, > Have you tried using feynmp (the metapost macros) directly instead of the > LaTeX wrapper? Can you create an example that works with metapost but fails > in ConTeXt? No, I’m not sure how to do that. I looked at the manual, and it has some examples where new styles are written in MetaPost, but every diagram is drawn with the LaTeX wrapper. I looked in the source files, and maybe feynmf.dtx has everything to produce documentation for the MetaPost macros, but if so, I’m not sure how to generate that documentation. Can you point me to an example that works with metapost macros directly? Gavin ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Feynman Diagrams
On Wed, 12 Apr 2023, Gavin via ntg-context wrote: > Hi Hans, Alan, Mikael, and other Feynman fans, > > I do think Alan's node module could do a good job with this. > > > It would be nice to have a not too complicated syntax, but maybe just have > > some of the > > "shapes" of paths available. So, which ones are actually needed? > > I think the needed shapes are: > - dashed or dotted paths already built into MetaPost > - paths that are wiggly, zig-zag or coiled > - optional arrows on the paths > - optional dots or blobs at the connecting points > > This is plenty for someone doing Standard Model physics. Model builders doing > supersymmetric, walking-technicolor, bla-bla need more, of course, but I’d > let them program their own shapes. > > The package feynMP already has all of these paths, as well as double-line > variants, coded in MetaPost. If I could use feynMP with ConTeXt, that’s what > I’d do. It produces very nice diagrams. Have you tried using feynmp (the metapost macros) directly instead of the LaTeX wrapper? Can you create an example that works with metapost but fails in ConTeXt? Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Feynman Diagrams
Hi Hans, Alan, Mikael, and other Feynman fans, I do think Alan's node module could do a good job with this. > It would be nice to have a not too complicated syntax, but maybe just have > some of the > "shapes" of paths available. So, which ones are actually needed? I think the needed shapes are: - dashed or dotted paths already built into MetaPost - paths that are wiggly, zig-zag or coiled - optional arrows on the paths - optional dots or blobs at the connecting points This is plenty for someone doing Standard Model physics. Model builders doing supersymmetric, walking-technicolor, bla-bla need more, of course, but I’d let them program their own shapes. The package feynMP already has all of these paths, as well as double-line variants, coded in MetaPost. If I could use feynMP with ConTeXt, that’s what I’d do. It produces very nice diagrams. Gavin ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Feynman Diagrams
Hi, On Wed, Apr 12, 2023 at 1:41 PM Hans Hagen via ntg-context wrote: > > On 4/12/2023 5:45 AM, Gavin via ntg-context wrote: > > Hi List, > > > > I’m looking for a way to include Feynman diagrams in my ConTeXt documents. > > I’ve used feynMF/feynMP and TikZ-feynman with LaTeX in the past, but it > > doesn’t look like either works directly with ConTeXt. My diagrams are > > pretty basic (example below). Does anyone have a ConTeXt solution they > > like? If not, I’ll add it to my list of summer MetaPost projects. > Maybe Alan's node module can do the work, > > Hans > We were looking a bit at other feynman packages. It would be nice to have a not too complicated syntax, but maybe just have some of the "shapes" of paths available. So, which ones are actually needed? /Mikael (after discussing with Hans) ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Software upgrade for ntg and contextgarden server 6 April
Thank you Taco, Jules and Robbert! — All this work for our so precious group of users! Thanks! Willi > On 11 Apr 2023, at 22:42, Taco Hoekwater via ntg-context > wrote: > > Hi, > > So … the server now runs Ubuntu 22.04. Jay! > > This was a much harder upgrade though. Various things were wrong, and are > likely still a bit wrong in places. Robbert had to rescue the network > configuration that went missing completely after the upgrade (requiring a > trip to the data center). Various packages have been discontinued by our > linux distribution, including the version of the mailing list software that > we use (so that had to be installed manually). The new version of php is much > stricter than the old version (so some website hacks were also needed). Et > cetera. It has been a “process” ... > > The basic functionality appears to be back online, although the web interface > to the mailing lists does not work yet (we will try to fix that tomorrow). > But there are likely to be small problems with other services still. Please > *do* let me know if you notice something odd! > > In any case, today was the last of the big software update procedures (at > least for the next year or so). > > Best wishes, > Taco and Jules and Robbert > > > > >> On 6 Apr 2023, at 18:20, Taco Hoekwater wrote: >> >> If you notice anything wrong, please warn either me personally or >> ntg-ser...@ntg.nl. >> >> Unless major problems develop, we will continue the update process on >> Tuesday afternoon. > > > > — > Taco Hoekwater E: t...@bittext.nl > genderfluid (all pronouns) > > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Feynman Diagrams
On 4/12/2023 5:45 AM, Gavin via ntg-context wrote: Hi List, I’m looking for a way to include Feynman diagrams in my ConTeXt documents. I’ve used feynMF/feynMP and TikZ-feynman with LaTeX in the past, but it doesn’t look like either works directly with ConTeXt. My diagrams are pretty basic (example below). Does anyone have a ConTeXt solution they like? If not, I’ll add it to my list of summer MetaPost projects. Maybe Alan's node module can do the work, 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://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Reminder: regular online meet-up
On 4/12/2023 1:35 PM, Henning Hraban Ramm via ntg-context wrote: Reminder: This is in less than 2 hours. I’m sick and can’t participate this time. Hraban we can shift it one week as I have to go mid afternoon 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://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
[NTG-context] Reminder: regular online meet-up
Reminder: This is in less than 2 hours. I’m sick and can’t participate this time. Hraban Am 09.04.23 um 22:09 schrieb Henning Hraban Ramm via ntg-context: You’re invited to join on Wednesday, April 12th, 15:00 CEST (UTC+2) at https://lecture.senfcall.de/hen-rbr-rku-oke (same, but shorter: https://v34h.de/ctxmtg) ConTeXt users of all levels are welcome! Next meeting will be on May 10th. (Same blurb as every time:) [Howto] * No special software installation required; most modern browsers should work (WebRTC required). * Open the above URL, accept the privacy statement, * enter your name, * click "join" (or "start" if you’re the first), * click "with microphone", allow your browser to access it, check the audio. * Your microphone is muted if you join. Activate microphone and/or camera with the buttons at the bottom. * Minimize the default presentation with the "screen" button, bottom right. * If you’d like to share your screen or upload a file, you can make yourself the presenter: Click on your user name, change the setting, then you’ll see the "screen sharing" button beside the camera button; also there’s now "manage presentations" behind the "plus" button. Beware there is only one presenter at a time, so don’t kill someone else’s presentation. [Technical hints] * Sound is usually better if you use a headset (less noise for everyone). * Connection problems are mostly due to low bandwidth or high latency on your side, e.g. with mobile connections. * If audio/video doesn’t work for you, you can still use the text chat. * Screen sharing needs a lot of bandwidth. * BigBlueButton documentation applies: https://bigbluebutton.org/teachers/tutorials/ [Netiquette] * Please use a name that we recognize from here. Some feel uncomfortable with anonymous lurkers. * Mute your microphone while you’re not talking. * It’s nice to show your face at least when you join. * If there are connection problems, stop camera sharing. * The room is set to “everyone’s a moderator“, I trust you... See you, Hraban ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___
Re: [NTG-context] Help with typesetting footnotes in an HTML document
Depending on how complex your files are, you might want to have a look at pandoc. It does a decent job when converting docx to other formats (HTML, Markdown or even ConTeXt). Best & good luck Denis > -Ursprüngliche Nachricht- > Von: Keith McKay > Gesendet: Mittwoch, 12. April 2023 12:22 > An: Maier, Denis Christian (UB) ; ntg- > cont...@ntg.nl > Betreff: Re: AW: AW: [NTG-context] Help with typesetting footnotes in an > HTML document > > Hi Denis, > > Thanks for the code, I shall give this a try. > > To get the html file I convert a docx file using a wordpress multisite app > called > Pressbooks, a book content management system for book publishing in > various formats such as the web, pdf, epub and various xml flavours (see > pressbooks.com). My interest was that docx files could be imported into > pressbooks, edited and then exported as html which I then used in ConTeXt > to produce pdf. Pressbooks has an open source option and they give > instructions on how to self-host on a local web server, which is what I have > done (see pressbooks.org). It is, I suppose, like using a sledgehammer to > crack a nut, and the html files produced are quite complicated. I'm still in > the > experimental stage with it. > > Before trying out Pressbooks, I had previously produced two > books(novels) by converting docx files to epub using an epub extension to > Libre Office, then edit/clean-up the epub using Sigil epub editor. > Finally I extract the individual xhtml files and input into ConTeXt. > That was much easier and the files much less complicated, however those > books did not have footnotes so I shall have to check that out in Sigil. > I'm still experimenting to get a simple workflow for the conversion of docx > files to simple (x)html files. > > Thanks again for the code. > > Best Wishes > > Keith > > On 12/04/2023 09:05, denis.ma...@unibe.ch wrote: > > Hey Keith, > > > > the code below should get you started. Obviously, the links in the > footnotes don't appear as there are no setups for the elements yet. > > > > By the way, where is the HTML coming from? The dual structure for > footnotes looks a bit odd and a bit too complicated for me. > > > > == > > \startxmlsetups xml:initialize > > \xmlsetsetup{\xmldocument}{*}{-} > > \xmlsetsetup{\xmldocument}{html|body|p|}{xml:*} > > > > %\xmlsetsetup{#1}{span[@class="data-fnref"]}{xml:footnote} % data- > fnref is not a class; also -> the element won't be seen if the parent span is > not treated in some way. > > \xmlsetsetup{#1}{span[@class="footnote"]}{xml:footnote-wrapper} > > \xmlsetsetup{#1}{span[@class="footnote-indirect"]}{xml:footnote} > > \xmlsetsetup{#1}{div[@class="footnotes"]}{xml:nothing} > > > > \stopxmlsetups > > \xmlregistersetup{xml:initialize} > > > > \startxmlsetups xml:html > > \xmlflush{#1} > > \stopxmlsetups > > > > \startxmlsetups xml:body > > \xmlflush{#1} > > \stopxmlsetups > > > > \startxmlsetups xml:p > > \xmlflush{#1}\par > > \stopxmlsetups > > > > \startxmlsetups xml:footnote-wrapper > > \xmlflush{#1} > > \stopxmlsetups > > > > \startxmlsetups xml:footnote > > \footnote > > % > > {\xmlfirst{test}{div[@class="footnotes"]/div/div[@id="\xmlatt{#1}{id}" > > ]}} -> test is not the document name nor the name of the node to be > > processed>; div/div nesting was wrong; for some reason I can't get it > > to work with xmlfirst. But \xmlfilter works > > {\xmlfilter{\xmldocument}{div[@id='\xmlrefatt{#1}{data-fnref}']/comman > > d(xml:test)}} > > \stopxmlsetups > > > > \startxmlsetups xml:test > > \xmlflush{#1} > > \stopxmlsetups > > > > > > \starttext > > > > \xmlprocessfile{initialise}{footnoteTest.html}{} > > > > \stoptext > > > == > === > > > >> -Ursprüngliche Nachricht- > >> Von: Keith McKay > >> Gesendet: Dienstag, 11. April 2023 17:53 > >> An: Maier, Denis Christian (UB) ; ntg- > >> cont...@ntg.nl > >> Betreff: Re: AW: [NTG-context] Help with typesetting footnotes in an > >> HTML document > >> > >> Fair comment Denis. > >> > >> I decided to try the lookup based approach on pages 85 - 86 of the > >> xml manual and my setups are based on those pages. I have to admit > >> that I find the xml manual a wee bit difficult in places since xml is > >> outside > my expertise. > >> I attach my tex and html files which should save some copy and pasting. > >> > >> Thanks > >> > >> Keith McKay > >> > >> On 11/04/2023 14:51, denis.ma...@unibe.ch wrote: > >>> Hard to tell, if you don't show us what you've tried so far. > >>> In one of my setups I use the lua based approach described on page > 86/87. > >> But again, we'll probably need more information to figure it out. > -Ursprüngliche Nachricht- > Von: ntg-context Im Auftrag von Keith > McKay via ntg-context > Gesendet: Montag, 10. April 2023 17:30 > An: mailing list for ConTeXt users > Cc: Keith McKay > Betreff: [NTG-context] Help with
Re: [NTG-context] Help with typesetting footnotes in an HTML document
Hi Denis, Thanks for the code, I shall give this a try. To get the html file I convert a docx file using a wordpress multisite app called Pressbooks, a book content management system for book publishing in various formats such as the web, pdf, epub and various xml flavours (see pressbooks.com). My interest was that docx files could be imported into pressbooks, edited and then exported as html which I then used in ConTeXt to produce pdf. Pressbooks has an open source option and they give instructions on how to self-host on a local web server, which is what I have done (see pressbooks.org). It is, I suppose, like using a sledgehammer to crack a nut, and the html files produced are quite complicated. I'm still in the experimental stage with it. Before trying out Pressbooks, I had previously produced two books(novels) by converting docx files to epub using an epub extension to Libre Office, then edit/clean-up the epub using Sigil epub editor. Finally I extract the individual xhtml files and input into ConTeXt. That was much easier and the files much less complicated, however those books did not have footnotes so I shall have to check that out in Sigil. I'm still experimenting to get a simple workflow for the conversion of docx files to simple (x)html files. Thanks again for the code. Best Wishes Keith On 12/04/2023 09:05, denis.ma...@unibe.ch wrote: Hey Keith, the code below should get you started. Obviously, the links in the footnotes don't appear as there are no setups for the elements yet. By the way, where is the HTML coming from? The dual structure for footnotes looks a bit odd and a bit too complicated for me. == \startxmlsetups xml:initialize \xmlsetsetup{\xmldocument}{*}{-} \xmlsetsetup{\xmldocument}{html|body|p|}{xml:*} %\xmlsetsetup{#1}{span[@class="data-fnref"]}{xml:footnote} % data-fnref is not a class; also -> the element won't be seen if the parent span is not treated in some way. \xmlsetsetup{#1}{span[@class="footnote"]}{xml:footnote-wrapper} \xmlsetsetup{#1}{span[@class="footnote-indirect"]}{xml:footnote} \xmlsetsetup{#1}{div[@class="footnotes"]}{xml:nothing} \stopxmlsetups \xmlregistersetup{xml:initialize} \startxmlsetups xml:html \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:body \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:p \xmlflush{#1}\par \stopxmlsetups \startxmlsetups xml:footnote-wrapper \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:footnote \footnote % {\xmlfirst{test}{div[@class="footnotes"]/div/div[@id="\xmlatt{#1}{id}"]}} -> test is not the document name nor the name of the node to be processed>; div/div nesting was wrong; for some reason I can't get it to work with xmlfirst. But \xmlfilter works {\xmlfilter{\xmldocument}{div[@id='\xmlrefatt{#1}{data-fnref}']/command(xml:test)}} \stopxmlsetups \startxmlsetups xml:test \xmlflush{#1} \stopxmlsetups \starttext \xmlprocessfile{initialise}{footnoteTest.html}{} \stoptext = -Ursprüngliche Nachricht- Von: Keith McKay Gesendet: Dienstag, 11. April 2023 17:53 An: Maier, Denis Christian (UB) ; ntg- cont...@ntg.nl Betreff: Re: AW: [NTG-context] Help with typesetting footnotes in an HTML document Fair comment Denis. I decided to try the lookup based approach on pages 85 - 86 of the xml manual and my setups are based on those pages. I have to admit that I find the xml manual a wee bit difficult in places since xml is outside my expertise. I attach my tex and html files which should save some copy and pasting. Thanks Keith McKay On 11/04/2023 14:51, denis.ma...@unibe.ch wrote: Hard to tell, if you don't show us what you've tried so far. In one of my setups I use the lua based approach described on page 86/87. But again, we'll probably need more information to figure it out. -Ursprüngliche Nachricht- Von: ntg-context Im Auftrag von Keith McKay via ntg-context Gesendet: Montag, 10. April 2023 17:30 An: mailing list for ConTeXt users Cc: Keith McKay Betreff: [NTG-context] Help with typesetting footnotes in an HTML document Hi, I have been puzzling over how to typeset footnotes in a HTML document, most elements have been relatively easy to typeset but I'm stumped with footnotes. I have been studying the the xml manual in particular Chapter 7.4 Cross Referencing, but I'm still struggling to get xmlsetups which come anywhere near working. Any hints to a solution would be greatly appreciated. Best Wishes Keith McKay %%% Here is a snippet of the HTML document with footnotes http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd;> http://www.w3.org/1999/xhtml; xml:lang="en"> ‘What is a weed? A plant whose virtues have not been discovered,’ wrote Ralph Waldo Emerson. Those delicate crucifers with their manifold faces of four pink or lilac petals striated with veins of deeper lavender are the perfect introduction to flowers for children. So
Re: [NTG-context] Help with typesetting footnotes in an HTML document
Hey Keith, the code below should get you started. Obviously, the links in the footnotes don't appear as there are no setups for the elements yet. By the way, where is the HTML coming from? The dual structure for footnotes looks a bit odd and a bit too complicated for me. == \startxmlsetups xml:initialize \xmlsetsetup{\xmldocument}{*}{-} \xmlsetsetup{\xmldocument}{html|body|p|}{xml:*} %\xmlsetsetup{#1}{span[@class="data-fnref"]}{xml:footnote} % data-fnref is not a class; also -> the element won't be seen if the parent span is not treated in some way. \xmlsetsetup{#1}{span[@class="footnote"]}{xml:footnote-wrapper} \xmlsetsetup{#1}{span[@class="footnote-indirect"]}{xml:footnote} \xmlsetsetup{#1}{div[@class="footnotes"]}{xml:nothing} \stopxmlsetups \xmlregistersetup{xml:initialize} \startxmlsetups xml:html \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:body \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:p \xmlflush{#1}\par \stopxmlsetups \startxmlsetups xml:footnote-wrapper \xmlflush{#1} \stopxmlsetups \startxmlsetups xml:footnote \footnote % {\xmlfirst{test}{div[@class="footnotes"]/div/div[@id="\xmlatt{#1}{id}"]}} -> test is not the document name nor the name of the node to be processed>; div/div nesting was wrong; for some reason I can't get it to work with xmlfirst. But \xmlfilter works {\xmlfilter{\xmldocument}{div[@id='\xmlrefatt{#1}{data-fnref}']/command(xml:test)}} \stopxmlsetups \startxmlsetups xml:test \xmlflush{#1} \stopxmlsetups \starttext \xmlprocessfile{initialise}{footnoteTest.html}{} \stoptext = > -Ursprüngliche Nachricht- > Von: Keith McKay > Gesendet: Dienstag, 11. April 2023 17:53 > An: Maier, Denis Christian (UB) ; ntg- > cont...@ntg.nl > Betreff: Re: AW: [NTG-context] Help with typesetting footnotes in an HTML > document > > Fair comment Denis. > > I decided to try the lookup based approach on pages 85 - 86 of the xml > manual and my setups are based on those pages. I have to admit that I find > the xml manual a wee bit difficult in places since xml is outside my > expertise. > I attach my tex and html files which should save some copy and pasting. > > Thanks > > Keith McKay > > On 11/04/2023 14:51, denis.ma...@unibe.ch wrote: > > Hard to tell, if you don't show us what you've tried so far. > > In one of my setups I use the lua based approach described on page 86/87. > But again, we'll probably need more information to figure it out. > > > >> -Ursprüngliche Nachricht- > >> Von: ntg-context Im Auftrag von Keith > >> McKay via ntg-context > >> Gesendet: Montag, 10. April 2023 17:30 > >> An: mailing list for ConTeXt users > >> Cc: Keith McKay > >> Betreff: [NTG-context] Help with typesetting footnotes in an HTML > >> document > >> > >> Hi, > >> > >> I have been puzzling over how to typeset footnotes in a HTML > >> document, most elements have been relatively easy to typeset but I'm > >> stumped with footnotes. I have been studying the the xml manual in > >> particular Chapter 7.4 Cross Referencing, but I'm still struggling > >> to get xmlsetups which come anywhere near working. Any hints to a > >> solution would be greatly appreciated. > >> > >> Best Wishes > >> > >> Keith McKay > >> > >> %%% > >> > >> Here is a snippet of the HTML document with footnotes > >> > >> >> "-//W3C//DTD XHTML 1.1//EN" > >> "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd;> > >> http://www.w3.org/1999/xhtml; xml:lang="en"> > >> > >> > >> > >> ‘What is a weed? A plant whose virtues > >> have not been discovered,’ wrote Ralph Waldo Emerson >> class="footnote"> >> data-fnref="53-1">. Those delicate crucifers with their > >> manifold faces of four pink or lilac petals striated with veins of > >> deeper lavender are the perfect introduction to flowers for children. > >> So delicate and yet hardy. > >> I spend some of April abroad, travelling > >> by road from an unseasonably snowy Austria (‘dieses Wetter ist > >> verrückt!’ >> data-fnref="53-2"> as an elderly lady exclaimed to me) > >> to northern France, and when I come home, it’s to a landscape > >> responding to substantially increased light levels and temperatures. > >> This was the early sixties. Like many > >> thousands, we were rehoused from Maryhill in the heart of urban > >> Glasgow to this peripheral housing scheme which completely changed > >> the character of what had been a village. Within a decade those > >> glasshouses were abandoned, glass broken in the frames, and a row of > >> shops that included a chippy and a betting shop soon replaced them, > >> betting ‘off’ licensed race-tracks having become legal in 1961. >> class="footnote"> > >> > >> > >> > >> Emerson, R.W. (1878) Fortune of the Republic, p.3 > >> quoted in Oxford Dictionary of Quotations, Rev Fourth > Edition (1996). > >> > >> > >> ‘Crazy weather!’ > >>
Re: [NTG-context] Software upgrade for ntg and contextgarden server 6 April
KUDOS to you guys and thanks a *lot*! W Am 11.04.23 um 22:42 schrieb Taco Hoekwater via ntg-context: Hi, So … the server now runs Ubuntu 22.04. Jay! This was a much harder upgrade though. ... In any case, today was the last of the big software update procedures Best wishes, Taco and Jules and Robbert ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context webpage : https://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : https://contextgarden.net ___