[NTG-context] Re: Caching Metafun images and VIM Syntax highlighted code

2024-01-24 Thread Shiv Shankar Dayal
metafun images in MkII, but I don't > know if that is really needed in LMTX. In most cases, metapost processing > does not have a significant processing delay. > if images are the same one can use the reuseMPgraphic or uniqueMPgraphic > featu

[NTG-context] Re: Caching Metafun images and VIM Syntax highlighted code

2024-01-24 Thread Hans Hagen
if that is really needed in LMTX. In most cases, metapost processing does not have a significant processing delay. if images are the same one can use the reuseMPgraphic or uniqueMPgraphic features .. plenty of examples can be found, but as Aditya poined out mp is quite fast (but reuse saves on file

[NTG-context] Re: Equivalent of the \cancel command with conTeXt

2023-08-22 Thread Fabrice Couvreur
cture cross; > cross := image(draw (0,0)--(1,1); draw (0,1)--(1,0);); > draw cross xscaled \overlaywidth yscaled \overlayheight withpen pencircle > scaled .8pt ; > \stopuniqueMPgraphic > > \defineoverlay[canceloverlay][\uniqueMPgraphic{cross out}] > > \define[1]\cancel{% >

[NTG-context] Re: Equivalent of the \cancel command with conTeXt

2023-08-22 Thread Alexandre Christe
; \stopuniqueMPgraphic \defineoverlay[canceloverlay][\uniqueMPgraphic{cross out}] \define[1]\cancel{%  \ifmmode  \mframed[background=canceloverlay, frame=off, offset=overlay]{{#1}}%  \else%  \framed[background=canceloverlay, frame=off, offset=overlay]{{#1}}%  \fi% } Maybe something else is available nowadays

Re: [NTG-context] Chapter title in MetaFun manual.

2023-02-10 Thread Jeong Dal via ntg-context
led 1mm ; > drawoptions(withcolor .625yellow) ; > draw llcorner p -- lrcorner p ; > setbounds currentpicture to p ; > \stopuniqueMPgraphic > > \defineoverlay[titled][\uniqueMPgraphic{titled}] > > \define[2]\ChapterCommand% > {\setbox0=\hbox to \leftmarginwidth{#1\hss}

[NTG-context] Chapter title in MetaFun manual.

2023-02-10 Thread Jeong Dal via ntg-context
ght ; pickup pencircle scaled 1mm ; drawoptions(withcolor .625yellow) ; draw llcorner p -- lrcorner p ; setbounds currentpicture to p ; \stopuniqueMPgraphic \defineoverlay[titled][\uniqueMPgraphic{titled}] \define[2]\ChapterCommand% {\setbox0=\hbox to \leftmarginwidth{#1\hss}% \hs

Re: [NTG-context] Is this possible to do the same

2022-12-12 Thread Ursula Hermann via ntg-context
; \stopuniqueMPgraphic \defineoverlay[canceloverlay][\uniqueMPgraphic{cross out}] \define[1]\cancel{% \ifmmode \mframed[background=canceloverlay, frame=off, offset=overlay]{{#1}}% \else% \framed[background=canceloverlay, frame=off, offset=overlay]{{#1}}% \fi% } \starttext \dots E.g

Re: [NTG-context] Is this possible to do the same

2022-12-12 Thread Gavin via ntg-context
scaled .8pt ; \stopuniqueMPgraphic \defineoverlay[canceloverlay][\uniqueMPgraphic{cross out}] \define[1]\cancel{% \ifmmode \mframed[background=canceloverlay, frame=off, offset=overlay]{{#1}}% \else% \framed[background=canceloverlay, frame=off, offset=overlay]{{#1}}% \fi% } \starttext

[NTG-context] Perceptrons

2022-10-16 Thread Thangalin via ntg-context
ons scaled SCALE; \stopuseMPgraphic \startuseMPgraphic{HexGridBgGraphic} % Define the grid background colour color gridback; gridback := (0.15, 0.18, 0.24); fill unitsquare xyscaled (OverlayWidth, OverlayHeight) withcolor gridback; \stopuseMPgraphic \defineoverlay[HexGri

Re: [NTG-context] no greyscales in MetaFun any more?

2022-07-21 Thread Alan via ntg-context
l.lft(100-s, (0, (s-2.5)*mm)); > > endfor; > > \stopMPpage > > > > This used to work with previous LMTX versions. > fixed in next upload Is this related? (regression: uniqueMPgraphic drops color) \startuniqueMPgraphic{red} draw textext("red?") withcolor red ; \st

Re: [NTG-context] positioning of metapost figure

2021-09-12 Thread Sylvain Hubert via ntg-context
> > \startuniqueMPgraphic{concept} > > draw fullcircle scaled 1cm shifted (10cm,10cm); > > \stopuniqueMPgraphic > > \defineoverlay[concept][\uniqueMPgraphic{concept}] > > \setupbackgrounds[page][background=concept] > > \starttext > > . > > \stoptext > >

Re: [NTG-context] positioning of metapost figure

2021-09-12 Thread Hans Hagen via ntg-context
ay[concept][\uniqueMPgraphic{concept}] \setupbackgrounds[page][background=concept] \starttext . \stoptext How should the metapost background figure be positioned correctly? \startuniqueMPgraphic{concept} StartPage; draw fullcircle scaled 1cm shifted (10cm,10cm); draw Page withpen

[NTG-context] positioning of metapost figure

2021-09-12 Thread Sylvain Hubert via ntg-context
Dear List, The following code draws a circle at the center of the page, ignoring the "shifted" part. \startuniqueMPgraphic{concept} draw fullcircle scaled 1cm shifted (10cm,10cm); \stopuniqueMPgraphic \defineoverlay[concept][\uniqueMPgraphic{concept}] \setupbackgrounds[page][backgrou

Re: [NTG-context] Lua code and table

2021-02-19 Thread Hans Hagen
,0) -- (\MPvar{width},\MPvar{height}) ; ) withpen pencircle scaled \MPvar{line} withcolor \MPvar{color} ; \stopuniqueMPgraphic \definesymbol [MyRedCross] [\uniqueMPgraphic{cross}{width=1em,height=1ex,depth=.5ex,color=red,line=.2ex}] \definesymbol [MyGreenCross] [\uni

Re: [NTG-context] Lua code and table

2021-02-18 Thread Fabrice Couvreur
context.stopxrow() > end > context.stopxtable() > > end > \stopluacode > > \startuniqueMPgraphic{cross}{width,height,depth,color,line} > draw image ( > draw (\MPvar{depth},\MPvar{height}) -- (\MPvar{width},0) ; > draw (\MPvar{d

Re: [NTG-context] Lua code and table

2021-02-18 Thread Hans Hagen
end \stopluacode \startuniqueMPgraphic{cross}{width,height,depth,color,line} draw image ( draw (\MPvar{depth},\MPvar{height}) -- (\MPvar{width},0) ; draw (\MPvar{depth},0) -- (\MPvar{width},\MPvar{height}) ; ) withpen pencircle scaled \MPvar{line} withcolor \MPv

Re: [NTG-context] More table questions

2020-09-22 Thread Aditya Mahajan
entpicture to OverlayBox; \stopuseMPgraphic \defineoverlay[booktabs_bottom] [\uniqueMPgraphic{booktabs_bottom}] \installbottomframerenderer{booktabs}{\uniqueMPgraphic{booktabs_bottom}} \startsetups booktabs \setupTABLE[each][each][frame=off, rulethickness=1.2bp] \setupTABLE[row][first][topframe=

Re: [NTG-context] Unexpected result when using PaperHeight and MetaFUun

2020-04-19 Thread Keith McKay
{blueShade} draw lmt_shade [     path    = fullsquare xyscaled (OverlayWidth,OverlayHeight) ,     direction   = "up",     alternative = "linear",     colors  = { "red", "blue" }, ] ; \stopuniqueMPgraphic \defineoverlay [mybg] [\uniqueMPgraphic{blueShade

Re: [NTG-context] Unexpected result when using PaperHeight and MetaFUun

2020-04-19 Thread Wolfgang Schuster
] ; \stopuniqueMPgraphic \defineoverlay [mybg] [\uniqueMPgraphic{blueShade}] \setupbackgrounds [page] [background=mybg] \starttext \startMPpage StartPage ; % Result Left draw lmt_shade [ path= unitsquare xscaled 2cm yscaled PaperHeight, direction

[NTG-context] Unexpected result when using PaperHeight and MetaFUun

2020-04-19 Thread Keith McKay
=\paperheight] % let the layer cover the full paper \startuniqueMPgraphic{blueShade} draw lmt_shade [ path = fullsquare xyscaled(PaperWidth,PaperHeight), direction = "up", alternative = "linear", colors = { "red", "blue" }, ]; \stopuniqueMPgraphic \s

Re: [NTG-context] offset for background overlay

2020-04-13 Thread mf
OverlayWidth yscaled 2.5 OverlayHeight ; draw p withcolor red ; setbounds currentpicture to p topenlarged 6mm ; \stopuseMPgraphic \defineoverlay[triangle][{\uniqueMPgraphic{cell:triangle}}] \starttext \bTABLE[frame=off] \bTR \bTD[nx=2,align=middle,background=triangle] \dontleavehmode a\crlf

Re: [NTG-context] offset for background overlay

2020-04-11 Thread mf
, this MWE is a simplified version of a real case: \startuseMPgraphic{cell:triangle}    path p ; p := unittriangle rotated 90 xscaled 2.5 OverlayWidth yscaled 2.5 OverlayHeight ;    draw p withcolor red ; \stopuseMPgraphic \defineoverlay[triangle][{\uniqueMPgraphic{cell:triangle}}] \starttext \bTABLE[frame=of

Re: [NTG-context] offset for background overlay

2020-04-11 Thread Wolfgang Schuster
; \stopuseMPgraphic \defineoverlay[triangle][{\uniqueMPgraphic{cell:triangle}}] \starttext \bTABLE[frame=off]    \bTR \bTD[nx=2,background=triangle,align=middle] \dontleavehmode a\crlf text \eTD    \eTR    \bTR[toffset=1mm] \bTD left \eTD \bTD right \eTD    \eTR \eTABLE \stoptext

Re: [NTG-context] offset for background overlay

2020-04-11 Thread Hans Hagen
][{\uniqueMPgraphic{cell:triangle}}] \starttext \bTABLE[frame=off]   \bTR     \bTD[nx=2,background=triangle,align=middle] \dontleavehmode a\crlf text \eTD   \eTR   \bTR[toffset=1mm]     \bTD left \eTD     \bTD right \eTD   \eTR \eTABLE \stoptext here's a very ugly solution \startuseMPgraphic

[NTG-context] offset for background overlay

2020-04-11 Thread mf
Hello list, this MWE is a simplified version of a real case: \startuseMPgraphic{cell:triangle} path p ; p := unittriangle rotated 90 xscaled 2.5 OverlayWidth yscaled 2.5 OverlayHeight ; draw p withcolor red ; \stopuseMPgraphic \defineoverlay[triangle][{\uniqueMPgraphic{cell:triangle

[NTG-context] Hatch color in a table cell

2020-03-12 Thread Fabrice Couvreur
} ) ; \stopuniqueMPgraphic \setupMPvariables [meta:hash] [gap=.25\bodyfontsize, angle=45, linewidth=\overlaylinewidth, linecolor=\overlaylinecolor] \def\metahashoverlay#1{\uniqueMPgraphic{meta:hash}{angle=#1}} \defineoverlay[meta:hash:right] [\metahashoverlay{ +45}] \defineoverlay[meta:hash:left

[NTG-context] maths simplifying fractions

2019-11-13 Thread jkitz
][\uniqueMPgraphic{cancel}] \defineframed[cancel] [background=cancel,frame=off,offset=0pt,location=low] \starttext \startformula 6 \frac{3}{8} \div 4 \frac{1}{2} = \frac{27}{4} \div \frac{9}{2} = \frac{\cancel{27}^3}{\cancel{4}^2} \times \frac{\cancel{2}^1}{\cancel{9}^1} = \frac{3}{2} = 1 \frac{1}{2

Re: [NTG-context] radiobuttons

2019-08-15 Thread Hans Hagen
phic{0} fill fullcircle scaled 1cm withcolor red ; \stopuniqueMPgraphic \startuniqueMPgraphic{1} fill fullcircle scaled 1cm withcolor green ; \stopuniqueMPgraphic \definesymbol[YES][\uniqueMPgraphic{1}] \definesymbol[NOP][\uniqueMPgraphic{0}] \setupfield[WHATEVER][width=20mm,height=20mm,fra

Re: [NTG-context] Graphics placement with columnsets/page grids (was "no subject)

2019-07-28 Thread Denis Maier
> >> \definecolor[color-1][.5(red,green)] >> \definecolor[color-2][.5(green,blue)] >> \definecolor[color-3][.5(blue,red)] >> \definecolor[color-4][.5(white,black)] >> \definecolor[color-5][.5(white,color-4)] >> >> \startuniqueMPgraphic{frame} >> fill O

[NTG-context] Graphics placement with columnsets/page grids (was "no subject)

2019-07-24 Thread Denis Maier
ck)] > \definecolor[color-5][.5(white,color-4)] > > \startuniqueMPgraphic{frame} > fill OverlayBox withcolor \MPcolor{color-1} ; > \stopuniqueMPgraphic > > \startuniqueMPgraphic{contrast} > fill OverlayBox withcolor \MPcolor{color-2} ; > \stopuniqueMPgraphic > >

[NTG-context] (no subject)

2019-07-23 Thread Denis Maier
} ; \stopuniqueMPgraphic \startuniqueMPgraphic{contrast} fill OverlayBox withcolor \MPcolor{color-2} ; \stopuniqueMPgraphic \defineoverlay[frame] [\uniqueMPgraphic{frame}] \defineoverlay[contrast][\uniqueMPgraphic{contrast}] \definecolumnset[example][n=2] %\setupcolumnsetstart[example][1][1][2

[NTG-context] index problem with \setupcolumnset

2018-11-09 Thread Peter Rolf
][\uniqueMPgraphic{column:bg}] \definecolumnset[TOC][n=4] %\setupcolumnset[TOC][background=columnbg]% works ok \setupcolumnset[TOC][1][background=columnbg]% any indexed setup fails % in my real world example the complete third argument is printed instead \starttext \startcolumnset[TOC] \input tufte.tex

Re: [NTG-context] drop shadow

2018-09-10 Thread Hans Hagen
arbitrary shapes, maybe even letters (like drop shadows e.g. in InDesign do). \startuniqueMPgraphic{mpnewshadow}{offset} MyOffset := \MPvar{offset} ; ... ... OverlayWidth ... \defineoverlay[newshadow][\uniqueMPgraphic{mpnewshadow}{offset=.3em}] you use unique graphics ... so you need to make

Re: [NTG-context] Circled text in metapost

2018-03-29 Thread Hans Hagen
withcolor darkred ; setbounds currentpicture to boundingbox p ; \stopuniqueMPgraphic \defineoverlay[half circle][\uniqueMPgraphic{half circle}] \starttext \framed[background=half circle,frame=off]{Text width half circle.} \stoptext Well, if you really want a tear down

Re: [NTG-context] Circled text in metapost

2018-03-29 Thread Henri Menke
darkred ; setbounds currentpicture to boundingbox p ; \stopuniqueMPgraphic \defineoverlay[half circle][\uniqueMPgraphic{half circle}] \starttext \framed[background=half circle,frame=off]{Text width half circle.} \stoptext > > My greatest problems seem to be in the e

Re: [NTG-context] About formatting the "Fonts out of ConTEXT" manual

2017-08-16 Thread Fabrice Couvreur
linecap := squared ; > > drawoptions(withcolor \MPcolor{darkred}) ; > > draw ulcorner p -- urcorner p ; > > setbounds currentpicture to p ; > > \stopuniqueMPgraphic > > > > \defineoverlay[titled][\uniqueMPgraphic{titled}] > > > > \startuseMPgrap

Re: [NTG-context] About formatting the "Fonts out of ConTEXT" manual

2017-08-15 Thread Henri
caled \overlaywidth yscaled \overlayheight ; >   pickup pencircle scaled 1mm ; >   linecap := squared ; >   drawoptions(withcolor \MPcolor{darkred}) ; >   draw ulcorner p -- urcorner p ; >   setbounds currentpicture to p ; > \stopuniqueMPgraphic > > \defineoverlay[titled

Re: [NTG-context] About formatting the "Fonts out of ConTEXT" manual

2017-08-15 Thread Henri
caled \overlaywidth yscaled \overlayheight ; >   pickup pencircle scaled 1mm ; >   linecap := squared ; >   drawoptions(withcolor \MPcolor{darkred}) ; >   draw ulcorner p -- urcorner p ; >   setbounds currentpicture to p ; > \stopuniqueMPgraphic > > \defineoverlay[titled

[NTG-context] About formatting the "Fonts out of ConTEXT" manual

2017-08-15 Thread Fabrice Couvreur
scaled 1mm ; linecap := squared ; drawoptions(withcolor \MPcolor{darkred}) ; draw ulcorner p -- urcorner p ; setbounds currentpicture to p ; \stopuniqueMPgraphic \defineoverlay[titled][\uniqueMPgraphic{titled}] \startuseMPgraphic{triangledone} fill lltriangle scaled 4cm withcolor darkred

Re: [NTG-context] Customize a table with Metafun

2017-02-15 Thread Fabrice Couvreur
encircle withcolor \MPcolor{red}) ; >> draw .5[llcorner p, lrcorner p]--.5[ulcorner p, urcorner p] ; >> setbounds currentpicture to p ; >> >> \stopuniqueMPgraphic >> >> \defineoverlay[Vertical][\uniqueMPgraphic{Vertical}] >> >> \startsetups[table:initi

Re: [NTG-context] Customize a table with Metafun

2017-02-14 Thread Lutz Haseloff
t; linecap:=squared ; > path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ; > drawoptions (withpen pencircle withcolor \MPcolor{red}) ; > draw .5[llcorner p, lrcorner p]--.5[ulcorner p, urcorner p] ; > setbounds currentpicture to p ; > >\stopuniqueMPgraphic

[NTG-context] Customize a table with Metafun

2017-02-14 Thread Fabrice Couvreur
[llcorner p, lrcorner p]--.5[ulcorner p, urcorner p] ; setbounds currentpicture to p ; \stopuniqueMPgraphic \defineoverlay[Vertical][\uniqueMPgraphic{Vertical}] \startsetups[table:initialize] \setupTABLE[start] [align={middle,lohi},offset=0.5ex,width=1.5cm, foregroundstyle

Re: [NTG-context] Title without the parentheses

2017-01-31 Thread Fabrice Couvreur
Pcolor{\overlaycolor} ; > draw p withcolor \MPcolor{\overlaylinecolor} ; > \stopuniqueMPgraphic > \setuplayout[grid=yes] > \defineoverlay[MyBackgroundLayer][\uniqueMPgraphic{MyShape}] > > \define[1]\MyExoCommand{% > \lower\strutdepth\hbox{\startframed > [backgroun

Re: [NTG-context] Title without the parentheses

2017-01-30 Thread Otared Kavian
pencircle scaled \overlaylinewidth ; fill p withcolor \MPcolor{\overlaycolor} ; draw p withcolor \MPcolor{\overlaylinecolor} ; \stopuniqueMPgraphic \setuplayout[grid=yes] \defineoverlay[MyBackgroundLayer][\uniqueMPgraphic{MyShape}] \define[1]\MyExoCommand{% \lower\strutdepth

Re: [NTG-context] Title without the parentheses

2017-01-30 Thread Otared Kavian
][\uniqueMPgraphic{MyShape}] \define[1]\MyExoCommand{% \startframed [background=MyBackgroundLayer, frame=off, width=3cm, backgroundcolor=darkred] {\white Exercice #1} \stopframed

Re: [NTG-context] \currentheadnumber does not work

2016-07-11 Thread Fabrice Couvreur
mbering[location=footer] >> >> \startusableMPgraphic{NumberHead} >> picture r ; >> r := image ( graphictext >> \MPstring{chapter} >> scaled 4pt >> withfillcolor \MPcolor{lightgray} >> withpen pencircle scal

Re: [NTG-context] \currentheadnumber does not work

2016-07-10 Thread Fabrice Couvreur
ad} > picture r ; > r := image ( graphictext > \MPstring{chapter} > scaled 4pt > withfillcolor \MPcolor{lightgray} > withpen pencircle scaled 1pt ; ) ; > draw r ; > \stopusableMPgraphic > > \defineoverlay[NumberHead

Re: [NTG-context] \currentheadnumber does not work

2016-07-09 Thread Wolfgang Schuster
footer] \startusableMPgraphic{NumberHead} picture r ; r := image ( graphictext \MPstring{chapter} scaled 4pt withfillcolor \MPcolor{lightgray} withpen pencircle scaled 1pt ; ) ; draw r ; \stopusableMPgraphic \defineoverlay[NumberHead][\uniqueMPg

Re: [NTG-context] \currentheadnumber does not work

2016-07-09 Thread Fabrice Couvreur
\defineoverlay[NumberHead][\uniqueMPgraphic{NumberHead}] \def\processMPheadnumber#1% {\setMPtext{chapter}{\bf#1} \useMPgraphic{NumberHead}} \unexpanded\def\HeadTitle#1#2% {\framed [frame=off, bottomframe=on, width=broad, align={broad,nothyphenated,left}] {#1\blank

[NTG-context] \currentheadnumber does not work

2016-07-09 Thread Fabrice Couvreur
1cm smoothed 1.2 ; \stopuseMPgraphic \defineoverlay[head][\uniqueMPgraphic{head}] \def\Headed#1% {\framed [background=head,frame=off,offset=overlay] {\color[white]{#1}}} \unexpanded\def\HeadTitle#1#2% {\framed [frame=off, bottomframe=on, width=broad, align={broad

Re: [NTG-context] Is there “toffset” option for \setupbackgrounds in context

2016-02-26 Thread Wolfgang Schuster
xtBackground][\uniqueMPgraphic{TextBackground}] \setuppapersize[A4] \setuppagenumbering[state=none] \setupbackgrounds[text][text][background=TextBackground] \starttext \input knuth \stoptext BTW: It’s rude to crosspost without mentioning this (http://tex.stackexchange.com/questions/296037/is-t

[NTG-context] Strange behavior (TikZ)

2015-08-11 Thread Fabrice Couvreur
currentpicture to p ; \stopuniqueMPgraphic \defineoverlay[titled][\uniqueMPgraphic{titled}] \define[2]\ChapterCommand {\setbox\scratchbox\hbox to \leftmarginwidth{#1\hss}% \hskip-\dimexpr\leftmarginwidth+\leftmargindistance\relax \framed [background=titled,frame=off,offset=0pt] {\box

Re: [NTG-context] Command that does not give the expected result (Metafun)

2015-08-10 Thread Fabrice Couvreur
:= unitsquare xscaled OverlayWidth yscaled OverlayHeight ; pickup pencircle scaled 1mm ; drawoptions(withcolor .625yellow) ; draw llcorner p--lrcorner p ; setbounds currentpicture to p ; \stopuniqueMPgraphic \defineoverlay[titled][\uniqueMPgraphic{titled}] \def\ChapterCommand#1#2

[NTG-context] Command that does not give the expected result (Metafun)

2015-08-09 Thread Fabrice Couvreur
\defineoverlay[titled][\uniqueMPgraphic{titled}] \def\ChapterCommand#1#2% {\setbox0=\hbox to \leftmarginwidth{#1\hss}% \hskip-\leftmarginwidth \hskip-\leftmargindistance \framed [background=titled,frame=off,offset=0pt] {\box0 \hskip\leftmargindistance #2}} \setuphead

Re: [NTG-context] Command that does not give the expected result (Metafun)

2015-08-09 Thread Hans Hagen
currentpicture to p ; \stopuniqueMPgraphic \defineoverlay[titled][\uniqueMPgraphic{titled}] \def\ChapterCommand#1#2% {\setbox0=\hbox to \leftmarginwidth{#1\hss}% \hskip-\leftmarginwidth \hskip-\leftmargindistance \framed [background=titled,frame=off,offset=0pt] {\box0

[NTG-context] Calculating a value in metapost, and using it in ConTeXt

2015-05-26 Thread Kate F
p, q; h := \overlayheight; w := \overlaywidth; % imagine this is more complex p = (0, 0) -- (w, .5h); q = (0, h) -- (w, 0); draw p; draw q; z0 = p intersectionpoint q; % btex \def\Z{ ypart z0 } etex; \stopuniqueMPgraphic \defineoverlay[canon][\uniqueMPgraphic

Re: [NTG-context] Update text variables inside metapost

2015-03-08 Thread Hans Hagen
}{text2}{text3}, 2. and four \Bolha[size=4cm]{text1}{text2}{text3}, but text1, text2 and text3 is not updated in every call; Use useMPgraphic instead of uniqueMPgraphic. uniqueMPgraphic recomputes the graphic only when the dimensions of figure has changed; otherwise, it reuses the previously drawn

Re: [NTG-context] Update text variables inside metapost

2015-03-07 Thread DesdeChaves
below, If I have \startitemize[columns,two] then metapost draw: 1. \Bolha[size=6cm]{text1}{text2}{text3}, 2. and four \Bolha[size=4cm]{text1}{text2}{text3}, but text1, text2 and text3 is not updated in every call; Use useMPgraphic instead of uniqueMPgraphic. uniqueMPgraphic recomputes

Re: [NTG-context] Update text variables inside metapost

2015-03-07 Thread Aditya Mahajan
]{text1}{text2}{text3}, but text1, text2 and text3 is not updated in every call; Use useMPgraphic instead of uniqueMPgraphic. uniqueMPgraphic recomputes the graphic only when the dimensions of figure has changed; otherwise, it reuses the previously drawn graphic. This behavior was useful

Re: [NTG-context] Define a new command from the command \periods[n]

2015-01-19 Thread Hans Hagen
][\uniqueMPgraphic{borderline}] \defineframedtext [Myframed] [width=0.6\textwidth, foregroundstyle={\switchtobodyfont[10pt]}, align={high,flushleft}, frame=off, framecolor=0.625white, background=borderline, location=middle, offset=.5ex] \starttext \startbuffer Ingrédients

Re: [NTG-context] Define a new command from the command \periods[n]

2015-01-18 Thread Fabrice
=0.00, y=0.00, k=0.25] \startuniqueMPgraphic{borderline} path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ; draw p withcolor \MPcolor{Border} dashed evenly withpen pencircle scaled 1.2pt ; \stopuniqueMPgraphic \defineoverlay[borderline][\uniqueMPgraphic{borderline

Re: [NTG-context] Center two frames

2015-01-14 Thread Pablo Rodriguez
\overlayheight ; draw p withcolor \MPcolor{Border} dashed evenly withpen pencircle scaled 1.2pt ; \stopuniqueMPgraphic \defineoverlay[borderline][\uniqueMPgraphic{borderline}] \startxtable[frame=off] \startxrow \startxcell[align=normal] Compléter chacun des algorithmes ci-dessous afin qu'ils

[NTG-context] Center two frames

2015-01-13 Thread Fabrice Couvreur
; draw p withcolor \MPcolor{Border} dashed evenly withpen pencircle scaled 1.2pt ; \stopuniqueMPgraphic \defineoverlay[borderline][\uniqueMPgraphic{borderline}] \placefigure[right,none]{}{ \start \switchtobodyfont[7pt] \startMPcode numeric u; u=0.7cm; z0=(0,0) ; z1=(2.5u,0) ; z2=(2.5u,2.5u) ; z3

Re: [NTG-context] Define a new type section with metafun

2014-12-28 Thread Fabrice
currentpicture to p ; draw p withcolor \MPcolor{\overlaylinecolor} ; \stopuniqueMPgraphic \defineoverlay[funny][\uniqueMPgraphic{funny}] \define[2]\MySectionCommand {\framed [background=funny, frame=off, width=fit, align={right}, framecolor

[NTG-context] Define a new type section with metafun

2014-12-27 Thread Akira Kakuto
} ; \stopuniqueMPgraphic \defineoverlay[funny][\uniqueMPgraphic{funny}] \define[2]\MySectionCommand {\framed [background=funny, frame=off, width=0.5\textwidth, align={right}, framecolor=mycolor, rulethickness=1.5pt, backgroundcolor=white

[NTG-context] Define a new type section with metafun

2014-12-26 Thread Fabrice Couvreur
withcolor \MPcolor{\overlaycolor} ; draw p withcolor \MPcolor{\overlaylinecolor} ; draw (20,0)--(20,h) withcolor red ; \stopuniqueMPgraphic \defineoverlay[funny][\uniqueMPgraphic{funny}] \define[2]\MySectionCommand {\framed [background=funny, frame=off, width=0.5

Re: [NTG-context] overlay

2014-11-24 Thread Peter Rolf
; \stopuniqueMPgraphic \defineoverlay[line][{\uniqueMPgraphic{line}}] and using it in \framed, but placing the line correctly is elusive. Just a quick and dirty solution. The trick is to draw the extra line as part of the graphic and then fake the boundingbox. This is also limited to a few

Re: [NTG-context] overlay

2014-11-24 Thread John Kitzmiller
; \stopuniqueMPgraphic \defineoverlay[line][{\uniqueMPgraphic{line}}] and using it in \framed, but placing the line correctly is elusive. Just a quick and dirty solution. The trick is to draw the extra line as part of the graphic and then fake the boundingbox. This is also limited to a few

Re: [NTG-context] overlay

2014-11-24 Thread Wolfgang Schuster
][{\uniqueMPgraphic{line}}] and using it in \framed, but placing the line correctly is elusive. Look at chapter 5 in the metafun manual. Wolfgang ___ If your question is of interest to others as well, please add an entry

[NTG-context] overlay

2014-11-22 Thread John Kitzmiller
of the rectangles? I have played with: \startuniqueMPgraphic{line} path a; a:=(0,0)--(0,3cm); draw a withpen pencircle scaled 3pt withcolor green; \stopuniqueMPgraphic \defineoverlay[line][{\uniqueMPgraphic{line}}] and using it in \framed, but placing the line correctly is elusive

Re: [NTG-context] Text background that spans the width of the page

2014-05-07 Thread Darksair
\defineoverlay[whatever][\uniqueMPgraphic{whatever}] \framed [background=whatever, backgroundcolor=green, frame=off, width=\textwidth] {test}% Thank you for this interesting solution! I didn’t know one could do that with Metapost. This does

Re: [NTG-context] Text background that spans the width of the page

2014-05-06 Thread Hans Hagen
leftenlarged BackSpace rightenlarged CutSpace withcolor OverlayColor ; setbounds currentpicture to OverlayBox enlarged max(BackSpace,CutSpace) ; \stopuniqueMPgraphic \defineoverlay[whatever][\uniqueMPgraphic{whatever}] \framed

[NTG-context] mp: choose colors randomly from list

2014-02-19 Thread Schmitz Thomas A.
] := (0.5, 0.8, 0.5) ; path p ; p := unitsquare scaled 2cm ; for i=1 upto 3: fill p shifted (i*2.5cm, 0) withcolor transparent (1,0.3,mycolor[round(uniformdeviate(i))]) ; endfor ; \stopuniqueMPgraphic \starttext \uniqueMPgraphic{colortest} \stoptext Is there a better approach? The selection

Re: [NTG-context] mp: choose colors randomly from list

2014-02-19 Thread Alan BRASLAU
) ; mycolor[2] := (0.6, 0.6, 0.4) ; mycolor[3] := (0.5, 0.8, 0.5) ; path p ; p := unitsquare scaled 2cm ; for i=1 upto 3: fill p shifted (i*2.5cm, 0) withcolor transparent (1,0.3,mycolor[round(uniformdeviate(i))]) ; endfor ; \stopuniqueMPgraphic \starttext \uniqueMPgraphic{colortest

Re: [NTG-context] mp: choose colors randomly from list

2014-02-19 Thread Otared Kavian
=\CoeffBlue ] \starttext \uniqueMPgraphic{colortest} \startcolor[RandomColor]\bf This is a RandomColor \stopcolor \stoptext Best regards: OK On 19 févr. 2014, at 11:10, Schmitz Thomas A. thomas.schm...@uni-bonn.de wrote: Hi all, I would like to have mp choose a (transparent) color randomly

[NTG-context] glyph path

2014-02-19 Thread Peter Rolf
currentpicture to boundingbox q; \stopuniqueMPgraphic \starttext \ctxlua{metapost.showlog = true} \uniqueMPgraphic{Dcaron} \ctxlua{inspect(metapost.variables[Dcaron])} \stoptext ___ If your question is of interest to others

[NTG-context] Need help defining command.

2013-10-22 Thread Keith J. Schultz
, OverlayHeight) -- (OverlayWidth, OverlayHeight) -- (OverlayWidth, 0) -- cycle withcolor OverlayLineColor; \stopuniqueMPgraphic %% Define Overlay for NassiSimpleFrameBox %% \defineoverlay[NassiSimpleFrameBox][\uniqueMPgraphic{NassiSimpleFrameBox

[NTG-context] nested mp

2013-10-07 Thread Hans Hagen
; \stopuniqueMPgraphic \defineoverlay[mytest][\uniqueMPgraphic{mytest}] \startMPpage[offset=1pt] fill fullcircle scaled 10cm withcolor red ; draw textext(\framed[background=mytest]{bla}) ; draw textext(test 1.1) xsized 8cm rotated 45 withcolor white/2 ; draw

Re: [NTG-context] flowchart: \comment does not work with background

2013-10-05 Thread Hans Hagen
; fill p withcolor green ; \stopuniqueMPgraphic \defineoverlay[mytest][\uniqueMPgraphic{mytest}] \starttext \framed[background=mytest]{this works} \startFLOWchart[test] \startFLOWcell \name{test} \text{test} \connection[lr]{test} % \comment[t:0.5]{\framed{this works}} \comment[t

[NTG-context] flowchart: \comment does not work with background

2013-10-04 Thread Peter Münster
\defineoverlay[mytest][\uniqueMPgraphic{mytest}] \starttext \framed[background=mytest]{this works} \startFLOWchart[test] \startFLOWcell \name{test} \text{test} \connection[lr]{test} % \comment[t:0.5]{\framed{this works}} \comment[t:0.5]{\framed[background=mytest]{bla

[NTG-context] mpgraphics confusion

2013-05-09 Thread Meer, H. van der
. \startuniqueMPgraphic-\uniqueMPgraphic this graphic is calculated for each distinctive case. I fail to see in what respect startuseMPgraphic en startuniqueMPgraphic do differ? Can someone please explain? Hans van der Meer

Re: [NTG-context] mpgraphics confusion

2013-05-09 Thread Marco Patzer
-\reuseMPgraphic for graphics that don't change. \startuniqueMPgraphic-\uniqueMPgraphic this graphic is calculated for each distinctive case. I fail to see in what respect startuseMPgraphic en startuniqueMPgraphic do differ? Can someone please explain? See: http://www.mail-archive.com/ntg-context

Re: [NTG-context] command for a MP graphic

2013-05-08 Thread Roland Thiers
:=\MPvar{unite}*cm ; numeric n ; n:=\MPvar{sides}; rest of the code \stopuniqueMPgraphic \define[2]\polyreg {\setupMPvariables[polygoneregulier][unite,sides] \uniqueMPgraphic{polygoneregulier}{sides=#1,unite=#2}} You can define the command as \define[2]\polyreg {\setupMPvariables[polygoneregular

Re: [NTG-context] command for a MP graphic

2013-05-07 Thread Marco Patzer
; draw fullcircle scaled 6u withcolor blue; \stopuniqueMPgraphic %% \polyreg{number} \define[1]\polyreg {\setupMPvariables[polygoneregulier][sides=#1]%% \uniqueMPgraphic{polygoneregulier}} \starttext \dontleavehmode \dorecurse{9}{\polyreg\recurselevel\space} \stoptext You can extent

Re: [NTG-context] command for a MP graphic

2013-05-07 Thread Roland Thiers
) ; polygone[i]:=a[i-1]--a[i]; draw polygone[i]; endfor; draw fullcircle scaled 6u withcolor blue; \stopuniqueMPgraphic %% \polyreg{number} \define[1]\polyreg {\setupMPvariables[polygoneregulier][sides=#1]%% \uniqueMPgraphic{polygoneregulier}} \starttext \dontleavehmode \dorecurse{9

Re: [NTG-context] command for a MP graphic

2013-05-07 Thread Wolfgang Schuster
(origin,i*360/n) ; polygone[i]:=a[i-1]--a[i]; draw polygone[i]; endfor; draw fullcircle scaled 6u withcolor blue; \stopuniqueMPgraphic %% \polyreg{number} \define[1]\polyreg {\setupMPvariables[polygoneregulier][sides=#1]%% \uniqueMPgraphic{polygoneregulier}} \define[1]\polyreg

Re: [NTG-context] command for a MP graphic

2013-05-07 Thread Roland Thiers
: a[i]:=a[0] rotatedaround(origin,i*360/n) ; polygone[i]:=a[i-1]--a[i]; draw polygone[i]; endfor; draw fullcircle scaled 6u withcolor blue; \stopuniqueMPgraphic %% \polyreg{number} \define[1]\polyreg {\setupMPvariables[polygoneregulier][sides=#1]%% \uniqueMPgraphic{polygoneregulier}} \define[1

Re: [NTG-context] command for a MP graphic

2013-05-07 Thread Wolfgang Schuster
}; rest of the code \stopuniqueMPgraphic \define[2]\polyreg {\setupMPvariables[polygoneregulier][unite,sides] \uniqueMPgraphic{polygoneregulier}{sides=#1,unite=#2}} You can define the command as \define[2]\polyreg {\setupMPvariables[polygoneregular][sides=#1,unite=#2]% \uniqueMPgraphic

Re: [NTG-context] [***SPAM***] Background color with dotted frame formula

2013-04-11 Thread Hans Hagen
OverlayLineColor ; \stopuniqueMPgraphic \defineoverlay[LabelA][\uniqueMPgraphic{LabelA}] \defineoverlay[LabelB][\uniqueMPgraphic{LabelB}] \def\VariantA{\mframed[foregroundstyle=\tfc,frame=off,background=LabelA,backgroundoffset=3pt,backgroundcolor=red]} \def\VariantB{\mframed[foregroundstyle=\tfc,frame

Re: [NTG-context] Visualcounter: style parameter not working as expected

2013-04-02 Thread Hans Hagen
fullcircle scaled 1cm ; \stopuniqueMPgraphic \def\xxx{xx} \useMPgraphic{x1} \uniqueMPgraphic{x1} \stoptext this is seldom an issue, but for convenience I patched the definers and resolvers so that the first argument gets expanded (next upload) Hans

[NTG-context] text overlayed

2013-03-04 Thread Roland Thiers
.8white; \stopuniqueMPgraphic \starttext \defineoverlay[encadrement][\uniqueMPgraphic{essai}] \framed[frame=off,background=encadrement]{\it\tfb\color[darkred]{Devoir de mathématiques}} \stoptext ___ If your question

Re: [NTG-context] text overlayed

2013-03-04 Thread Marco Patzer
'; pair B; B:=q intersectionpoint p'; pair C; C:=p intersectionpoint q; pair D; D:=q'intersectionpoint p; path s; s:= A--B--C--D--cycle; fill s withcolor .8white; \stopuniqueMPgraphic \defineoverlay [encadrement] [\uniqueMPgraphic{essai}] \defineframed [boxframed] [frame=off

Re: [NTG-context] recalculate background on every page with \uniqueMPgraphic?

2013-03-04 Thread Mikael P. Sundqvist
On Tue, Feb 26, 2013 at 10:01 PM, Marco Patzer home...@lavabit.com wrote: Hi Mikael, your original example works for me with a current beta if you replace uniqueMPgraphic with useMPgraphic. Marco ___ If your

Re: [NTG-context] text overlayed

2013-03-04 Thread Roland Thiers
'; pair A; A:=q'intersectionpoint p'; pair B; B:=q intersectionpoint p'; pair C; C:=p intersectionpoint q; pair D; D:=q'intersectionpoint p; path s; s:= A--B--C--D--cycle; fill s withcolor .8white; \stopuniqueMPgraphic \defineoverlay [encadrement] [\uniqueMPgraphic{essai}] \defineframed

Re: [NTG-context] recalculate background on every page with \uniqueMPgraphic?

2013-02-26 Thread Mikael P. Sundqvist
On Mon, Feb 18, 2013 at 10:53 AM, Marco Patzer home...@lavabit.com wrote: On 2013–02–18 Mikael P. Sundqvist wrote: Thank you Marco for giving a better example. I thought that uniqueMPgraphic meant it was redrawn everytime while useMPgraphic meant it was done once and then gave the same

Re: [NTG-context] recalculate background on every page with \uniqueMPgraphic?

2013-02-26 Thread Hans Hagen
On 2/26/2013 4:46 PM, Mikael P. Sundqvist wrote: On Mon, Feb 18, 2013 at 10:53 AM, Marco Patzer home...@lavabit.com wrote: On 2013–02–18 Mikael P. Sundqvist wrote: Thank you Marco for giving a better example. I thought that uniqueMPgraphic meant it was redrawn everytime while useMPgraphic

Re: [NTG-context] recalculate background on every page with \uniqueMPgraphic?

2013-02-26 Thread Marco Patzer
On 2013–02–26 Hans Hagen wrote: Hans, is this a bug? Has something changed? I don't know .. no example I provided an example in http://www.ntg.nl/pipermail/ntg-context/2013/071552.html However, it seems to be fixed in a recent beta. At least it works for me. Marco signature.asc

Re: [NTG-context] recalculate background on every page with \uniqueMPgraphic?

2013-02-26 Thread Marco Patzer
Hi Mikael, your original example works for me with a current beta if you replace uniqueMPgraphic with useMPgraphic. Marco signature.asc Description: Digital signature ___ If your question is of interest to others

Re: [NTG-context] recalculate background on every page with \uniqueMPgraphic?

2013-02-18 Thread Mikael P. Sundqvist
/projects/contextrev/ wiki : http://contextgarden.net ___ Thank you Marco for giving a better example. I thought that uniqueMPgraphic meant it was redrawn everytime while useMPgraphic meant it was done once and then gave

Re: [NTG-context] recalculate background on every page with \uniqueMPgraphic?

2013-02-18 Thread Marco Patzer
On 2013–02–18 Mikael P. Sundqvist wrote: Thank you Marco for giving a better example. I thought that uniqueMPgraphic meant it was redrawn everytime while useMPgraphic meant it was done once and then gave the same result everytime used. http://thread.gmane.org/gmane.comp.tex.context/79507

  1   2   3   >