[NTG-context] xmlfilter in lua
Hi, hope this is comprehensible without a full example: I want to do some operations on my xml, and that's easier to do in Lua. However, I cannot find how to filter my results and pass them on to a command. In TeX, I would do this: \startxmlsetups xml:a \xmlfilter{#1}{/b/command(xml:command:b)} \stopxmlsetups \startxmlsetups xml:command:b \xmlconcat{#1}{/}\par \stopxmlsetups How would I do the same thing in Lua? Here's what I tried: function xml.functions.a(t) local b = lxml.filter(lxml.id(t), "/b") process(b) end function process(t) xml.xprint(t) end but that doesn't work yet, I get no results printed. So my question: what would be the right syntax in Lua? (And bonus points for: what is the equivalent of \xmlconcat ?) 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] xmlfilter in lua
On 28.07.2013 12:59, Thomas A. Schmitz wrote: Hi, hope this is comprehensible without a full example: I want to do some operations on my xml, and that's easier to do in Lua. However, I cannot find how to filter my results and pass them on to a command. In TeX, I would do this: \startxmlsetups xml:a \xmlfilter{#1}{/b/command(xml:command:b)} \stopxmlsetups \startxmlsetups xml:command:b \xmlconcat{#1}{/}\par \stopxmlsetups How would I do the same thing in Lua? Here's what I tried: function xml.functions.a(t) local b = lxml.filter(lxml.id(t), "/b") process(b) end function process(t) xml.xprint(t) end but that doesn't work yet, I get no results printed. So my question: what would be the right syntax in Lua? (And bonus points for: what is the equivalent of \xmlconcat ?) All best Thomas Replying to myself to correct: should have been function process(t) xml.cprint(t) end obviously... 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] Using backslash in chapter title.
Using MKIV and MyriadProBold for my sanserif font I have the following chapter title: "Can You Type \bye?" which I type as \chapter{Can You type \backslash bye?} The slash appears but a bit low and much too thin. I have tried various games including creating a special font just for this character but nothing changes. the \backslash command seems invulnerable to change. Is there a way in MKIV to express a backslash in another way (bigger and bolder)? John Culleton ___ 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] OSFONTDIR kills gui fonts.
On Fri, 26 Jul 2013 21:59:28 -0400 john Culleton wrote: > On Fri, 26 Jul 2013 22:38:10 +0200 > Philipp Gesang wrote: > > > Hi John! > > > > · > > > > > I am tryihg to follow the wiki on "Fonts in Luatex." It suggests > > > the following statement for Linux systems: > > > > > > export OSFONTDIR="/usr/local/share/fonts;$HOME/.fonts" > > > > > > But I store my fonts in /usr/share/fonts so I used: > > > > > > export OSFONTDIR="/usr/share/fonts" > > > > > > The net effect of this statement was to wipe out all my text fonts > > > used with XFCE4 or KDE, at least when I use my regular user > > > signon. I examined my /etc/profile, $HOME/.profile, @HOME/.bashrc > > > files and deleted or commented out all references to OSFONTDIR. I > > > still have no gui fonts. > > > > Can you clarify what you mean by “wipe out”? Were the font files > > deleted? Are other kinds of fonts (e.g. bitmap/pfb) still > > working? > > > > > If anyone has any suggestions on how I can revive my gui fonts > > > that would be welcome. Only my regular user signon is affected, > > > But I really want to know what kind of OSFONTDIR statement I can > > > use that won't wipe out my gui fonts. > > > > OSFONTDIR is a tex specific (kpathsea and Context) variable that > > I don’t think is used by the system (fontconfig, desktop > > environment). While you were fiddling with font paths, is it > > possible that you accidentally modified something else, like > > ~/.config/fontconfig or /etc/fonts/* ? > > > > Best regards, > > Philipp > > When signed on as my usual username and I fire up the gui I get > squares instead of characters. It works OK if I sign on as an > alternate user or root. > > I'll try the sudo fc-cache -fv route and see what happens. > ___ > 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 > _ My solution to the missing or miscalled gui fonts is to reestablish Slackware Linux 14 on a new partition and copy pertinent stuff over. Everything is OK so far. I used texlive 2013 since it is simpler to setup and use then stand alone context. My solution to the original problem was suggested in part by a reply on comp.text.tex newsgroup. Basically I gave up on trying to cajole context/luatex to use the fonts I have in /usr/share/fonts/OTF. Instead I copied the ones I need for this project into texmf-local/fonts. And I didn't use any subdirectory structure. Having been burned once I did not use OSFONTDIR at all. Instead I used these methods: context --generate mtxrun--script fonts --reload mtxrun --script fonts --list --all --pattern=Minion* and the same except for my sanserif choice Myriad Now I am in business. John Culleton ___ 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] Using backslash in chapter title.
On Sun, 28 Jul 2013, john Culleton wrote: Using MKIV and MyriadProBold for my sanserif font I have the following chapter title: "Can You Type \bye?" which I type as \chapter{Can You type \backslash bye?} The slash appears but a bit low and much too thin. I have tried various games including creating a special font just for this character but nothing changes. the \backslash command seems invulnerable to change. Is there a way in MKIV to express a backslash in another way (bigger and bolder)? \backslash is a math mode command. For text backslash, use \textbackslash or \letterbackslash. You can also try \chapter{Can you type \tex{bye}?} Aditya ___ 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] Using backslash in chapter title.
On 2013–07–28 john Culleton wrote: > \chapter{Can You type \backslash bye?} > > The slash appears but a bit low and much too thin. Use \textbackslash. Marco signature.asc Description: Digital signature ___ 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] Questions about mathfence
Hi, Some questions/remarks about math fences 1. When using \definemathfence[colorbracket][bar][middle=0x7C,color=red, command=yes] \starttext \startformula \colorbracket{\frac {a}{b}\fence a = b}^n \stopformula \stoptext The delimiter is of the wrong color (black instead of red), and the clause after \fence is red. I am doing something wrong or is it a bug. 2. For some types of expressions, for example, probability, the middle delimiter should have the space similar to mathrel, rather than mathord. For example, while typing I often use: \Pr\left( X = \frac {a}{b} \,\middle|\, Y = \frac{c}{d} \right) Would it be worthwhile to add these extra spaces by default (not sure what is the convention in physics/quantum mechanics for bra and ket notation) or as an option. 3. Finally, why are the default values of left, middle, and right = 0x2E. Isn't 0x7C a better default? Thanks, Aditya ___ 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 ___