[NTG-context] Question about defining a math macro
Hi, Can I define a math macro, say \EXP that does the following: 1) \EXP{something} gives me, say E(something) 2) \EXP_a^b{something} gives my E_a^b(something) That is, I want to write a macro that will only be used in the math mode, that does something with its argument. But, I also want it to handle _ and ^ if they are present. The only method that I can think of is to check _ or ^ with \ifnextcharacter and go through all 5 cases (nothing, only _, only ^, _ followed by ^, ^ followed by _) but this seems very inefficient. Is there a better way? Aditya ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Question about defining a math macro
Aditya Mahajan wrote: Hi, Can I define a math macro, say \EXP that does the following: 1) \EXP{something} gives me, say E(something) 2) \EXP_a^b{something} gives my E_a^b(something) That is, I want to write a macro that will only be used in the math mode, that does something with its argument. But, I also want it to handle _ and ^ if they are present. The only method that I can think of is to check _ or ^ with \ifnextcharacter and go through all 5 cases (nothing, only _, only ^, _ followed by ^, ^ followed by _) but this seems very inefficient. Is there a better way? Actually, there is, by using a bit of black magic in the macro definition: \def\EXP#1#{\bgroup\def\EXParg{#1}\doEXP} \def\doEXP#1{\mfunction{E}\EXParg({\rm #1})\egroup} That extra hash mark has the effect of putting everything upto the next explicit left brace into #1. Cheers, Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Yet another math symbol
On Sun, 14 Jan 2007, Oliver Buerschaper wrote: Exactly! Oliver Do you mean something like 1 at the end of eq (23) page 4 (3231) at http://www.eecs.umich.edu/~adityam/publications/conferences/ cdc2006.pdf Since I needed to use it in ConTeXt also, here is how to use it. http://wiki.contextgarden.net/Doublestroke I reused the mb family since I do not expect anyone to use double stroke with blackboard bold. Aditya ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Question about defining a math macro
On Sat, 24 Feb 2007, Taco Hoekwater wrote: Aditya Mahajan wrote: Hi, Can I define a math macro, say \EXP that does the following: 1) \EXP{something} gives me, say E(something) 2) \EXP_a^b{something} gives my E_a^b(something) That is, I want to write a macro that will only be used in the math mode, that does something with its argument. But, I also want it to handle _ and ^ if they are present. The only method that I can think of is to check _ or ^ with \ifnextcharacter and go through all 5 cases (nothing, only _, only ^, _ followed by ^, ^ followed by _) but this seems very inefficient. Is there a better way? Actually, there is, by using a bit of black magic in the macro definition: \def\EXP#1#{\bgroup\def\EXParg{#1}\doEXP} \def\doEXP#1{\mfunction{E}\EXParg({\rm #1})\egroup} That extra hash mark has the effect of putting everything upto the next explicit left brace into #1. Wow Taco. This is great. Thanks, Aditya ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] ConTeXt release 2007.02.20
[EMAIL PROTECTED] wrote: Gday I am having a problem on mswincontext since this the update 2007.02.20. Even hello world will not compile. i uploaded a new one (but untested) 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] breaking framed text across pages
Mojca Miklavec wrote: On 2/21/07, Vyatcheslav Yatskovsky wrote: Hi, I'm struggling against framed text and is beaten again. If the text below doesn't fit the page, it goes below footer and stops pdf file without explanations. After many experiments I should note that frame text is not user-tolerant construction at all, unlike the whole Context is. :( Hans should probably answer the framed-tet related question. I was also a bit disappointed last time when I figured out that framedtext framed just takes a box and boxes don't break try to imagine how to implement breaking across pages with backgrounds ... als try to figure out (without looking at the source) how the text background mechanism works ... it may turn you rdisappointment into amazement on how a 25 year old tex can still keep up with it doesn't support breaking along pages. But then I discovered an alternative: \setupbackground[frame=on,rulethickness=0.7pt,corner=round,bodyfont=11pt,width=\textwidth] \startbackground \stopbackground dependin gon usage, this mechanism also provides background behind parts of paragraphs, nested backgrounds, arbitrary mp backgrounds, etc 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
[NTG-context] simplecolumns
\simplecolumns have served me well. However, it seems a bit shy to respond to \setupcolumns (although in file page-mul.tex the definition of \setupcolumns preceeds that of \startsimplecolumns). For example, the following typesets 2 columns instead of 4; to set 4 columns \startsimplecolumns[4] is required. \starttext \setupcolumns[n=4] \startsimplecolumns \input tufte \stopsimplecolumns \stoptext Can someone tell me if \setupcolumns has any effect on the typesetting of simplecolumns? Which parameters of those on \setupcolumns are effective in simplecolumns? Not all do, as for example rule=on seems to have no effect. Hans van der Meer ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] debian tikz module
Frank Küster wrote: (517)[21:48:[EMAIL PROTECTED]:~$ kpsewhich --progname=context t-tikz.tex (518)[21:48:[EMAIL PROTECTED]:~$ ls /usr/share/texmf/context/pgf/frontendlayer/t-tikz.tex /usr/share/texmf/context/pgf/frontendlayer/t-tikz.tex ^ shouldn't there be a 'tex' path component? Then it would be in the serch path for ConTeXt. cheerio ralf ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] texfont aborts with charisSIL
Hi, after my first installation was successful I am trying to install the latest IPA-font from SIL (Charis - http://scripts.sil.org/cms/scripts/page.php?site_id=nrsiid=IPAhome#Charis ). I followed the instruction from the wiki: http://wiki.contextgarden.net/Installing_a_TrueType_font,_step_by_step I downloaded the charis-font I decompressed the package and got following files: ~/Schriftsysteme/IPA $ ls CharisSIL4.100FontDocumentation.pdf CharisSILB.ttf FONTLOG.txt README.txt CharisSIL4.100.zip CharisSILI.ttf OFL-FAQ.txt CharisSILBI.ttf CharisSILR.ttf OFL.txt Then I entered the sucgested texfont-command: ~/Schriftsysteme/IPA $ texfont --ve=sil --co=charis --makepath --install *.ttf /tmp/tex/texmf-linux/bin/texmfstart:2073: warning: Insecure world writable dir /tmp/tex/texmf-linux/bin, mode 040777 TeXFont 2.2.1 - ConTeXt / PRAGMA ADE 2000-2004 mktexlsr: Updating /tmp/tex/texmf-fonts/ls-R... mktexlsr: Done. encoding vector : texnansi vendor name : sil source path : . font collection : charis texmf font root : /tmp/tex/texmf-fonts map file name : texnansi-sil-charis.map source path : . processing files : all in pattern CharisSILBI.ttf locating afm files : using pattern ./CharisSILBI.ttf.afm locating afm files : using otf files copying files : afm copying files : pfb copying files : otf processing aborted : no afm files found --help : show some more info After this aborted texfont-command I have to run the mktexlsr-comand to rebuild the font-structure - even to get the normal results without using the new font. An example-file is attached to this email - without IPA-signs. Did I missed a step or is texfont obsolete? Thanks, H. %\usetypescript[arial] %\setupbodyfont[arial] \definetypeface [MS][ss][sans] [arial][default][encoding=uc] \setupbodyfont[MS, 11pt] \starttext Bonvenon mondo! :-) ÐЯЯЯЯЯЯЧСÐÐТ ÙسÙتب ب Ùب بت ÙØ´ Ù hehohä \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] installationproblem with context-dis tribution: xetex not working
Thanks, it is working after I copied the relevant files from my texmf-fonts/ into the texmf-local/ folder. The disjunction into the different texmf-... folders: texmf/ texmf-local/... texmf-font/ texmf-extra/... texmf-linux/ is a little bit confusing to me. Is this seperation necessary or can I just merge them? Ciao, H. Je Lundo, 19. Februaro 2007 12:05, Taco Hoekwater skribis: Hi, Henning Haeske wrote: I also tried fixing this with this note: http://archive.contextgarden.net/message/20070130.082837.4bc51f61.en.html Make sure you also read: http://archive.contextgarden.net/message/20070130.145856.ffeabcfc.en.html Best wishes, Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] No TOC and other lists with \setuparranging
Hello list, The following gives me TOC and list of defined heads called przepis at the end of the file: \definehead[przepis][section] \setuphead [chapter] [number=no] \setuphead [section] [number=no] \definepapersize[mysize][width=10cm,height=19cm] \setuppapersize[mysize][mysize] \setuplayout[backspace=17mm,location=middle,marking=on,] \starttext \startbodymatter \chapter{to start!} \dorecurse{10}{\input knuth \par} \przepis{Prawdziwy sos czosnkowy} \dorecurse{5}{\input tufte \par} \przepis{Prawdziwy sos pieczarkowy} \dorecurse{5}{\input knuth \par} \przepis{Prawdziwy sos jogurtowy} \dorecurse{5}{\input tufte \par} \chapter{dajemy dalej!} \przepis{Prawdziwy sos warzywny} \dorecurse{5}{\input knuth \par} \przepis{Prawdziwy sos jagodowy} \dorecurse{5}{\input tufte \par} \chapter{Trzeci!} \dorecurse{10}{\input knuth \par} \przepis{nie-Prawdziwy sos czosnkowy} \dorecurse{5}{\input tufte \par} \przepis{nie-Prawdziwy sos pieczarkowy} \dorecurse{5}{\input knuth \par} \przepis{nie-Prawdziwy sos jogurtowy} \dorecurse{5}{\input tufte \par} \chapter{To czwarty!} \przepis{Prawdziwy sos niewarzywny} \dorecurse{5}{\input knuth \par} \przepis{Prawdziwy sos niejagodowy} \dorecurse{5}{\input tufte \par} \stopbodymatter \title{Spis tre\'sci} \placecontent \title{Spis przepisow} \placelist[przepis] \stoptext Whereas the following does not: \definehead[przepis][section] \setuphead [chapter] [number=no] \setuphead [section] [number=no] \definepapersize[mysize][width=10cm,height=19cm] \setuppapersize[mysize][A2] \setuparranging[2*8,rotated,doublesided] \setuplayout[backspace=17mm,location=middle,marking=on,] \starttext \startbodymatter \chapter{to start!} \dorecurse{10}{\input knuth \par} \przepis{Prawdziwy sos czosnkowy} \dorecurse{5}{\input tufte \par} \przepis{Prawdziwy sos pieczarkowy} \dorecurse{5}{\input knuth \par} \przepis{Prawdziwy sos jogurtowy} \dorecurse{5}{\input tufte \par} \chapter{dajemy dalej!} \przepis{Prawdziwy sos warzywny} \dorecurse{5}{\input knuth \par} \przepis{Prawdziwy sos jagodowy} \dorecurse{5}{\input tufte \par} \chapter{Trzeci!} \dorecurse{10}{\input knuth \par} \przepis{nie-Prawdziwy sos czosnkowy} \dorecurse{5}{\input tufte \par} \przepis{nie-Prawdziwy sos pieczarkowy} \dorecurse{5}{\input knuth \par} \przepis{nie-Prawdziwy sos jogurtowy} \dorecurse{5}{\input tufte \par} \chapter{To czwarty!} \przepis{Prawdziwy sos niewarzywny} \dorecurse{5}{\input knuth \par} \przepis{Prawdziwy sos niejagodowy} \dorecurse{5}{\input tufte \par} \stopbodymatter \title{Spis tre\'sci} \placecontent \title{Spis przepisow} \placelist[przepis] \stoptext I am using the latest Context (ConTeXt ver: 2007.02.21 11:55 MKII fmt: 2007.2.24 int: english/english). I would be very grateful for advice Piotr -- Piotr Kopszak, Ph.D. Polish Art Gallery, National Museum in Warsaw -http://kopszak.mnw.art.pl/ http://www.magnatune.com/artists/altri_stromenti ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Question about defining a math macro
On Sat, 24 Feb 2007, Hans Hagen wrote: Aditya Mahajan wrote: On Sat, 24 Feb 2007, Taco Hoekwater wrote: Aditya Mahajan wrote: Hi, Can I define a math macro, say \EXP that does the following: 1) \EXP{something} gives me, say E(something) 2) \EXP_a^b{something} gives my E_a^b(something) That is, I want to write a macro that will only be used in the math mode, that does something with its argument. But, I also want it to handle _ and ^ if they are present. The only method that I can think of is to check _ or ^ with \ifnextcharacter and go through all 5 cases (nothing, only _, only ^, _ followed by ^, ^ followed by _) but this seems very inefficient. Is there a better way? Actually, there is, by using a bit of black magic in the macro definition: \def\EXP#1#{\bgroup\def\EXParg{#1}\doEXP} \def\doEXP#1{\mfunction{E}\EXParg({\rm #1})\egroup} That extra hash mark has the effect of putting everything upto the next explicit left brace into #1. Wow Taco. This is great. some applications of this mechanism can be found in the context source code (supp-box etc) Yes, those were parts of the core that I could never understand. Now, I do understand them a little. Thanks, Aditya ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Natural table header limitation.
The fancy tricks one can to with Natural Tables seem to work within the body of the table where I don't need them but fail in the header area where I do need them. This example, takein from the wiki, works (of course.) \setupTABLE[row][odd][background=color,backgroundcolor=red, width=.2\textwidth] \bTABLE[split=yes] \bTR \bTD[nr=3] 1 \eTD \bTD[nc=2] 2/3 \eTD \bTD[nr=3] 4 \eTD \eTR \bTR \bTD 2 \eTD \bTD 3 \eTD \eTR \bTR \bTD 2 \eTD \bTD 3 \eTD \eTR \bTR \bTD[nc=3] 1/2/3 \eTD \bTD 4 \eTD \eTR \bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \eTR \eTABLE But if I convert the above data items to header items the run fails. Specifically the following fails: \setupTABLE[row][odd][background=color,backgroundcolor=red, width=.2\textwidth] \bTABLE[split=yes] \bTABLEhead \bTR \bTH[nr=3] 1 \eTH \bTH[nc=2] 2/3 \eTH \bTH[nr=3] 4 \eTH \eTR \bTR \bTH 2 \eTH \bTH 3 \eTH \eTR \bTR \bTH 2 \eTH \bTH 3 \eTH \eTR \bTR \bTH[nc=3] 1/2/3 \eTH \bTH 4 \eTH \eTR \bTR \bTH 1 \eTH \bTH 2 \eTH \bTH 3 \eTH \bTH 4 \eTH \eTR \eTABlehead \eTABLE What did I miss? Here is the error message: bTR \bTH [nr=3] 1 \eTH \bTH [nc=2] 2/3 \eTH \bTH [nr=3] 4 \eTH \eTR \ETC. ! File ended while scanning use of \doTABLEhead. inserted text \par * tabletest.tex emergencyend ? - -- John Culleton _ Need personalized email and website? Look no further. It's easy with Doteasy $0 Web Hosting! Learn more at www.doteasy.com ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Limitation on natural tables.
The fancy tricks one can to with Natural Tables seem to work within the body of the table where I don't need them but fail in the header area where I do need them. This example, takein from the wiki, works (of course.) \setupTABLE[row][odd][background=color,backgroundcolor=red, width=.2\textwidth] \bTABLE[split=yes] \bTR \bTD[nr=3] 1 \eTD \bTD[nc=2] 2/3 \eTD \bTD[nr=3] 4 \eTD \eTR \bTR \bTD 2 \eTD \bTD 3 \eTD \eTR \bTR \bTD 2 \eTD \bTD 3 \eTD \eTR \bTR \bTD[nc=3] 1/2/3 \eTD \bTD 4 \eTD \eTR \bTR \bTD 1 \eTD \bTD 2 \eTD \bTD 3 \eTD \bTD 4 \eTD \eTR \eTABLE But if I convert the above data items to header items the run fails. Specifically the following fails: \setupTABLE[row][odd][background=color,backgroundcolor=red, width=.2\textwidth] \bTABLE[split=yes] \bTABLEhead \bTR \bTH[nr=3] 1 \eTH \bTH[nc=2] 2/3 \eTH \bTH[nr=3] 4 \eTH \eTR \bTR \bTH 2 \eTH \bTH 3 \eTH \eTR \bTR \bTH 2 \eTH \bTH 3 \eTH \eTR \bTR \bTH[nc=3] 1/2/3 \eTH \bTH 4 \eTH \eTR \bTR \bTH 1 \eTH \bTH 2 \eTH \bTH 3 \eTH \bTH 4 \eTH \eTR \eTABlehead \eTABLE What did I miss? Here is the error message: bTR \bTH [nr=3] 1 \eTH \bTH [nc=2] 2/3 \eTH \bTH [nr=3] 4 \eTH \eTR \ETC. ! File ended while scanning use of \doTABLEhead. inserted text \par * tabletest.tex emergencyend ? - -- John Culleton Able Indexing and Typesetting Precision typesetting (tm) at reasonable cost. Satisfaction guaranteed. http://wexfordpress.com ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] tree charts
On Wednesday 21 February 2007 13:18, Aditya Mahajan wrote: On Wed, 21 Feb 2007, Idris Samawi Hamid wrote: Dear cabal, Do any of you have any examples of tree charts done in, say, MetaFun? Are there any macros, libraries etc. for easy tree charts in \ConTeXt? Example: http://www.mathematik.uni-kl.de/~anne/Aufl-Bilder/D7Tree.jpg There are three ways you can do it in ConTeXt 1) Most features: pstricks (yes pstricks can be used with context, but you always have to go the ps-pdf route) My understanding is that the m-pstric module allows direct use of pstricks in Context, and handles the mechanics of conversion from dvips to ps to pdf by an extra pass. (However I am often wrong.) -- John Culleton Able Indexing and Typesetting Precision typesetting (tm) at reasonable cost. Satisfaction guaranteed. http://wexfordpress.com ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] FYI
Info for the gang: http://slashdot.org/comments.pl?sid=223940threshold=1commentsort=0mode=threadpid=18135068#18135322 (last paragraph) This does not affect me or many of us but it's good to know the vibes out there. Best Idris -- Professor Idris Samawi Hamid Department of Philosophy Colorado State University Fort Collins, CO 80523 -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Math Sets (ConTeXt port of braket.sty)
Hi, I find myself writing a lot of probability expressions where I want the delimiters to scale automatically, and | (conditional sign) to scale automatically, and the spacing around | to be correct. In LaTeX, I used to use braket package to do this. Since moving to ConTeXt, I was doing this by hand, but wring a lot of \EXP\left\{ ... \,\middle\, ...\right\} and \Pr( ... \mid ...) soon became a pain to read and write. So (thanks to Taco's first hand knowledge of why TeX is Turing complete), I have written the following macros: \unprotect \definesystemvariable {ms} % Math Set \def\mathsetmiddle{\,\middle\mathsetparameter\c!middle\,} \let\currentmathset\empty \def\mathsetparameter#1% {\executeifdefined{\??ms\currentmathset#1}{\executeifdefined{\??ms#1}\empty}} \def\definemathset {\dodoubleargument\dodefinemathset} \def\dodefinemathset[#1][#2]% {\getparameters[\??ms#1] [\c!text=,\c!left={\{},\c!right={\}},\c!middle=\vert,#2] \setvalue{#1}{\dododefinemathset[#1]}} \def\dododefinemathset[#1]#2#% {\begingroup \def\currentmathset{#1} \mathcode`\|32768 \let|\mathsetmiddle \def\mathsetarguments{#2} \dodododefinemathset} \def\dodododefinemathset#1% {\doifsomething{\mathsetparameter\c!text} {\mathop{\mathsetparameter\c!text\mathsetarguments}} \left\mathsetparameter\c!left#1\right\mathsetparameter\c!right \endgroup} \protect which allows me to do \definemathset[EXP][text={\mfunction{E}}] \definemathset[PR][text={\mfunction{Pr}},left=(,right=)] \starttext Correct spacing around the vertical bar. \startformula \EXP{f(X) | Y} = \sum_{x} f(x) \PR{x|Y} \stopformula Correct scaling of delimiters (as correct as left and right give you) \startformula \EXP{\sum_z f(X,z) | Y} = \sum_{x,z} f(x,z) \PR{x,z|Y} \stopformula Correct handling of sub|/|super scripts \startformula \EXP_X{f(X) | Y} = \sum_{x} f(x) \PR{x|Y} \stopformula Is there anyone else interested in this kind of stuff? I have not ported all the features of braket.sty, but only those that I needed. Other should not be too difficult to port. Hans and Taco: Does it make sense to add these to the core? If so, I can polish the macros a bit (add a \setupmathsets command). Aditya I think I will need it near in the future. Thanks for nice the nice works. Zulkifli ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context