[NTG-context] Bug in mathmatrix and possible fix
Dear devs, It is currently not possible to have nested mathmatrices. The reason is that \popmacro\math_matrix_NC is done at an inner scope and a succeeding \endgroup will happily overwrite this again. A possible fix is to move \popmacro\math_matrix_NC to the very outer scope in \math_matrix_stop, see below. I don't know and have not tested whether this breaks something else. Cheers, Henri --- \unprotect \def\math_matrix_stop {\crcr % \ifgridsnapping \else \mathstrut\crcr \noalign{\vskip-\baselineskip}% % \fi \egroup %\popmacro\math_matrix_NC % Too early! \egroup \mathmatrixright \endgroup \popmacro\math_matrix_NC} % ungrouped! \protect \definemathmatrix[pmatrix][left={\left(}, right={\right)}, distance=2em] \def\matOne{\startmatrix\NC 1 \NC 0 \NR\NC 0 \NC 1\NR\stopmatrix} \def\matTwo{\startmatrix\NC a\NR\NC b\NR\stopmatrix} \def\matThree{\startmatrix\NC c \NC d\NR\stopmatrix} \starttext \startformula \startpmatrix \NC \matOne \NC \matTwo\NR \NC \matThree \NC e\NR \stoppmatrix \stopformula \startformula \startpmatrix \NC 1 \NC 0 \NC a \NR \NC 0 \NC 1 \NC b \NR \NC c \NC d \NC e\NR \stoppmatrix \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] Background with rounded corners (Metafun)
Sorry 'corner=00' ! 2017-08-23 1:01 GMT+02:00 Fabrice Couvreur: > Hi Aditya, > Sorry I forgot to attach the image of what I want to do. I know corner=number > parameter of framed and framed text but I wanted to do it with Metafun. > Thank you > Fabrice > > 2017-08-23 0:50 GMT+02:00 Aditya Mahajan : > >> On Wed, 23 Aug 2017, Fabrice Couvreur wrote: >> >> Hello, >>> I would like to have three corners rounded as in the figure. >>> >> >> Not sure if you had simplified your example or not. But if all you want >> is a rounded corner, you can consider using corner=number parameter of >> framed and framed text: >> >> http://wiki.contextgarden.net/Framed#Rounded_Corners >> >> Here is an example (that does not use metapost). >> >> \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] >> \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] >> >> \defineornament >> [FrameTitle] >> [preset=lefttop] >> [ >> frame=off, >> foregroundstyle=\bfx, >> foregroundcolor=white, >> background=color, >> backgroundcolor=MyColorB, >> ] >> >> \defineframedtext >> [FramedText] >> [ >> offset=0.6em, >> toffset=\lineheight, >> background=color, >> backgroundcolor=MyColorA, >> foregroundstyle={\switchtobodyfont[10pt]}, >> align=verytolerant, >> frame=off, >> corner=01, >> ] >> >> >> \showframe >> \starttext >> >> \FrameTitle{Info}{\startFramedText[width=10cm] >> L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs >> (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). >> >> 1 EVP représente environ \unit{38,5 cubic meter}. >> \stopFramedText} >> >> \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/list >> info/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 ___
Re: [NTG-context] Background with rounded corners (Metafun)
With your solution 'corner=01' 2017-08-23 1:01 GMT+02:00 Fabrice Couvreur: > Hi Aditya, > Sorry I forgot to attach the image of what I want to do. I know corner=number > parameter of framed and framed text but I wanted to do it with Metafun. > Thank you > Fabrice > > 2017-08-23 0:50 GMT+02:00 Aditya Mahajan : > >> On Wed, 23 Aug 2017, Fabrice Couvreur wrote: >> >> Hello, >>> I would like to have three corners rounded as in the figure. >>> >> >> Not sure if you had simplified your example or not. But if all you want >> is a rounded corner, you can consider using corner=number parameter of >> framed and framed text: >> >> http://wiki.contextgarden.net/Framed#Rounded_Corners >> >> Here is an example (that does not use metapost). >> >> \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] >> \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] >> >> \defineornament >> [FrameTitle] >> [preset=lefttop] >> [ >> frame=off, >> foregroundstyle=\bfx, >> foregroundcolor=white, >> background=color, >> backgroundcolor=MyColorB, >> ] >> >> \defineframedtext >> [FramedText] >> [ >> offset=0.6em, >> toffset=\lineheight, >> background=color, >> backgroundcolor=MyColorA, >> foregroundstyle={\switchtobodyfont[10pt]}, >> align=verytolerant, >> frame=off, >> corner=01, >> ] >> >> >> \showframe >> \starttext >> >> \FrameTitle{Info}{\startFramedText[width=10cm] >> L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs >> (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). >> >> 1 EVP représente environ \unit{38,5 cubic meter}. >> \stopFramedText} >> >> \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/list >> info/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 ___
Re: [NTG-context] Background with rounded corners (Metafun)
Hi Aditya, Sorry I forgot to attach the image of what I want to do. I know corner=number parameter of framed and framed text but I wanted to do it with Metafun. Thank you Fabrice 2017-08-23 0:50 GMT+02:00 Aditya Mahajan: > On Wed, 23 Aug 2017, Fabrice Couvreur wrote: > > Hello, >> I would like to have three corners rounded as in the figure. >> > > Not sure if you had simplified your example or not. But if all you want is > a rounded corner, you can consider using corner=number parameter of framed > and framed text: > > http://wiki.contextgarden.net/Framed#Rounded_Corners > > Here is an example (that does not use metapost). > > \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] > \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] > > \defineornament > [FrameTitle] > [preset=lefttop] > [ > frame=off, > foregroundstyle=\bfx, > foregroundcolor=white, > background=color, > backgroundcolor=MyColorB, > ] > > \defineframedtext > [FramedText] > [ > offset=0.6em, > toffset=\lineheight, > background=color, > backgroundcolor=MyColorA, > foregroundstyle={\switchtobodyfont[10pt]}, > align=verytolerant, > frame=off, > corner=01, > ] > > > \showframe > \starttext > > \FrameTitle{Info}{\startFramedText[width=10cm] > L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs > (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). > > 1 EVP représente environ \unit{38,5 cubic meter}. > \stopFramedText} > > \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 ___
Re: [NTG-context] Background with rounded corners (Metafun)
On Wed, 23 Aug 2017, Fabrice Couvreur wrote: Hello, I would like to have three corners rounded as in the figure. Not sure if you had simplified your example or not. But if all you want is a rounded corner, you can consider using corner=number parameter of framed and framed text: http://wiki.contextgarden.net/Framed#Rounded_Corners Here is an example (that does not use metapost). \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] \defineornament [FrameTitle] [preset=lefttop] [ frame=off, foregroundstyle=\bfx, foregroundcolor=white, background=color, backgroundcolor=MyColorB, ] \defineframedtext [FramedText] [ offset=0.6em, toffset=\lineheight, background=color, backgroundcolor=MyColorA, foregroundstyle={\switchtobodyfont[10pt]}, align=verytolerant, frame=off, corner=01, ] \showframe \starttext \FrameTitle{Info}{\startFramedText[width=10cm] L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). 1 EVP représente environ \unit{38,5 cubic meter}. \stopFramedText} \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 ___
[NTG-context] Background with rounded corners (Metafun)
Hello, I would like to have three corners rounded as in the figure. Thank you Fabrice \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] \startuseMPgraphic{MyFrame} path b ; picture p ; p := textext.rt("\bf\tfx\white\framedtextparameter{Title}") ; p := p shifted (.3EmWidth,OverlayHeight-.6EmWidth) ; b := boundingbox p enlarged .3EmWidth ; fill OverlayBox withcolor \MPcolor{MyColorA} ; fill b withcolor \MPcolor{MyColorB} ; draw p ; setbounds currentpicture to boundingbox currentpicture enlarged 2mm ; \stopuseMPgraphic \defineoverlay [MyFrame] [\useMPgraphic{MyFrame}] \defineframedtext [MyFrame] [frame=off, foregroundstyle={\switchtobodyfont[10pt]}, background=MyFrame, align={verytolerant}, height=fit] \definefloat [recipe] [figure] \setupfloat [recipe] [default={right,none}] \showframe \starttext \placerecipe{} {\startMyFrame[Title=Info,width=10cm] L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). 1 EVP représente environ \unit{38,5 cubic meter}. \stopMyFrame } \input knuth \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 ___
[NTG-context] Problem with placing a float and a tab
Hello, How should the table be placed correctly ? Thanks Fabrice \unexpanded\def\pcent#1{\math{#1\,\%}} \startsetups [table:one] \setupTABLE[start][align={middle,lohi},width=2.2cm,offset=0.8ex] \setupTABLE[column][first][width=2cm,align={right}] \setupTABLE[1][1][frame=off] \setupTABLE[row][7][frame=off,align={left}] \stopsetups \definecolor[MyColorA][r=0.8784, g=0.8784, b=0.8784] \definecolor[MyColorB][c=0.00,m=0.27,y=1.00,k=0.00] \startuseMPgraphic{MyFrame} path b ; picture p ; p := textext.rt("\bf\tfx\white\framedtextparameter{Title}") ; p := p shifted (2BodyFontSize,OverlayHeight-ypart center p+.25ExHeight) ; b := boundingbox p enlarged .3EmWidth ; fill OverlayBox withcolor \MPcolor{MyColorA} ; fill b withcolor \MPcolor{MyColorB} ; draw p ; setbounds currentpicture to boundingbox currentpicture enlarged 2mm ; \stopuseMPgraphic \defineoverlay [MyFrame] [\useMPgraphic{MyFrame}] \defineframedtext [MyFrame] [frame=off, foregroundstyle={\switchtobodyfont[8pt]}, background=MyFrame, align={verytolerant}, height=fit] \definefloat [recipe] [figure] \setupfloat [recipe] [default={right,none}] \showframe \starttext \placerecipe{} {\startMyFrame[Title=Info,width=5cm] L'équivalent vingt pieds (EVP) est une unité de mesure de conteneurs (de longueur courante 20 pieds, soit environ \unit{6,1 meter}). 1 EVP représente environ \unit{38,5 cubic meter}. \stopMyFrame } Le tableau ci-dessous dresse le bilan du transport combiné fluvial en France pour l'activité de conteneurs entre 2010 et 2012, en équivalents vingt pieds (EVP). \startmidaligned \bTABLE[setups=table:one] \bTR \bTD \eTD \bTD 2010 \eTD \bTD 2011 \eTD \bTD 2012 \eTD \bTD 2011/2010 \eTD \bTD 2012/2011 \eTD \eTR \bTR \bTD Rhône \eTD \bTD 61\,633\eTD \bTD 69\,637\eTD \bTD 77\,314\eTD \bTD \pcent{+13,0} \eTD \bTD \pcent{+11,0} \eTD \eTR \bTR \bTD Seine \eTD \bTD 195\,467\eTD \bTD 237\,400\eTD \bTD 241\,004\eTD \bTD \pcent{+21,5} \eTD \bTD \pcent{+5,7}\eTD \eTR \bTR \bTD Nord\eTD \bTD 50\,483 \eTD \bTD 68\,145 \eTD \bTD 67\,835 \eTD \bTD \pcent{+35,0} \eTD \bTD \pcent{-0,5}\eTD \eTR \bTR \bTD Rhin\eTD \bTD 182\,478\eTD \bTD 156\,818\eTD \bTD 164\,017\eTD \bTD \pcent{-14,1} \eTD \bTD \pcent{+4,6}\eTD \eTR \bTR \bTH Total \eTH \bTH 490\,061\eTH \bTH 532\,000\eTH \bTH 560\,170\eTH \bTH \pcent{+8,6}\eTH \bTH \pcent{+5,3}\eTH \eTR \bTR \bTD [nc=4] \tfx\bf Source : Voies navigables de France (VNF)\eTD \eTR \eTABLE \stopmidaligned \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 ___
[NTG-context] Alignment problem in a table
Hello, How to align the text of the seventh line to the left ? Thanks Fabrice \unexpanded\def\pcent#1{\math{#1\,\%}} \startsetups [table:one] \setupTABLE[start][align={middle,lohi},width=2.2cm,offset=0.8ex] \setupTABLE[column][first][width=2.5cm,align={right}] \setupTABLE[1][1][frame=off] \setupTABLE[row][7][frame=off,align={left}] \stopsetups \starttext \startmidaligned \bTABLE[setups=table:one] \bTR \bTD \eTD \bTD 2010 \eTD \bTD 2011 \eTD \bTD 2012 \eTD \bTD 2011/2010 \eTD \bTD 2012/2011 \eTD \eTR \bTR \bTD Rhône \eTD \bTD 61\,633\eTD \bTD 69\,637\eTD \bTD 77\,314\eTD \bTD \pcent{+13,0} \eTD \bTD \pcent{+11,0} \eTD \eTR \bTR \bTD Seine \eTD \bTD 195\,467\eTD \bTD 237\,400\eTD \bTD 241\,004\eTD \bTD \pcent{+21,5} \eTD \bTD \pcent{+5,7}\eTD \eTR \bTR \bTD Nord\eTD \bTD 50\,483 \eTD \bTD 68\,145 \eTD \bTD 67\,835 \eTD \bTD \pcent{+35,0} \eTD \bTD \pcent{-0,5}\eTD \eTR \bTR \bTD Rhin\eTD \bTD 182\,478\eTD \bTD 156\,818\eTD \bTD 164\,017\eTD \bTD \pcent{-14,1} \eTD \bTD \pcent{+4,6}\eTD \eTR \bTR \bTH Total \eTH \bTH 490\,061\eTH \bTH 532\,000\eTH \bTH 560\,170\eTH \bTH \pcent{+8,6}\eTH \bTH \pcent{+5,3}\eTH \eTR \bTR \bTD [nc=4] \tfx\bf Source : Voies navigables de France (VNF)\eTD \eTR \eTABLE \stopmidaligned \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] Footnote in TABLE isn't rendered anywhere
On 08/22/2017 03:17 AM, Brian Ballsun-Stanton wrote: > Hi Pablo, > > It helped. (The numbers are eaten, but I think the example is important. Hi Brian, sorry, I simply forgot (and I didn’t see it in the sample because I didn’t wrap everything inside a TEXpage). \setupnotations[alternative=serried] is required here: \setupnotes[location=text] \setupnotations[alternative=serried] \starttext \bTABLE[split=repeat,align=normal] \bTR\bTD Something\postponenotes\footnote[x]{bla bla}\eTD\eTR \bTR\bTD Foo\note[x] \eTD\eTR \eTABLE \flushnotes \placenotes[footnote] \stoptext BTW, it would be important to warn the reader that both \setupnotes and \setupnotations are required because of the wiki. I hope it is fine now, Pablo -- http://www.ousia.tk ___ 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] Footnote in TABLE isn't rendered anywhere
Hi Pablo, It helped. (The numbers are eaten, but I think the example is important. Thanks for your help. -Brian On 22 August 2017 at 03:21, Pablo Rodriguezwrote: > On 08/21/2017 03:15 AM, Brian Ballsun-Stanton wrote: > > Hey folks, trying to be a good citizen, I added (And quoted) this > > message onto the wiki: > > > > http://wiki.contextgarden.net/TABLE#Footnotes_in_TABLEs > > > > I tried for a bit to try to get the example to render, but no footnotes > > would show at all. Anyone have thoughts as to how to get wiki rendering > > to work here? And are there any other examples from this thread that > > should be added? > > Hi Brian, > > footnotes in the wiki are tricky: > > \starttext > \startbuffer > \bTABLE[split=repeat,align=normal] >\bTR\bTD Something\postponenotes\footnote[x]{bla bla}\eTD\eTR >\bTR\bTD Foo\note[x] \eTD\eTR > \eTABLE > \flushnotes > \stopbuffer > \getbuffer > \startTEXpage[offset=1em] > \getbuffer > \stopTEXpage > \stoptext > > The second page is similar to the problem with the wiki. > > This might be a workaround for the wiki (if I’m not wrong): > > \setupnotes[location=text] > \starttext > \bTABLE[split=repeat,align=normal] >\bTR\bTD Something\postponenotes\footnote[x]{bla bla}\eTD\eTR >\bTR\bTD Foo\note[x] \eTD\eTR > \eTABLE > \flushnotes > \placenotes[footnote] > \stoptext > > Just in cases it helps, > > Pablo > -- > http://www.ousia.tk > > ___ > 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 ___