[NTG-context] barring changes
Please consider the attached example – some of the “barring” macros are defunct already for a while, some more within a TABLE: \underbar works, but not in TABLE \underbarsworks \underdot doesn’t work \underdotsdoesn’t work \underdashdoesn’t work \underdashes doesn’t work \underrandom doesn’t work \underrandoms doesn’t work \overbar works, but not in TABLE \overbars works \overstrike works, but not in TABLE \overstrikes works \understrike works, but not in TABLE \understrikes works The nested example \overbar{Über} \underbar{Unterstrich \underbar{steigt \overbar{auf} den \underdot{Unterberg}}}. works only once, afterwards all the underbars are missing. Hraban bartest.tex Description: TeX document ___ 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] [overstrike] with different color?
Henning Hraban Ramm schrieb am 03.06.2020 um 16:30: Am 03.06.2020 um 16:19 schrieb Floris van Manen : What is the preferred way to overstrike a text with a different color? This does not work: One \overstrike[color=red]{Two} Three \setupbar[color=red,rulethickness=1.4] % measurement in pt \setupbar [overstrike] [..,..=..,..] Wolfgang ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] [overstrike] with different color?
> Am 04.06.2020 um 20:00 schrieb Floris van Manen : > >> \setupbar[color=red,rulethickness=1.4] % measurement in pt > > the command also takes a parameter offset as well as dy. > I assume the offset will position the line higher / lower . > But I see no effect. > > \setupbar[color=red,rulethickness=.3,offset=0.5] According to https://wiki.contextgarden.net/Command/underbar, offset should work. Maybe \definebar behaves different to \setupbar Hraban ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] [overstrike] with different color?
On 03/06/2020 16:30, Henning Hraban Ramm wrote: > \setupbar[color=red,rulethickness=1.4] % measurement in pt the command also takes a parameter offset as well as dy. I assume the offset will position the line higher / lower . But I see no effect. \setupbar[color=red,rulethickness=.3,offset=0.5] pEpkey.asc Description: application/pgp-keys ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] [overstrike] with different color?
> Am 03.06.2020 um 16:19 schrieb Floris van Manen : > > What is the preferred way to overstrike a text with a different color? > This does not work: > One \overstrike[color=red]{Two} Three \setupbar[color=red,rulethickness=1.4] % measurement in pt See also rules-mkiv.pdf Hraban ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] [overstrike] with different color?
What is the preferred way to overstrike a text with a different color? This does not work: One \overstrike[color=red]{Two} Three .F pEpkey.asc Description: application/pgp-keys ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] maths simplifying fractions
On 11/14/19 12:28 AM, Martin Althoff wrote: > Hi all, I am writing some maths exercises that include simplifying fractions. > For that > reason I would like to cross out some numbers. Unfortunately overstrike > doesn't do the > trick, eg with a 4 the overstrike is practically invisible. > > Is there any way to get a diagonal stroke like the latex module "cancel" can > do? This might help. https://tex.stackexchange.com/questions/501056/equivalent-of-cancelto-in-context > Thanks for any suggestions, > Martin > > \starttext > \startformula > \frac{\overstrike{2}}{\overstrike{4}} = \frac{1}{2} > \stopformula > \stoptext > > ___ > 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://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ > ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] maths simplifying fractions
Hi all, I am writing some maths exercises that include simplifying fractions. For that reason I would like to cross out some numbers. Unfortunately overstrike doesn't do the trick, eg with a 4 the overstrike is practically invisible. Is there any way to get a diagonal stroke like the latex module "cancel" can do? Thanks for any suggestions, Martin \starttext \startformula \frac{\overstrike{2}}{\overstrike{4}} = \frac{1}{2} \stopformula \stoptext ___ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] How can I define a dotted underbar in ConTeXt?
On 2/15/2016 10:31 PM, Aditya Mahajan wrote: On Mon, 15 Feb 2016, Hans Hagen wrote: On 2/10/2016 10:14 PM, Laurent d'Airsy wrote: I would like to create a dotted underbar in ConTeXt with the | \defineunderbar|mechanism. Is that possible? i uploaded a beta where you can test: test {\red\underrandoms{test me}} and \underrandom{test} or \underrandom{grep} \blank test {\red\underdashes {test me}} and \underdash {test} or \underdash {grep} \blank test {\red\underdots {test me}} and \underdot {test} or \underdot {grep} \blank still somewhat experimental While you are looking at the code, there was another question on tex.stackexchange on bars: http://tex.stackexchange.com/questions/291946/overstrike-in-context-can-it-overstrike-leaders How to get bars to work with leaders? \setuppapersize[A6][A6] \starttext \overstrike{Hello\hfill world!} % Works OK Hello\leaders\hbox{.}\hfill world! % Works OK, nothing special \overstrike{Hello\leaders\hbox{.}\hfill world!} % Not quite right \stoptext continue=all - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.com | 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 / 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] How can I define a dotted underbar in ConTeXt?
On Mon, 15 Feb 2016, Hans Hagen wrote: On 2/10/2016 10:14 PM, Laurent d'Airsy wrote: I would like to create a dotted underbar in ConTeXt with the | \defineunderbar|mechanism. Is that possible? i uploaded a beta where you can test: test {\red\underrandoms{test me}} and \underrandom{test} or \underrandom{grep} \blank test {\red\underdashes {test me}} and \underdash {test} or \underdash {grep} \blank test {\red\underdots {test me}} and \underdot {test} or \underdot {grep} \blank still somewhat experimental While you are looking at the code, there was another question on tex.stackexchange on bars: http://tex.stackexchange.com/questions/291946/overstrike-in-context-can-it-overstrike-leaders How to get bars to work with leaders? \setuppapersize[A6][A6] \starttext \overstrike{Hello\hfill world!} % Works OK Hello\leaders\hbox{.}\hfill world! % Works OK, nothing special \overstrike{Hello\leaders\hbox{.}\hfill world!} % Not quite right \stoptext 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] Section heading colors lost with \startbodymatter
On 2015-07-27 22:50, Rik Kabel wrote: On 2015-07-27 19:28, Rik Kabel wrote: This worked (the numbers were darkgray and there was a red dot separator) until the last beta or two. With the new betas, those colors disappear in the bodymatter mode and in appendices mode % When start/stop bodymatter is enabled, the number color and % separator colors are lost. When they are disabled, all is % as expected % \defineseparatorset[reddot][][{\color[red]{·}}] \setuphead[chapter][sectionseparatorset=reddot,numbercolor=darkgray] \setuphead[section][sectionseparatorset=reddot,numbercolor=darkgray] \starttext % \startbodymatter % enable and lose colors \startchapter[title={Chapter}] \startsection[title={Section}] \stopsection \stopchapter % \stopbodymatter % enable and lose colors \stoptext -- Rik Duh! All color is gone, not just section heads. New MWE: \starttext %\startbodymatter % enable and lose colors Some text \color[red]{and some red text}. %\stopbodymatter % enable and lose colors \stoptext Actually, some color can come through, as in the following example. The \setupmarginrules color remains even in bodymatter mode (the \setupbar color does not). \setupmarginrules[rulethickness=1pt] \setupmarginrules[1][rulecolor=red] \setupbar[overstrike][color=red] \define[1]\RR {\startmarginrule[1]\RRR#1\stopmarginrule} \definehighlight [RRR][style={\setbar[overstrike]}] \starttext % \startbodymatter % enable and lose colors Some text \color[red]{and some red text}.\par Here is some text that shows all color is not gone. \RR{Here is some text that shows all color is not gone. Here is some text that shows all color is not gone.} Here is some text that shows all color is not gone.\par % \stopbodymatter % enable and lose colors \stoptext -- RIk ___ 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] \underbar problem
On 9/6/2013 10:51 PM, Alan Bowen wrote: Sorry, Hans—I had thought that it would be very complicated to produce one, but actually it was easy: \usemodule[simplefonts] \setmainfont[Antykwa-Poltawskiego][protrusion=pure, expansion=quality, mode=node, script=latn, smallcaps] \setupalign[hanging,hz] \starttext \underbar{\dorecurse{5}{\input knuth}} \stoptext Note from the wiki (http://wiki.contextgarden.net/Command/overstrike): If you are using microtypography with |\setupalign[hz,hanging]|, then with some fonts the rule may end up off-target, above the characters instead of through them. (The problem was experienced with Linux Libertine and mkiv, and not with Latin Modern.) The workarounds are: o Put the overstriked text in a |\inframed[frame=off]{}|. As with \overstrike, with \underbar “off target” can mean “nowhere”. \underbar and Latin Modern witrh microtypography works but not \underbar and Antykwa-Poltawskiego—unless one turns off microtypography. So, if I must use \inframed—can I get it to allow for proper linebreaking/paragraphing? hm, it relates to hz, which is weird as that is only messign with characters ... (i must admit that i never use that) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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 / 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] \underbar problem
Sorry, Hans—I had thought that it would be very complicated to produce one, but actually it was easy: \usemodule[simplefonts] \setmainfont[Antykwa-Poltawskiego][protrusion=pure, expansion=quality, mode=node, script=latn, smallcaps] \setupalign[hanging,hz] \starttext \underbar{\dorecurse{5}{\input knuth}} \stoptext Note from the wiki (http://wiki.contextgarden.net/Command/overstrike): If you are using microtypography with \setupalign[hz,hanging], then with some fonts the rule may end up off-target, above the characters instead of through them. (The problem was experienced with Linux Libertine and mkiv, and not with Latin Modern.) The workarounds are: - Put the overstriked text in a \inframed[frame=off]{}. As with \overstrike, with \underbar “off target” can mean “nowhere”. \underbar and Latin Modern witrh microtypography works but not \underbar and Antykwa-Poltawskiego—unless one turns off microtypography. So, if I must use \inframed—can I get it to allow for proper linebreaking/paragraphing? Alan On Fri, Sep 6, 2013 at 12:52 PM, Hans Hagen pra...@wxs.nl wrote: On 9/5/2013 5:43 PM, Alan Bowen wrote: In a lengthy document, \underbar occasionally has no effect. From the wiki, I have learned that this can be rectified using \inframed[frame=off]{\**underbar{….}}. The problem is that this only works for short text: lengthy text, say a paragraph, gets printed as a single line. Is there a way (a key?) that will allow \underbar to work with \inframed or perhaps another way of getting \underbar to work 100% of the time? no example ? Hans --**--**- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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 / http://www.ntg.nl/mailman/** listinfo/ntg-context 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/http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net __**__** ___ ___ 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] \definehighlight with style=command problem
Thanks, Wolfgang. I missed this module first time around, sorry to say. ConTeXt now has some very nice tools for editorial markup. Alan On Mon, May 27, 2013 at 4:48 PM, Wolfgang Schuster schuster.wolfg...@gmail.com wrote: Am 27.05.2013 um 15:36 schrieb Alan Bowen bowenala...@gmail.com: I an trying to use \definehighlight to define a macro that will color and overstrike selected text. Thus far, \definehighlight[Delete][color=red,style={\overstrike}] \starttext test \Delete{test} test \stoptext reports ! Too many }'s. system tex error on line 4 in file ...TEST.tex: Too many }'s ... If I replace “\overstrike” with “bold”, “\Delete” works. “\overstrike” works otherwise, so am I trying the impossible here? \usemodule[annotation] \defineannotation[Delete][color=red,textcommand=\overstrike] \starttext test \Delete{test} test \stoptext Wolfgang ___ 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 ___ ___ 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] \definehighlight with style=command problem
I an trying to use \definehighlight to define a macro that will color and overstrike selected text. Thus far, \definehighlight[Delete][color=red,style={\overstrike}] \starttext test \Delete{test} test \stoptext reports ! Too many }'s. system tex error on line 4 in file ...TEST.tex: Too many }'s ... If I replace “\overstrike” with “bold”, “\Delete” works. “\overstrike” works otherwise, so am I trying the impossible here? Alan ___ 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] \definehighlight with style=command problem
Wonderful, Hans! Many thanks. Alan On Mon, May 27, 2013 at 1:14 PM, Hans Hagen pra...@wxs.nl wrote: On 5/27/2013 3:36 PM, Alan Bowen wrote: I an trying to use \definehighlight to define a macro that will color and overstrike selected text. Thus far, \definehighlight[Delete][**color=red,style={\overstrike}] \starttext test \Delete{test} test \stoptext reports ! Too many }'s. system tex error on line 4 in file ...TEST.tex: Too many }'s ... If I replace “\overstrike” with “bold”, “\Delete” works. “\overstrike” works otherwise, so am I trying the impossible here? The next beta will have \setbar for that purpose, used as: \setuphead[section][textstyle=**{\setbar[overstrike]},**textcolor=blue] \definehighlight[Whatever][**color=darkyellow] \definehighlight[Delete] [color=red,style={\setbar[**overstrike]}] \definehighlight[Keep][color=green] \starttext \setupbar[overstrike][**foregroundcolor=cyan,color=**blue] \startsection[title={{\green green} foo {\green green}}] foo \startbar[overstrike]bar\**stopbar test \Delete{test} test \Keep{test} test \Whatever{test} test \color[red]{test \Delete{test} test \Keep{test} test} \stopsection \stoptext for the source watchers: watch the subtle change in \mult_interfaces_install_**style_and_color_handler Hans --**--**- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | 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 / http://www.ntg.nl/mailman/** listinfo/ntg-context 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/http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net __**__** ___ ___ 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] \definehighlight with style=command problem
Am 27.05.2013 um 15:36 schrieb Alan Bowen bowenala...@gmail.com: I an trying to use \definehighlight to define a macro that will color and overstrike selected text. Thus far, \definehighlight[Delete][color=red,style={\overstrike}] \starttext test \Delete{test} test \stoptext reports ! Too many }'s. system tex error on line 4 in file ...TEST.tex: Too many }'s ... If I replace “\overstrike” with “bold”, “\Delete” works. “\overstrike” works otherwise, so am I trying the impossible here? \usemodule[annotation] \defineannotation[Delete][color=red,textcommand=\overstrike] \starttext test \Delete{test} test \stoptext Wolfgang ___ 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] microtype + \overstrike + libertine problem
Hello there. I'm experience the following problem: with microtypography \overstrike plays weird. See the following minimal. I can't reproduce it with the latin modern fonts, so maybe it's a font specific issue. I've found a workaround and documented it on the wiki (just in case) http://wiki.contextgarden.net/Overstriking %%% start minimal example, problems start a the 2nd recurse, p.2 %%% \definefontfeature[default][default] [protrusion=quality, expansion=quality, script=latn] \usetypescript[libertine] \setupbodyfont[10pt,libertine] \setupalign[hz,hanging] \setuppapersize[A6][A6] \starttext \dorecurse{20}{\input tufte \overstrike{test} \input tufte} \stoptext %%% stop minimal example%%% Best regards -- Marco ___ 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] t-vim: inline typing?
]}} %D Some defaults. \setupvimtyping [syntax=context, \c!tab=8, \c!space=\v!yes, \c!start=1, \c!stop=0, \c!before=, \c!after=, \c!numbering=\v!off, \c!numbercommand=\inleft, \c!numberstyle=\v!smallslanted, \c!numbercolor=, \c!step=1, colorscheme=default, ] %D Pre-defined Syntax : % {{{ %D This is based on \filename{ps_color.vim}, which does not use any bold %D typeface. %D \VIM\ uses hex mode for setting colors, I do not want to convert them to rgb %D values. \startvimcolorscheme[default] \setupcolor[hex] \definecolor [vimsyntax!default!Special] [h=907000] \definecolor [vimsyntax!default!Comment] [h=606000] \definecolor [vimsyntax!default!Number] [h=907000] \definecolor [vimsyntax!default!Constant][h=007068] \definecolor [vimsyntax!default!PreProc] [h=009030] \definecolor [vimsyntax!default!Statement] [h=2060a8] \definecolor [vimsyntax!default!Type][h=0850a0] \definecolor [vimsyntax!default!Todo][h=e0e090] \definecolor [vimsyntax!default!Error] [h=c03000] \definecolor [vimsyntax!default!Identifier] [h=a030a0] \definecolor [vimsyntax!default!SpecialKey] [h=1050a0] \definecolor [vimsyntax!default!Underline] [h=6a5acd] \definevimsyntax [Normal] [\c!style=\tttf,\c!color=\maintextcolor] \definevimsyntax [Constant] [\c!style=\v!mono,\c!color=vimsyntax!default!Constant] \definevimsyntaxsynonyms [Character,Boolean,Float] [Constant] \definevimsyntax [Number] [\c!style=\v!mono,\c!color=vimsyntax!default!Number] \definevimsyntax [Identifier] [\c!style=\v!mono,\c!color=vimsyntax!default!Identifier] \definevimsyntaxsynonyms [Function] [Identifier] \definevimsyntax [Statement] [\c!style=\v!mono,\c!color=vimsyntax!default!Statement] \definevimsyntaxsynonyms [Conditional,Repeat,Label,Operator,Keyword,Exception] [Statement] \definevimsyntax [PreProc] [\c!style=\v!mono,\c!color=vimsyntax!default!PreProc] \definevimsyntaxsynonyms [Include,Define,Macro,PreCondit] [PreProc] \definevimsyntax [Type,StorageClass, Structure, Typedef] [\c!style=\v!mono, \c!color=vimsyntax!default!Type] \definevimsyntax [Special] [\c!style=\v!mono,\c!color=vimsyntax!default!Special] \definevimsyntax [SpecialKey] [\c!style=\v!mono,\c!color=vimsyntax!default!SpecialKey] \definevimsyntax [Tag,Delimiter] [\c!style=\v!mono] \definevimsyntax [Comment,SpecialComment] [\c!style=\v!mono,\c!color=vimsyntax!default!Comment] \definevimsyntax [Debug] [\c!style=\v!mono] \definevimsyntax [Underlined] [\c!style=\v!mono,\c!command=\underbar] \definevimsyntax [Ignore] [\c!style=\v!mono] \definevimsyntax [Error] [\c!style=\v!mono,\c!color=vimsyntax!default!Error] \definevimsyntax [Todo] [\c!style=\v!mono,\c!color=vimsyntax!default!Todo] \stopvimcolorscheme % }}} \startvimcolorscheme[blackandwhite] \definevimsyntax [Normal] [\c!style=\tttf,\c!color=\maintextcolor] \definevimsyntax [Constant] [\c!style=\v!mono,\c!color=] \definevimsyntaxsynonyms [Character,Boolean,Float] [Constant] \definevimsyntax [Number] [\c!style=\v!mono,\c!color=] \definevimsyntax [Identifier] [\c!style=\v!mono,\c!color=] \definevimsyntaxsynonyms [Function] [Identifier] \definevimsyntax [Statement] [\c!style=\v!mono\v!bold,\c!color=] \definevimsyntaxsynonyms [Conditional,Repeat,Label,Operator,Keyword,Exception] [Statement] \definevimsyntax [PreProc] [\c!style=\v!bold\v!mono,\c!color=] \definevimsyntaxsynonyms [Include,Define,Macro,PreCondit] [PreProc] \definevimsyntax [Type,StorageClass, Structure, Typedef] [\c!style=\v!bold\v!mono, \c!color=] \definevimsyntax [Special] [\c!style=\v!mono,\c!color=] \definevimsyntax [SpecialKey] [\c!style=\v!mono,\c!color=] \definevimsyntax [Tag,Delimiter] [\c!style=\v!mono,\c!color=] \definevimsyntax [Comment,SpecialComment] [\c!style=\v!slanted\v!mono,\c!color=] \definevimsyntax [Debug] [\c!style=\v!mono,\c!color=] \definevimsyntax [Underlined] [\c!style=\v!mono,\c!color=,\c!command=\underbar] \definevimsyntax [Ignore] [\c!style=\v!mono,\c!color=] \definevimsyntax [Error] [\c!style=\v!mono,\c!color=,\c!command=\overstrike] \definevimsyntax [Todo] [\c!style=\v!mono,\c!command=\inframed] \stopvimcolorscheme % }}} \protect \stopmodule %D An example usage: % {{{ \doifnotmode{demo}{\endinput} \setupcolors[state=start] \usetypescript[modern-base][texnansi] \setupbodyfont[modern,10pt] \starttext \title{Matlab Code Listing -- Color} \definevimtyping [MATLAB] [syntax=matlab] \startMATLAB function russell_demo() % Do the example in ch 17 (p501) of Russell and Norvig % (1,1) is top left corner. r = 3; c = 4; p = 0.8; action_cost = -1/25; obstacle = zeros(r,c); obstacle(2,2)=1; terminal = zeros(r,c); terminal(1,4)=1; terminal(2,4)=1; absorb = 1; wrap_around = 0; noop = 0; T
Re: [NTG-context] ConTeXt-ifying Kile
] \definetabulate[name][name][text] \definetext[name][position][text][text][text] # \definetextbackground \definetextposition[name][settings] # \definetextvariable[settings][???][???] \definetype[name][settings] # \definetypeface \definetyping[file|typing|name][settings] \defineversion[name][numbers] # \defineXMLargument # \defineXMLcommand # \defineXMLenvironment # \defineXMLenvironmentsave # \defineXMLgrouped # \defineXMLgsave # \defineXMLgstore # \defineXMLignore # \defineXMLnested # \defineXMLpickup # \defineXMLprocess # \defineXMLsave # \defineXMLsavecontent # \defineXMLsingular # \defineXMLstore # \defXMLstring \description{text}text \determineheadnumber[section] \determinelistcharacteristics[names][settings] # \digits \disableinteractionmenu[position|name][references] # \disablemode # \doglobal # \dogotopar # \doif # \doifcommon # \doifcommonelse # \doifdefined # \doifdefinedelse # \doifelse # \doifelsenothing # \doifelsevalue # \doiffieldelse # \doifflagged # \doifinset # \doifinsetelse # \doifmode # \doifmodeelse # \doifnextcharelse # \doifnot # \doifnotcommon # \doifnotflagged # \doifnothing # \doifnotinsetelse # \doifnotmode # \doifnotvalue # \doifsomething # \doiftext # \doiftextelse # \doifundefined # \doifundefinedelse # \doifvalue # \doifXMLdata # \doifXMLdataelse # \doifXMLop # \doifXMLparelse # \doloop # \donothing # \dontleavehmode \donttest # \dorecurse # \dostepwiserecurse # \dowithnextbox # \dowithnextboxcontent # \empty \emptylines[number] # \emptytoks # \enablemode # \endstrut \enumeration # \environment # \EQ # \eTABLE # \eTABLEbody # \eTABLEfoot # \eTABLEhead # \eTABLEnext # \eTD # \eTH # \eTR # \exitloop # \expanded \externalfigure[file][settings] \field[name] \fieldstack[name][names][settings] \fillinfield[text]{text} \fillinline[settings] \fillinrules[settings]{text}{text} \fillintext[settings]{text}{text} \fitfield[name] \fixedspaces # \FLOWchart # \flushcollector # \flushlayer # \flushXMLelement \followprofile{text}[text] \followprofileversion{text}[text][text] \followversion{text}[text] \footnote[reference]{text} \footnotetext[reference]{text} \forceblocks[names][names] # \forgetall # \FR \fraction{text}{text} \framed[settings]{text} \framedtext[settings] \from[reference] \getbuffer[name] # \getfiguredimensionsonly # \getmarking[name][options] # \getvalue # \getvariable # \globalletvalue \godown[dimension] \goto{text}{text}[references] \gotobox{text}[references] \graycolor[text] \grid[options] # \gsaveXMLasdata \hairline \head[references] \headnumber[section] \headtext{text} # \hfilll \hideblocks[names][names] \high{text} # \HL \hl[number] # \hpos # \hspace # \ifconditional # \ifdefined # \iftrialtypesetting # \ifundefined \in{text}{text}[reference] # \includeFLOWchart # \includemenu # \increment \indentation \indenting[options] \inframed[settings]{text} \ininner[+|-|low][reference]{text} \inleft[+|-|low][reference]{text} \inline[reference] \inmargin[+|-|low][reference]{text} \inothermargin[+|-|low][reference]{text} \inouter[+|-|low][reference]{text} \inright[+|-|low][reference]{text} \installlanguage[name][options] \interactionbar[settings] \interactionbuttons[settings][names] \item[references] \items[settings]{text} \its[references] \keepblocks[names][all|names] \labeling[reference] \labels[name] \labeltext{text} \language[language code] \leftaligned{text} # \letgvalue # \letvalue \listsymbol[name]{text} # \loadmapfile \loadsorts \loadsynonyms # \localhsize \logfields \lohi[low]{text}{text} \low{text} # \LR \mainlanguage[language code] \mar[references]{text} \marginrule[number]{text} \margintext[+|-|low][reference]{text} \marking[name]{text} \markversion \mathematics{text} \mediaeval{text} \midaligned{text} \mirror{text} \MONTH{text} \month{text} \moveongrid[options] # \MR \name{text} # \NC # \newcounter # \nextbox \nextsection \nocap{text} \noheaderandfooterlines \noindenting \nolist{text} \nomarking{text} \nomoreblocks \nomorefiles \nop \nospace \note[reference] \notopandbottomlines \nowhitespace # \NR \numbers{text} \overbar{text} \overbars{text text} # \overlaybutton # \overlayfigure \overstrike{text} \overstrikes{text text} \packed \page[options] \pagereference[reference] \pagetype[name] \paragraph \part[references]{text} \periods[number] \placebookmarks[names][names|all] \placecombinedlist[name][settings] \placecombinedlist[name][settings] # \placefigure \placefloat[options][references]{text}{text} \placefootnotes[settings] \placeformula[references]{text}$$ $$ # \placelayer \placelegend{text}{text} \placelist[names][settings] \placelistoffloats \placelistofsorts \placelistofsynonyms \placelocalfootnotes[settings] \placelogos[names] \placeongrid[settings{text} \placeontopofeachother{text}{text} \placereferencelist[names] \placeregister[name][settings] \placeregister[settings] \placerule[name] \placesidebyside{text}{text} \placesubformula[references]{text}$$ $$ \placetextvariable[name] # \plusone # \plustwo \position(numbers){text} \positiontext[name]{text} # \prependtoks
Re: [NTG-context] Problems mapping Xml into ConTeXt
Michael Wigston wrote: Hans Hagen wrote: Michael Wigston wrote: 1. This def of u does nothing ... \defineXMLgrouped [u] \underbar \defineXMLargument[u]{\underbar} underbar is not a font switch but a macro that takes an argument Hans, Thanks, that works fine with \underbar, as well as \underbars, \overstrike, \overstrikes, \low, \high and \lohi. You mentioned that \underbar (and presumably the others I mentioned above) are macros taking arguments e.g. \acommand{...}. However presumably something like \midaligned{...} is also a macro requiring an argument, but this works as a \defineXMLgrouped and as a \defineXMLargument - why does it work with both? the macro ones do manipulate their argument, for instance, underbar is not a font charateristic or color switch or so i.e. not a real attribute; esp using setups will make your style look better (look into x-fo for instance, forget about the dirty tricks there, but it's pretty clean; mapping values and so save many macro definitions The manual XML in ConTeXt very briefly sketched over these XML commands and I can see great potential to use them directly on XML to generate ConTeXt for PDF rather than the XSLT/XSL-FO route which seems to be gaining momentum in much of the industry. I don't suppose there is another more detailed document which elaborates on the XML commands, and how you may determine which of these is most appropriate for what kind of ConTeXt command mapping? you can take a look into the x-* files which show quite some mappings; indeed direct mapping is often more convenient than transformations; future versions of context will also offer more manipulation possibilities Also at the moment a non-mapped element seems to automatically type out its contents as straight text - is there a way to override this behaviour and specify this as an error? (This is rather like the Ruby duck-typing approach - if an XML element is mapped, process it, else it is an error). \startXMLignore \stopXMLignore in xtag-pre you can see: \defineXMLenvironment [\s!default] \defaultXMLelement \defaultXMLelement \defineXMLsingular[\s!default] \defaultXMLelement % \def\defaultXMLelement % {\iftraceXMLelements[\currentXMLfullidentifier]\fi} \def\defaultXMLelement {\iftraceXMLelements{\infofont\currentXMLfullidentifier}\fi} %D We can use the default handler to implement automatic %D element hiding. Beware: this overloads the tracer. \def\startXMLignore{\dododefineXMLignore \s!default} \def\stopXMLignore {\dododefineXMLprocess\s!default} so you can play with the default handlers Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Problems mapping Xml into ConTeXt
Michael Wigston wrote: Hans Hagen wrote: Michael Wigston wrote: 1. This def of u does nothing ... \defineXMLgrouped [u] \underbar \defineXMLargument[u]{\underbar} underbar is not a font switch but a macro that takes an argument Hans, Thanks, that works fine with \underbar, as well as \underbars, \overstrike, \overstrikes, \low, \high and \lohi. You mentioned that \underbar (and presumably the others I mentioned above) are macros taking arguments e.g. \acommand{...}. However presumably something like \midaligned{...} is also a macro requiring an argument, but this works as a \defineXMLgrouped and as a \defineXMLargument - why does it work with both? the macro ones do manipulate their argument, for instance, underbar is not a font charateristic or color switch or so i.e. not a real attribute; esp using setups will make your style look better (look into x-fo for instance, forget about the dirty tricks there, but it's pretty clean; mapping values and so save many macro definitions The manual XML in ConTeXt very briefly sketched over these XML commands and I can see great potential to use them directly on XML to generate ConTeXt for PDF rather than the XSLT/XSL-FO route which seems to be gaining momentum in much of the industry. I don't suppose there is another more detailed document which elaborates on the XML commands, and how you may determine which of these is most appropriate for what kind of ConTeXt command mapping? you can take a look into the x-* files which show quite some mappings; indeed direct mapping is often more convenient than transformations; future versions of context will also offer more manipulation possibilities Also at the moment a non-mapped element seems to automatically type out its contents as straight text - is there a way to override this behaviour and specify this as an error? (This is rather like the Ruby duck-typing approach - if an XML element is mapped, process it, else it is an error). \startXMLignore \stopXMLignore in xtag-pre you can see: \defineXMLenvironment [\s!default] \defaultXMLelement \defaultXMLelement \defineXMLsingular [\s!default] \defaultXMLelement % \def\defaultXMLelement % {\iftraceXMLelements[\currentXMLfullidentifier]\fi} \def\defaultXMLelement {\iftraceXMLelements{\infofont\currentXMLfullidentifier}\fi} %D We can use the default handler to implement automatic %D element hiding. Beware: this overloads the tracer. \def\startXMLignore{\dododefineXMLignore \s!default} \def\stopXMLignore {\dododefineXMLprocess\s!default} so you can play with the default handlers Thanks, looks like I'll have to do some digging in the x-* files ... Regards, NOTICE This e-mail and any attachments are intended for the addressee(s) only and may be confidential. They may contain legally privileged or copyright material. You should not read, copy, use or disclose them without authorisation. If you are not the intended recipient please contact the sender as soon as possible by return e-mail and then please delete both messages. This notice should not be removed. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Problems mapping Xml into ConTeXt
Hans Hagen wrote: Michael Wigston wrote: 1. This def of u does nothing ... \defineXMLgrouped [u] \underbar \defineXMLargument[u]{\underbar} underbar is not a font switch but a macro that takes an argument Hans, Thanks, that works fine with \underbar, as well as \underbars, \overstrike, \overstrikes, \low, \high and \lohi. You mentioned that \underbar (and presumably the others I mentioned above) are macros taking arguments e.g. \acommand{...}. However presumably something like \midaligned{...} is also a macro requiring an argument, but this works as a \defineXMLgrouped and as a \defineXMLargument - why does it work with both? The manual XML in ConTeXt very briefly sketched over these XML commands and I can see great potential to use them directly on XML to generate ConTeXt for PDF rather than the XSLT/XSL-FO route which seems to be gaining momentum in much of the industry. I don't suppose there is another more detailed document which elaborates on the XML commands, and how you may determine which of these is most appropriate for what kind of ConTeXt command mapping? Also at the moment a non-mapped element seems to automatically type out its contents as straight text - is there a way to override this behaviour and specify this as an error? (This is rather like the Ruby duck-typing approach - if an XML element is mapped, process it, else it is an error). Michael NOTICE This e-mail and any attachments are intended for the addressee(s) only and may be confidential. They may contain legally privileged or copyright material. You should not read, copy, use or disclose them without authorisation. If you are not the intended recipient please contact the sender as soon as possible by return e-mail and then please delete both messages. This notice should not be removed. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Problems mapping Xml into ConTeXt
Hi everyone, I am attempting to map some XML into ConTeXt as described in the manual XML in ConTeXt. Essentially we have a bunch of tagged text (the XML loosely based on some of the XHTML tags) from which we want to produce PDF letters for dispatch (via email, post etc). I am having particular problems implementing the following commands: - \underbar, \underbars, \overstrike, \overstrikes, \low, \high and \lohi I was expecting that they would all easily be defined using the \defineXMLgrouped [name] {command} element mapping. There is probably something very simple that I have not setup correctly since I am sure that this has been attempted before and would appreciate pointers as to where I am going wrong. The following attempts at mapping element u to \underbar illustrates my problem which also seems largely applicable to the strike, sub and sup mapping: - 1. This def of u does nothing ... \defineXMLgrouped [u] \underbar 2. This def of u also does nothing ... \defineXMLgrouped [u] {\groupedcommand{\underbar}{}} 3. This def of u underlines the 1st character only ... \defineXMLenvironment [u] {\bgroup\underbar} {\egroup} 4. In the mailing list, there is a suggestion that \underbar does not allow line-breaking, so I also tried the following. This def of u works partially, in that it does underline, however it causes havoc with alignment - everything seems to shift over to the right about 4cm ... \defineXMLenvironment [u] \startul \stopul \definetextbackground[ul] [location=text,alternative=1,background=""> \definestartstop[ul] [before={\starttextbackground[ul] }, after={\stoptextbackground\ }] Below is a sample .tex file that I have been playing with: - \usemodule[contml] \autoXMLnamespace [context] % Attempts at defining a mapping for u: - % This def of u does nothing ... %\defineXMLgrouped [u] \underbar % This def of u does nothing ... %\defineXMLgrouped [u] {\groupedcommand{\underbar}{}} % This def of u underlines the 1st character only ... %\defineXMLenvironment [u] {\bgroup\underbar} {\egroup} % % This def of u works partially, in that it does underline, however it % causes havoc with alignment - everything seems to shift over to the right % about 4cm ... \defineXMLenvironment [u] \startul \stopul \definetextbackground[ul] [location=text,alternative=1,background=""> \definestartstop[ul] [before={\starttextbackground[ul] }, % after={\stoptextbackground\fixedspaces}] after={\stoptextbackground\ }] % Other mappings \defineXMLgrouped [right] \rightaligned \defineXMLgrouped [centre] \midaligned \defineXMLgrouped [em] \em \defineXMLsingular [br] [nr=1] {\blank[\XMLop{nr}*medium]} \showstruts \showframe \starttext start of 'normal' \CONTEXT\ text \underbar{This} is {\em left} aligned \blank[medium] \rightaligned{\underbar{This} is {\em right} aligned} \blank[medium] \midaligned{\underbar{This} is {\em centre} aligned} end of 'normal' \CONTEXT\ text - starting xml ... \startXMLdata pThis is emleft/em aligned/p pcentreuThis/u is emcentre/em aligned/centre/p pcentreThis is emcentre/em aligned/centre/p prightThis is emright/em aligned/right/p \stopXMLdata \blank[medium] finished xml - back in 'normal' \CONTEXT\ text \stoptext NOTICE This e-mail and any attachments are intended for the addressee(s) only and may be confidential. They may contain legally privileged or copyright material. You should not read, copy, use or disclose them without authorisation. If you are not the intended recipient please contact the sender as soon as possible by return e-mail and then please delete both messages. This notice should not be removed. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context