This is the version I ended up with, seems to do exactly what I had in mind:
\startuniqueMPgraphic{mpshadow}
% BodyFontSize should be the current font size of/in the frame
mw := BodyFontSize/3;
ox := 3 ; % offset x
oy := 2 ; % offset y
bx := 1.7mw ; % bleed x (height of the shadow)
by := 3mw
So far I have been able to get this setup which does what I was
looking for. I just dont seem to get the "Intermezzo 1" text removed:
\useMPlibrary[dum]
\startuniqueMPgraphic{mpshadow}
% BodyFontSize should be the current font size of/in the frame
mw := BodyFontSize/3;
ox := +3.5 ; % o
alan.caruanam...@gmail.com:
I modified it, but it only affects the first page.
The mark appears on the edge of the page; I just want a line in the
middle.
\setuppapersize[A5][A4,landscape]
\setuparranging[2*2]
\setuplayout[middle]
\startuniqueMPgraphic{MPfoldmark}
pickup pensquare scaled 0.5pt
Am 08.04.25 um 12:18 schrieb alan.caruanam...@gmail.com:
I modified it, but it only affects the first page.
The mark appears on the edge of the page; I just want a line in the middle.
\setuppapersize[A5][A4,landscape]
\setuparranging[2*2]
\setuplayout[middle]
\startuniqueMPgraphic{MPfoldmark
I modified it, but it only affects the first page.
The mark appears on the edge of the page; I just want a line in the middle.
\setuppapersize[A5][A4,landscape]
\setuparranging[2*2]
\setuplayout[middle]
\startuniqueMPgraphic{MPfoldmark}
pickup pensquare scaled 0.5pt ;
drawoptions(dashed evenly
]
\starttext
\dorecurse{100}{\input knuth \relax}
\stoptext
I would use a layer and some MetaPost code, like this:
\startuniqueMPgraphic{MPfoldmark}
pickup pensquare scaled 0.5pt ;
drawoptions(dashed evenly withcolor "registration") ;
xd := OverlayWidth/2;
draw (xd,0)--(xd,\pagecutmarklen
kael
>
> On Fri, Feb 7, 2025 at 10:34 AM Florent Michel
> wrote:
>
>> Hi,
>>
>> On a related note, the second example from
>> https://wiki.contextgarden.net/Command/startuniqueMPgraphic seems to
>> have a similar issue, although it seems to work fine after
Hi,
I think there will be a new release today or tomorrow that should fix this.
/Mikael
On Fri, Feb 7, 2025 at 10:34 AM Florent Michel
wrote:
> Hi,
>
> On a related note, the second example from
> https://wiki.contextgarden.net/Command/startuniqueMPgraphic seems to have
>
Hi,
On a related note, the second example from
https://wiki.contextgarden.net/Command/startuniqueMPgraphic seems to have a
similar issue, although it seems to work fine after replacing
xyscaled (\overlaywidth, \overlayheight)
with
xyscaled (OverlayWidth, OverlayHeight)
Best regards
wn within a subsection with an overlay. The
logic to create the underlined subsection is by the way copied from the metafun
manual source. I do not have the slightest clue what is going wrong in this
example. Thanks for ideas.
Best, Bernd
\usemodule[chart]
\startuniqueMPgraphic{SectionUnderline
overlay.
> The logic to create the underlined subsection is by the way copied from the
> metafun manual source. I do not have the slightest clue what is going wrong
> in this example. Thanks for ideas.
>
> Best, Bernd
>
> \usemodule[chart]
>
> \startuniqueMPgraphic{SectionU
eate the underlined subsection is by the way copied from the metafun manual source. I do not have the slightest clue what is going wrong in this example. Thanks for ideas.Best, Bernd\usemodule[chart]\startuniqueMPgraphic{SectionUnderline} path p;p:= unitsquare xscaled OverlayWidth yscaled Overla
manual source. I do not have the slightest clue what is going wrong in this example. Thanks for ideas.Best, Bernd\usemodule[chart]\startuniqueMPgraphic{SectionUnderline} path p;p:= unitsquare xscaled OverlayWidth yscaled OverlayHeight; draw llcorner p -- lrcorner p; setbounds
going wrong
in this example. Thanks for ideas.
Best, Bernd
\usemodule[chart]
\startuniqueMPgraphic{SectionUnderline}
path p;
p:= unitsquare xscaled OverlayWidth yscaled OverlayHeight;
draw llcorner p -- lrcorner p;
setbounds currentpicture to p;
\stopuniqueMPgraphic
\defineoverlay
regards
Willi
\startuniqueMPgraphic{Test}
draw fullcircle scaled 3cm;
write "Hello World!" to "data.txt";
write EOF to "data.txt";
\stopuniqueMPgraphic
\starttext
\useMPgraphic{Test}
Import data from \quotation{data.txt}:
\bla
chapter titles:
\startuniqueMPgraphic{titled}
path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
pickup pencircle scaled 1mm ;
drawoptions(withcolor .625yellow) ;
draw llcorner p -- lrcorner p ;
setbounds currentpicture to p ;
\stopuniqueMPgraphic
\defineoverlay
r ip[];
w = OverlayWidth;
h = OverlayHeight;
p[1] := fullcircle scaled h;
p[2] := p[1] shifted (0.2 w,0);
ip[1] := p[1] intersectionpoint p[2];
ip[2] := reverse p[1] intersectionpoint p[2];
p[3] := p[1] cutbefore ip[1] cutafter ip[2];
p[4] := p[2] cutbefore ip[1] cutafter
Kip Warner schrieb am 27.05.2024 um 19:23:
On Mon, 2024-05-27 at 05:43 -0400, seyal zavira wrote:
if you don't want to use metapost you can also use svg for background
for example:
\startuniqueMPgraphic{centered_svg}
draw lmt_svg [
filename = "badge.svg",
width
On Mon, 2024-05-27 at 05:43 -0400, seyal zavira wrote:
> if you don't want to use metapost you can also use svg for background
> for example:
>
> \startuniqueMPgraphic{centered_svg}
> draw lmt_svg [
> filename = "badge.svg",
> width = OverlayW
if you don't want to use metapost you can also use svg for background
for example:
\startuniqueMPgraphic{centered_svg}
draw lmt_svg [
filename = "badge.svg",
width = OverlayWidth,
y = OverlayHeight/2, ] ;
\stopuniqueMPgraphic
\defineoverlay
[svgback]
Hi Alexander,
Thank you for this suggestion which will do the trick.
Fabrice
Le mar. 22 août 2023 à 10:26, Alexandre Christe a
écrit :
> Hi Fabrice,
>
> I have this from former exchanges
>
> % Cancel command for use in equations.
> \startuniqueMPgraphic{cross out}
> pi
Hi Fabrice,
I have this from former exchanges
% Cancel command for use in equations.
\startuniqueMPgraphic{cross out}
picture cross;
cross := image(draw (0,0)--(1,1); draw (0,1)--(1,0););
draw cross xscaled \overlaywidth yscaled \overlayheight withpen pencircle
scaled .8pt
{\color[darkred]{#1}}}
>
> \setuppagenumbering[location=]
> \setupheadertexts[margin][][\hbox to \hsize{\hss\Circled\pagenumber\hss}]
>
> \startuniqueMPgraphic{titled}
> path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
> pickup pencircle sca
led%
{\framed
[background=circled,frame=off,offset=overlay]
{\color[darkred]{#1}}}
\setuppagenumbering[location=]
\setupheadertexts[margin][][\hbox to \hsize{\hss\Circled\pagenumber\hss}]
\startuniqueMPgraphic{titled}
path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayhei
use the MetaFun features of ConTeXt to cross out stuff.
% Cancel command for use in equations.
\startuniqueMPgraphic{cross out}
picture cross;
cross := image(draw (0,0)--(1,1); draw (0,1)--(1,0););
draw cross xscaled \overlaywidth yscaled \overlayheight withpen pencircle
scaled .8pt
Hi Uschi,
I use the MetaFun features of ConTeXt to cross out stuff.
% Cancel command for use in equations.
\startuniqueMPgraphic{cross out}
picture cross;
cross := image(draw (0,0)--(1,1); draw (0,1)--(1,0););
draw cross xscaled \overlaywidth yscaled \overlayheight withpen pencircle
{Cutpointstight}]
\startuniqueMPgraphic{Cutpointstight}
path p;
p := unitsquare xscaled OverlayWidth yscaled OverlayHeight;
draw ulcorner p;
draw urcorner p;
draw llcorner p;
draw lrcorner p
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
idths) .. and
> some still use acrobat 4 -)
Yep, last weekend I finally sent the latest issue of our magazine to the
printshop, of course with correctly set boxes (and markings activated), and
since the content didn’t need bleed this time, I set the CropBox to TrimBox.
Everything in per
Thanks Hans!
On Sun, 12 Sept 2021 at 19:02, Hans Hagen wrote:
> On 9/12/2021 6:54 PM, Sylvain Hubert via ntg-context wrote:
> > Dear List,
> >
> > The following code draws a circle at the center of the page, ignoring
> > the "shifted" part.
> >
On 9/12/2021 6:54 PM, Sylvain Hubert via ntg-context wrote:
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
\defineoverl
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
context.stopxcell()
end
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{depth}
onvertnumber(conversion,i)
> context.stopxcell()
> end
> context.stopxrow()
> for i=1,n do
> context.startxrow()
> context.startxcell()
> context.convertnumber(con
opxcell()
for j=1,n do
context.startxcell { align = "middle" }
action(string.sub(pattern[i],j,j))
context.stopxcell()
end
context.stopxrow()
end
context.stop
a background to a framed text. —
>>> I can not make it working though…
>>>
>>> \startuniqueMPgraphic{Markings}
>>> %{Markings:\overlaywidth:\overlayheight} fill OverlayBox enlarged
>>> 5mm withcolor blue; \stopuniqueMPgraphic
>>>
>>&
On Tue, 16 Jun 2020 14:37:17 +0200
Marco Patzer wrote:
> On Tue, 16 Jun 2020 14:17:09 +0200
> Willi Egger wrote:
>
> > I try to use a Metapost drawing as a background to a framed text. —
> > I can not make it working though…
> >
> > \startuniqueMPgraphic{Marki
On Tue, 16 Jun 2020 14:17:09 +0200
Willi Egger wrote:
> I try to use a Metapost drawing as a background to a framed text. — I
> can not make it working though…
>
> \startuniqueMPgraphic{Markings}
> %{Markings:\overlaywidth:\overlayheight} fill OverlayBox enlarged 5mm
&
Hello listmembers,
I try to use a Metapost drawing as a background to a framed text. — I can not
make it working though…
\startuniqueMPgraphic{Markings} %{Markings:\overlaywidth:\overlayheight}
fill OverlayBox enlarged 5mm withcolor blue;
\stopuniqueMPgraphic
\defineoverlay[Marks
t customized square root signed
which was asked on TeX.SE a few years ago:
https://tex.stackexchange.com/a/406680/323
I tried the code from the link above, but:
- I had change some macro names: \mpvar -> \MPvar, \startuniquempgraphic
-> \startuniqueMPgraphic and some others,
- there
which was asked on TeX.SE a few years ago:
https://tex.stackexchange.com/a/406680/323
I tried the code from the link above, but:
- I had change some macro names: \mpvar -> \MPvar, \startuniquempgraphic
-> \startuniqueMPgraphic and some others,
- there is still an error I'm not able to fix (see att
backgrounds you can use a overlay and don't have
to create a layer for it.
2. Use unitsquare for your bars which has the origin in the lower left
corner because fullsquare has the origin in the center (look at page
383 in the metafun manual).
\setuppapersize [A4,landscape]
\startuniqueMPgr
n the metafun manual).
\setuppapersize [A4,landscape]
\startuniqueMPgraphic{blueShade}
draw lmt_shade [
path= fullsquare xyscaled (OverlayWidth,OverlayHeight) ,
direction = "up",
alternative = "linear",
colors = { "red", "blue"
eight=\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" },
];
\stopuniqueMPgraphi
Hi,
I would like to hatch the cell green.
Thank you.
Fabrice
\usecolors[xwi]
\startuniqueMPgraphic{meta:hash}{linewidth,linecolor,angle,gap}
if unknown context_back : input mp-back ; fi ;
some_hash ( OverlayWidth, OverlayHeight ,
\MPvar{linewidth}, \MPvar{linecolor} ,
\MPvar{angle}, \MPvar{gap
Hi Altoff.
Maybe this markup will help?
\startuniqueMPgraphic{cancel}
pickup pencircle scaled 0.7pt ;
path p ; p := OverlayBox topenlarged -ExHeight bottomenlarged -ExHeight ;
draw llcorner p -- urcorner p withcolor OverlayColor ;
\stopuniqueMPgraphic
\defineoverlay[cancel
Hi,
I’m trying to get a linear shade in the background of my presentation.
But it seems like MetaPost can’t handle my self-defined colors:
\definecolor[VerlaufVon][c=75,m=5,y=95,k=60]
\definecolor[VerlaufNach][c=88,m=95,y=5,k=60]
\startuniqueMPgraphic{Verlauf}
% old method, also doesn’t work
ight)
Hans
--- test file ---
\setupinteraction
[state=start]
\definesymbol[yes][1]
\definesymbol[nop][0]
\setupfield[whatever][width=20mm,height=20mm,frame=off]
\definefield[what][radio][whatever][whatone,whattwo][whatone]
\definesubfield[whatone][][yes,nop]
\definesubfield[whattwo][][yes,nop
>
>> \setuppagenumbering [
>> alternative=,
>> location=,
>> ]
>>
>> \setupfootertexts
>> [Laubblatt 2019/1] [{\externalfigure[cow][height=15mm]}]
>>
>> \setupfooter
>> [style=\ss]
>>
>> \setuptolerance
>> [verytolerant,str
\externalfigure[cow][height=15mm]}]
>
> \setupfooter
> [style=\ss]
>
> \setuptolerance
> [verytolerant,stretch]
>
> \definecolor[color-1][.5(red,green)]
> \definecolor[color-2][.5(green,blue)]
> \definecolor[color-3][.5(blue,red)]
> \definecolor[color-4][.5
rance
[verytolerant,stretch]
\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 OverlayBox withcolor \MPcolor{co
=
math_stacker_arrow_shape
enddef ;
vardef math_stacker_rightarrow_shape =
math_stacker_arrow_shape rotated 180
enddef ;
\stopMPextensions
\startuniqueMPgraphic{math:stacker:\number"2190}
math_stacker_draw(math_stacker_leftarrow_shape) ;
\stopuniqueMPgr
Hi,
I run into this error after updating my ConTeXt version.
Small (but not minimal) example attached.
mtx-context | current version: 2018.10.18 00:07
Peter
\startuniqueMPgraphic{column:bg}
fill OverlayBox withcolor yellow;
\stopuniqueMPgraphic
\defineoverlay[columnbg
at follows 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 ne
?
The Metafun experts would probably tear this apart...
\startuniqueMPgraphic{half circle}
path p, q ;
p := fullcircle scaled OverlayWidth;
q := (p cutafter (point .5 along p)) shifted (0,-.5BodyFontSize) ;
fill q -- cycle withcolor lightgray ;
draw q withpen pencircle scaled 2pt
Metafun experts would probably tear this apart...
\startuniqueMPgraphic{half circle}
path p, q ;
p := fullcircle scaled OverlayWidth;
q := (p cutafter (point .5 along p)) shifted (0,-.5BodyFontSize) ;
fill q -- cycle withcolor lightgray ;
draw q withpen pencircle scaled 2pt withcolor
to draw the arrows of the vectors does not seem to
>> work anymore.
>> Thank you
>> Fabrice
>>
>
> Did you check ou tthe latest meta-imp file? Alan and I added more and also
> changed the interface a little which might have consequences.
>
> \useMPlibrary[mat]
>&
) ;
)
enddef ;
vardef math_stacker_leftarrow_shape =
math_stacker_arrow_shape
enddef ;
vardef math_stacker_rightarrow_shape =
math_stacker_arrow_shape rotated 180
enddef ;
\stopMPextensions
\startuniqueMPgraphic{math:stacker:\number"2190}
math_stacker
=
math_stacker_arrow_shape
enddef ;
vardef math_stacker_rightarrow_shape =
math_stacker_arrow_shape rotated 180
enddef ;
\stopMPextensions
\startuniqueMPgraphic{math:stacker:\number"2190}
math_stacker_draw(math_stacker_leftarrow_shape) ;
\stopuniqueMPgr
r/
> tree/beta/doc/context/sources/general/fonts
>
> > I did this :
> >
> > \startuniqueMPgraphic{titled}
> > path p ;
> > p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
> > pickup pencircle scaled 1mm ;
> > linecap := squared
imals. It can be found
in
tex/texmf-context/doc/context/sources/general/fonts/
or online on GitHub
https://github.com/contextgarden/context-mirror/tree/beta/doc/context/sources/general/fonts
> I did this :
>
> \startuniqueMPgraphic{titled}
> path p ;
> p := unitsqua
imals. It can be found
in
tex/texmf-context/doc/context/sources/general/fonts/
or online on GitHub
https://github.com/contextgarden/context-mirror/tree/beta/doc/context/sources/general/fonts
> I did this :
>
> \startuniqueMPgraphic{titled}
> path p ;
> p := unitsqua
Hi Hans,
I love the style used for this manual. I tried to do the same thing, but
it's a long way off !
I tried to find the source code to inspire me :-)
I did this :
\startuniqueMPgraphic{titled}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
pickup penc
ottomenlarged (OverlayOffset/2) topenlarged (OverlayOffset/2) ;
>> )
>> enddef ;
>> vardef math_stacker_leftarrow_shape =
>> math_stacker_arrow_shape
>> enddef ;
>> vardef math_stacker_rightarrow_shape =
>> mat
enddef ;
\stopMPextensions
\startuniqueMPgraphic{math:stacker:\number"2190}
math_stacker_draw(math_stacker_leftarrow_shape) ;
\stopuniqueMPgraphic
\startuniqueMPgraphic{math:stacker:\number"2192}
math_stacker_draw(math_stacker_rightarrow_shape) ;
\stopuniqueMPgraphic
) ;
)
enddef ;
vardef math_stacker_leftarrow_shape =
math_stacker_arrow_shape
enddef ;
vardef math_stacker_rightarrow_shape =
math_stacker_arrow_shape rotated 180
enddef ;
\stopMPextensions
\startuniqueMPgraphic{math:stacker:\number"2190}
math_stacker
yond the edges of the
>> cell.
>> Thank you
>> Fabrice
>>
>> \startuniqueMPgraphic{Vertical}
>>
>> linecap:=squared ;
>> path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
>> drawoptions (withpen pencircle withcolor \MPco
linecap:=butt ;
Am 14. Februar 2017 16:53:04 MEZ schrieb Fabrice Couvreur
:
>Hello,
>In the code below, the red vertical line extends beyond the edges of
>the
>cell.
>Thank you
>Fabrice
>
>\startuniqueMPgraphic{Vertical}
>
> linecap:=squared ;
> path p ; p :=
Hello,
In the code below, the red vertical line extends beyond the edges of the
cell.
Thank you
Fabrice
\startuniqueMPgraphic{Vertical}
linecap:=squared ;
path p ; p := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
drawoptions (withpen pencircle withcolor \MPcolor{red}) ;
draw .5
r command as in the exmaple below.
> Best regards: Otared K.
>
> %% begin
> \startuniqueMPgraphic{MyShape}
> path p ;
> p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
> pickup pencircle scaled \overlaylinewidth ;
> fill p withcolor \MPcolor{\overlay
Hi Fabrice,
In order to have the box aligned with the text, it is enough to use the \lower
command as in the exmaple below.
Best regards: Otared K.
%% begin
\startuniqueMPgraphic{MyShape}
path p ;
p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
pickup
Hi Fabrice,
Below you have an example which may help you to achieve what you want, but in
the example I am sending there is an issue with the alignment of the title.
I could not solve the issue, sorry…
Best regards: Otared K.
%% begin example boxed-title.tex
\startuniqueMPgraphic{MyShape
arrow_shape =
> image (
> drawarrow
> (OverlayWidth,OverlayOffset) -- (0,OverlayOffset)
> withcolor
> OverlayLineColor ;
> setbounds currentpicture to boundingbox currentpicture
> b
) ;
)
enddef ;
vardef math_stacker_leftarrow_shape =
math_stacker_arrow_shape
enddef ;
vardef math_stacker_rightarrow_shape =
math_stacker_arrow_shape rotated 180
enddef ;
\stopMPextensions
\startuniqueMPgraphic{math:stacker:\number"2190}
math_stacker
ed options but you can do a lot when you use Metapost to
draw the background.
\startuniqueMPgraphic{TextBackground}
path p ; p := unitsquare xscaled OverlayWidth yscaled OverlayHeight ;
draw p topenlarged 5mm ;
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic
\define
Hi,
Strange behavior: why is the colored text ?
Thanks,
Fabrice
\usemodule[tikz]
\startuniqueMPgraphic{titled}
path p ;
p := unitsquare xscaled OverlayWidth yscaled OverlayHeight ;
pickup pencircle scaled 1mm ;
drawoptions(withcolor .625yellow) ;
draw llcorner p--lrcorner p ;
setbounds
>> understand the definition and operation, which is not always easy with
>> TeX commands.
>> Also, in the following code, this does not give the expected result.
>> Thank you.
>> Fabrice
>>
>> \showframe
>>
>> \setupcolors
>>[state=start
\showframe
\setupcolors
[state=start]
\setuppagenumbering[location=,alternative]
\startuniqueMPgraphic{titled}
path p ;
p := unitsquare xscaled OverlayWidth yscaled OverlayHeight ;
pickup pencircle scaled 1mm ;
drawoptions(withcolor .625yellow) ;
draw llcorner p--lrcorner p ;
setbounds
]
\setuppagenumbering[location=,alternative]
\startuniqueMPgraphic{titled}
path p ;
p := unitsquare xscaled OverlayWidth yscaled OverlayHeight ;
pickup pencircle scaled 1mm ;
drawoptions(withcolor .625yellow) ;
draw llcorner p--lrcorner p ;
setbounds currentpicture to p ;
\stopuniqueMPgraphic
Hello,
Is it possible to calculate the position of something in Metapost, and
to export that value to TeX such that I can use it in setups and
things?
I thought perhaps I could \def inside btex..etex. Here's a minimal
example trying to illustrate the idea:
\startuniqueMPgraphic{canon}
\def\Bolha[#1]#2#3#4%
{\setupMPvariables[bolha][#1]%
\setMPtext{labelcima}{#3}%
\setMPtext{labelesquerda}{#2}%
\setMPtext{labeldireita}{#4}%
\useMPgraphic{bolha}}
\startuniqueMPgraphic{bolha}
path p, q, cima, esquerda, direita, vertical; pair A, B, C;
p:=fullcircle scaled \MPvar{size};
A
=lightgray]
\definecolor[Border][c=0.00, m=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
=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
foregroundstyle={\switchtobodyfont[10pt]},
align={high,flushleft},
frame=off,
framecolor=0.625white,
background=borderline,
]
\definefiller[dots][left=\dontleavehmode,right=\hskip\zeropoint\par]
\starttext
\startuniqueMPgraphic{borderline}
path p ; p := unitsquare xscaled \ov
,right}
offset=1ex,
frame=off,
]
\setupTABLE[column][first][width=0.25\textwidth]
\setupTABLE[column][2][width=0.35\textwidth]
\stopsetups
\starttext
\startuniqueMPgraphic{borderline}
path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight
]
\setuphead
[subsection]
[sectionstopper={},
sectionsegments=subsection:subsection,
conversion=number,]
\setupcolors[state=start,cmyk=yes,mpcmyk=yes]
\definecolor[mycolor][c=0.45,m=0.00,y=0.1,k=0.00]
\definecolor[colortext][c=1,m=0.00,y=0.3,k=0.3]
\starttext
\startuniqueMPgraphic
]
\starttext
\startuniqueMPgraphic{funny}
path p ;
numeric h ;
h := OverlayHeight ;
p:=unitsquare xscaled \overlaywidth yscaled \overlayheight superellipsed
0.9 ;
pickup pencircle scaled \overlaylinewidth ;
fill p withcolor \MPcolor{\overlaycolor} ;
draw (20,1)--(20,h-1) withcolor red ;
draw p withcolor
Dear Fabrice,
A try and error method which you may not want:
% macros=mkvi
\setuppapersize[A4][A4]
\setupcolors[state=start,cmyk=yes,mpcmyk=yes]
\definecolor[mycolor][c=0.45,m=0.00,y=0.1,k=0.00]
\definecolor[colortext][c=1,m=0.00,y=0.3,k=0.3]
\starttext
\startuniqueMPgraphic{funny}
path p
[mycolor][c=0.45,m=0.00,y=0.1,k=0.00]
\definecolor[colortext][c=1,m=0.00,y=0.3,k=0.3]
\starttext
\startuniqueMPgraphic{funny}
path p ;
numeric h ;
h := OverlayHeight ;
p:=unitsquare xscaled \overlaywidth yscaled \overlayheight superellipsed
0.9 ;
pickup pencircle scaled \overlaylinewidth ;
fill p
quare scaled 1cm xshifted i*cm;
> endfor;
> \stopMPcode
> \stoptext
>
> How can a line be drawn connecting the right edges of the rectangles? I have
> played with:
>
> \startuniqueMPgraphic{line}
> path a;
> a:=(0,0)--(0,3cm);
> draw a withpen pencircle
;> \startMPcode
>> for i=0 upto 1:
>> draw unitsquare scaled 1cm xshifted i*cm;
>> endfor;
>> \stopMPcode
>> \stoptext
>>
>>
>> How can a line be drawn connecting the right edges of the rectangles? I
>> have pla
upto 1:
> draw unitsquare scaled 1cm xshifted i*cm;
> endfor;
> \stopMPcode
> \stoptext
>
>
> How can a line be drawn connecting the right edges of the rectangles? I
> have played with:
>
> \startuniqueMPgraphic{line}
> path a;
>
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
>>>
>>> I tested your example file: it works fine here with
>>> ConTeXt ver: 2014.09.25 18:58 MKIV beta fmt: 2014.9.25 int:
>>> english/english
>>> Which version are using?
>>>
>>> Best regards: OK
>>>
>>> On 26
;>
>>> Hello!
>>>
>>> Today I wanted to use an older tex file…. I get the same error as in the
>>> following test.
>>>
>>> \startuniqueMPgraphic{test}
>>>
>>> path p;
>>> p := fullcircle scaled 5cm
. I get the same error as in the
>> following test.
>>
>> \startuniqueMPgraphic{test}
>>
>> path p;
>> p := fullcircle scaled 5cm;
>> draw p;
>> label.bot(textext("Centre"), center p);
>>
tex file…. I get the same error as in the
> following test.
>
> \startuniqueMPgraphic{test}
>
> path p;
> p := fullcircle scaled 5cm;
> draw p;
> label.bot(textext("Centre"), center p);
>
> \stopuniqueMPgraphic
>
Hello!
Today I wanted to use an older tex file…. I get the same error as in the
following test.
\startuniqueMPgraphic{test}
path p;
p := fullcircle scaled 5cm;
draw p;
label.bot(textext("Centre"), center p);
\stopuniqueMPgraphic
ied a metafun approach
\startuniqueMPgraphic{math:mydot}
fill unitcircle scaled 2 shifted
(OverlayWidth/2-1,OverlayHeight+OverlayOffset);
path q;
q:= unitsquare xscaled OverlayWidth yscaled (OverlayHeight+OverlayOffset+1);
setbounds currentpicture to q;
\stopuniqueMPgr
extends into the
> margins ... it depends a bit on what 'line' means here
>
> \startuniqueMPgraphic{whatever}
> fill OverlayBox
> leftenlarged BackSpace
> rightenlarged CutSpace
> withcolor OverlayColor ;
>
1 - 100 of 308 matches
Mail list logo