bar,
> width=broad,
> frame=off,
> framecolor=darkred,
> rulethickness=.5pt,
> leftoffset=2ex,
> %rightoffset=2.25ex,
> %topoffset=2.25ex,
> %bottomoffset=2.25ex,
> background=color,
> backgroundcolor=white,
> ]
>
> \s
,
mp=mpos:region:leftbar,
width=broad,
frame=off,
framecolor=darkred,
rulethickness=.5pt,
leftoffset=2ex,
%rightoffset=2.25ex,
%topoffset=2.25ex,
%bottomoffset=2.25ex,
background=color,
backgroundcolor=white,
]
\startuseMPgraphic{mpos:region:leftbar
}]
\stopsetups
\setvariable{headertext}{set}{\directsetup{headertext}}
\startuseMPgraphic{framewithshadow}
path p;
p:=origin--(OverlayWidth,0)--(OverlayWidth,OverlayHeight)--(0,OverlayHeight)--cycle;
fill p shifted (2,-2);
fill p withcolor 0.8white;
draw p;
setbounds currentpicture to p;
\stopuseMPgraphic
{headertext}{set}{\directsetup{headertext}}
\startuseMPgraphic{framewithshadow}
path p;
p:=origin--(OverlayWidth,0)--(OverlayWidth,OverlayHeight)--(0,OverlayHeight)--cycle;
fill p shifted (2,-2);
fill p withcolor 0.8white;
draw p;
setbounds currentpicture to p;
\stopuseMPgraphic
\defineoverlay
}]
\stopsetups
\setvariable{headertext}{set}{\directsetup{headertext}}
\startuseMPgraphic{framewithshadow}
path p;
p:=origin--(OverlayWidth,0)--(OverlayWidth,OverlayHeight)--(0,OverlayHeight)--cycle;
fill p shifted (2,-2);
fill p withcolor 0.8white;
draw p;
setbounds currentpicture to p
//www.pragma-ade.nl / http://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
>
> ___
>
Hi,
maybe something like this co
like drawpath p ;
> > drawcontrollines p ; drawpoints p ; drawcontrolpoints p ...
> > How to use them in a document ?
> > Where to find source codes ?
> > For example, the following code does not work :
> >
> > \starttext
> > \startuseMPgraphic{path}
> &g
\startuseMPgraphic{path}
path p ; p := (1cm,1cm)--(1.5cm,1.5cm)..(2cm,0cm)..cycle ;
\stopuseMPgraphic
\startMPcode
p := p .. cycle ; swappointlabels := true ;
drawpath p ;
\stopMPcode
\stoptext
\starttext
\startMPcode
path p ; p := (1cm,1cm)--(1.5cm,1.5cm)..(2cm,0cm)..cycle
Hello,
In the Metafun manual, Hans uses macros like drawpath p ; drawcontrollines
p ; drawpoints p ; drawcontrolpoints p ...
How to use them in a document ?
Where to find source codes ?
For example, the following code does not work :
\starttext
\startuseMPgraphic{path}
path p ; p := (1cm,1cm
prevChapterTitle, currentChapterTitle;
prevChapterTitle := "";
currentChapterTitle := "";
\stopMPinclusions
\startuseMPgraphic{page:background}
StartPage;
currentChapterTitle := "\namedstructurevariable{chapter}{title}";
if currentCh
apterTitle := "";
\stopMPinclusions
\startuseMPgraphic{page:background}
StartPage;
currentChapterTitle := "\namedstructurevariable{chapter}{title}";
if currentChapterTitle <> prevChapterTitle :
fill (topboundary Page -- cycle)
enlar
ound:
>
> \showframe
> \showboxes
> \defineframedtext[leftbartext][
>width=broad,
>frame=off,
> rulethickness=.5ex,
>background=mp:offsetframe,
>offset=overlay,
> ]
>
> \defineoverlay[mp:offsetframe][\useMPgraphic{mp:offsetframe}]
>
offsetframe,
> offset=overlay,
> ]
>
> \defineoverlay[mp:offsetframe][\useMPgraphic{mp:offsetframe}]
>
\startuseMPgraphic{mp:offsetframe}
linecap:=butt;
draw leftboundary OverlayBox
xshifted -(LeftMarginDistance + 0.5OverlayLineWidth)
withpen pe
,
rulethickness=.5ex,
background=mp:offsetframe,
offset=overlay,
]
\defineoverlay[mp:offsetframe][\useMPgraphic{mp:offsetframe}]
\startuseMPgraphic{mp:offsetframe}
draw leftboundary OverlayBox
xshifted -(LeftMarginDistance + 0.5OverlayLineWidth)
withpen pencircle scaled
Eventually, these two options worked. Firstly changing \setupbackgrounds
% BEGIN MP LOGO SETUP
\startuseMPgraphic{mpglogo}
path p;
p := (0,0)--(100,0)--(100,100)--(0,100)--cycle;
path q;
q := p cornered 30pt;
draw q withcolor black withpen pencircle scaled 7pt;
\stopuseMPgraphic
=dinb]
\startuseMPgraphic{mpglogo}
path p;
p := (0,0)--(100,0)--(100,100)--(0,100)--cycle ;
path q;
q := p cornered 30pt;
draw q withcolor black withpen pencircle scaled 7pt ;
\stopuseMPgraphic
\startsetups[letter:layer:lettermain]
\scale[width=25mm,height=25mm]{\useMPgraphic{mpglogo
I am trying to get a metapost drawing as logo added to right upper corner
of a DIN B style letterhead, but it does not show up, just the letter
itself. Is there anything to change to the layers for the MP toe reveal
itself?
Thanks, Jeroen
% BEGIN MP LOGO SETUP
\startuseMPgraphic{mpglogo}
path
[BigFontOne][NotoSansCJKkr-Bold sa 4]
\definecolor[BigColorOne][r=.86,g=.850,b=.54]
\startuseMPgraphic{outlineT}
draw outlinetext.b (\MPvar{tt})
(withcolor .75white)
(withcolor .725blue withpen pencircle scaled .75pt);%\MPvar{thick});
\stopuseMPgraphic
\define[1]\titleOutline{\useMPgraphic
]
\definecolor[BigColorOne][r=.86,g=.850,b=.54]
\startuseMPgraphic{outlineT}
draw outlinetext.b (\MPvar{tt})
(withcolor .75white)
(withcolor .725blue withpen pencircle scaled .75pt);%\MPvar{thick});
\stopuseMPgraphic
\define[1]\titleOutline{\useMPgraphic{outlineT}{tt="#1"}}
\setuphead[cha
code?
%%
\defineframed
[MyFramed]
[frame=off,
loffset=1ex,
roffset=1ex,
foregroundstyle=\ssbf]
\startuseMPgraphic{MyFrame}
picture p ; numeric o ; path a, b ; pair c ;
%p := textext.rt("\FunnyFramed{\enumerationparameter{text}
\convertedcounter[Theorem]
Jeong Dal schrieb am 08.02.19 um 17:18:
Dear all,
The following code which is borrowed from MetaFun manual is working nicely.
%%
\setupMPvariables[outlineT][tt="Hello"]
\startuseMPgraphic{outlineT}
draw outlinetext.b (\MPvar{tt})
(withcolor .5white)
(withcolor .625bl
Dear all,
The following code which is borrowed from MetaFun manual is working nicely.
%%
\setupMPvariables[outlineT][tt="Hello"]
\startuseMPgraphic{outlineT}
draw outlinetext.b (\MPvar{tt})
(withcolor .5white)
(withcolor .625blue withpen pencircle scaled .2pt)
s to a Metapost graphic.
>>
>> But only the first page has the defined background.
>>
>> I also tried with
>>
>> \startuseMPgraphic
>>
>> with no success
>>
>> --- mwe ---
>>
>> \startreusableMPgraphic{kreis}
>> draw fullcircle
Jan U. Hasecke schrieb am 08.02.19 um 12:36:
Hi all,
I make my first steps with Metapost.
I would like to set the background of all pages to a Metapost graphic.
But only the first page has the defined background.
I also tried with
\startuseMPgraphic
with no success
--- mwe
Hi all,
I make my first steps with Metapost.
I would like to set the background of all pages to a Metapost graphic.
But only the first page has the defined background.
I also tried with
\startuseMPgraphic
with no success
--- mwe ---
\startreusableMPgraphic{kreis}
draw fullcircle scaled
4 \startuseMPgraphic{tablebackground}{i,j}
5 if (\MPvar{i} = 1) or (\MPvar{j} = 1):
6 fill OverlayBox withcolor \MPcolor{fondpaille} ;
7 fi;
8 \stopuseMPgraphic
9
10 \defineoverlay
11 [tablebackground]
12
13 >>
[\useMPgraphic{tablebackground}{i=\current
uate the conditional purely in MetaPost. I don't
know if that would be faster, but it's a bit more readable to me.
\startuseMPgraphic{tablebackground}{i,j}
if (\MPvar{i} = 1) or (\MPvar{j} = 1):
fill OverlayBox withcolor \MPcolor{fondpaille} ;
fi;
\stopuseMPgraphic
\defineoverlay
[table
On 1/27/19 12:08 PM, Fabrice Couvreur wrote:
> Hi,
> How to color the first column as I did for the first line ?
Stolen from Wolfgang's answer on TeX.SX.
https://tex.stackexchange.com/a/464771
\definecolor[fondpaille][c=0,m=0,y=0.2,k=0]
\startuseMPgraphic {tablebackground}
fill Over
les on a page, several pages,
that seems error prone.
Any suggestions, corrections, hints are most welcome!
Kindly, Martin
Working example with some comments:
% Graphic that draws the "Z", that works fine in a single table cell as
seen in the example
\startuseMPgraphic{
Dear list,
>>>>
>>>> I have the following sample:
>>>>
>>>>\useMPlibrary[txt]
>>>>
>>>>\starttext
>>>>
>>>>\startuseMPgraphic{followtokens}
>>>> path RotPath ; RotPath := reverse halfcircle
)
\startuseMPgraphic{accolade}
z1 = (-233,0) ;
z2 = (-220,22) ;
z3 = (-155,211) ;
z4 = (-200,690) ;
z5 = (-142,1033) ;
z6 = (-97,1106) ;
z7 = (-71,1125) ;
z8 = (-61,1104) ;
z9 = (-80,1077) ;
z10 = (-108,1002) ;
z11 = (-129,666) ;
z12 = (-117,207) ;
z13 = (-197,19) ;
z14 = (-208,0) ;
z15 = (-197
mp.path(userdata.contour)
end
function mp.ContourX()
mp.pair(userdata.xlim)
end
function mp.ContourY()
mp.pair(userdata.ylim)
end
\stopluacode
\startuseMPgraphic{doublefun::ContourPlot}{width}
save xmin, xmax, ymin, ymax ;
(xmin, xmax) = lua.mp.ContourX() ;
1], ylim[2], (ylim[2] - ylim[1])/length do
if abs(f(x,y)) < eps*x then
n = n + 1
data[n] = {x, y}
end
end
end
end
function mp.ContourPath()
mp.path(data)
end
\stopluacode
\startuseMPgraphic{doublefun
multilocs[i], ulcorner multipars[i]) withcolor red ;
Cheers, Henri
---
\startuseMPgraphic{pageframe}
for i=1 upto nofmultipars :
draw (ulcorner multipars[i] -- urcorner multipars[i]) withcolor red ;
draw (llcorner multipars[i] -- lrcorner multipars[i]) withcolor red ;
label.lft
is that the frame containing the page break has a stray
blank line at the end.
Is this something that changed recently when switching to the one-pass
processing? I have attached the output of beta 2018.09.24 14:11 (which
I believe is the latest).
Cheers, Henri
---
\startuseMPgraphic{pageframe}
for i=1 upto
\defineoverlay
[pagedecoration]
[\useMPgraphic{pagedecoration}]
\setupbackgrounds
[page]
[background=pagedecoration,
backgroundcolor=lightblue]
\startuseMPgraphic{pagedecoration}
distanceSmall := 3mm;
distanceBig := distanceSmall;
bleed := 3mm;
if PageNumber==1:
path pageOne;
pageOn
, the file compiles.
use
textext("$\alpha$")
%%%
\starttext
\startuseMPgraphic{testfig}
u:=1cm;
z0=origin;
z1=(4u,3u);
z2=(4u,0);
draw z0--z1--z2--cycle;
draw anglebetween(z0--z2,z0--z1,btex $\alpha$ etex);
\stopuseMPgraphic
\startplacefigure
\useMPgraphic{testfig}
\stopplacefigure
Hi!
The document below compiled before, but not since upgrading to the new
version of standalone (current version: 2018.08.30 18:41). I'm running
linux if that matters.
The problem seem to be anglebetween, since if that line is commented out,
the file compiles.
%%%
\starttext
\startuseMPgraphic
\startsetups letter:head
>> \rightaligned{Seite \correspagenumber\ von \numberofcorrespages}
>> \stopsetups
>> % correspondence.pdf, p. 71
>> \startuseMPgraphic{dactylus}
>> draw unitsquare xyscaled (OverlayWidth-2cm,OverlayHeight-2cm)
>> smoothed 1cm withpen penc
\startuseMPgraphic{dactylus}
draw unitsquare xyscaled (OverlayWidth-2cm,OverlayHeight-2cm)
smoothed 1cm withpen pencircle scaled 2 ;
fill fullcircle scaled 1.5cm shifted (1cm,1cm)
withcolor \MPcolor{orange} ;
\stopuseMPgraphic
\setupletterstyle[background=\useMPgraphic{dactylus}]
\setupletteroptions
={Unterschrift},
fromname={Absender},
fromaddress={Straße\\Ort},
toname={An},
toaddress={Adresse}]
% correspondence.pdf, p. 73
\startsetups letter:head
\rightaligned{Seite \correspagenumber\ von \numberofcorrespages}
\stopsetups
% correspondence.pdf, p. 71
\startuseMPgraphic{dactylus}
draw unitsquare
t;, "22")
context.setMPtext("Pare3", "333")
\stopluacode
%
\startuseMPgraphic{Pare}
draw thelabel(btex \switchtobodyfont[20mm]\sans\bold TTT etex, (0, 150))
withcolor red
;
draw thelabel(btex \switchtobodyfont[20mm]\sans\bold U etex, (0, 100))
with
Hello,
I encountered a weird thing - words of 1 letter inside btex ... etex within MP
are not shown - check:
\setuplayout[page]
\startluacode
context.setMPtext("Pare", "1")
context.setMPtext("Pare2", "22")
context.setMPtext("Pare3"
Frame,
> width=\textwidth,
> location=right]
>
> \defineoverlay
>[MyFrame]
>[\useMPgraphic{MyFrame}]
>
> \definelabel
>[Définition]
>[headstyle=\bf\smallcaps]
>
>
> \startuseMPgraphic{MyFrame}
> picture p ;
> p := texte
phic{MyFrame}]
>
> \definelabel
>[Définition]
>[headstyle=\bf\smallcaps]
>
>
> \startuseMPgraphic{MyFrame}
> picture p ;
> p := textext.rt(\MPstring{MyFrame}) ;
> p := p shifted (0,OverlayHeight-ypart center p) ;
> fill OverlayBox lef
=\textwidth,
location=right]
\defineoverlay
[MyFrame]
[\useMPgraphic{MyFrame}]
\definelabel
[Définition]
[headstyle=\bf\smallcaps]
\startuseMPgraphic{MyFrame}
picture p ;
p := textext.rt(\MPstring{MyFrame}) ;
p := p shifted (0,OverlayHeight-ypart center p
; \setupbackgrounds [page] [background=color, backgroundcolor=lightgray]
>
> \starttext
>
> \startuseMPgraphic{test}
> graycolor white; white := 1 ;
> fill OverlayBox
> withshademethod "linear"
> withshadedirection shadedup
> withshadef
reference)
anyway, it helps to be in the same color space
\setupbackgrounds [page] [background=color, backgroundcolor=lightgray]
\starttext
\startuseMPgraphic{test}
graycolor white; white := 1 ;
fill OverlayBox
withshademethod "linear"
withsha
the external file works. Just wondering if
there's a better - more integrated - way.
Marco
\definecolor [transparent] [a=multiply, t=1, s=1]
\startuseMPgraphic{trans}
fill OverlayBox
withshademethod "linear" withshadevector (3, 0)
%% (white, "transparent"
le where I show how this can be done.
Wolfgang
begin meta-imp-mpframe.mkiv
\startuseMPgraphic{mp_frame_left}
draw leftboundary OverlayBox
withpen pensquare scaled \frameddimension{leftrulethickness}
withcolor \MPcolor{\framedparameter{leftframecolor}} ;
setbounds currentpictu
if I comment out either \startcolumnset or \placetable.
Is “\definecolumnset, \startcolumnset” still a good command? I couldn’t find it
in the list of commands.
Thank you for reading.
Best regards,
Dalyoung
%
\startuseMPgraphic{verticalrule}
if CurrentColumn < NOfColumns :
d
{~this way~}}
Many thanks for the reply, Hans.
I don’t know what I’m missing here, but I cannot get your code working.
Here you have the full sample:
\useMPlibrary[txt]
\starttext
\startuseMPgraphic{followtokens}
path p ; p := reverse halfcircle scaled 5cm ;
path q ; q
way~}
> \followtokens{\reversedtext{~this way~}}
Many thanks for the reply, Hans.
I don’t know what I’m missing here, but I cannot get your code working.
Here you have the full sample:
\useMPlibrary[txt]
\starttext
\startuseMPgraphic{followtokens}
path p ; p := reverse halfc
On 4/8/2018 12:11 AM, Pablo Rodriguez wrote:
On 04/07/2018 11:25 PM, Hans Hagen wrote:
On 4/7/2018 11:04 PM, Pablo Rodriguez wrote:
Dear list,
I have the following sample:
\useMPlibrary[txt]
\starttext
\startuseMPgraphic{followtokens}
path RotPath ; RotPath := reverse
On 04/07/2018 11:25 PM, Hans Hagen wrote:
> On 4/7/2018 11:04 PM, Pablo Rodriguez wrote:
>> Dear list,
>>
>> I have the following sample:
>>
>>\useMPlibrary[txt]
>>
>>\starttext
>>
>>\startuseMPgraphic{followtokens}
>>
On 4/7/2018 11:04 PM, Pablo Rodriguez wrote:
Dear list,
I have the following sample:
\useMPlibrary[txt]
\starttext
\startuseMPgraphic{followtokens}
path RotPath ; RotPath := reverse halfcircle ;
% path RotPath ; RotPath := halfcircle rotatedaround (origin, 180
Dear list,
I have the following sample:
\useMPlibrary[txt]
\starttext
\startuseMPgraphic{followtokens}
path RotPath ; RotPath := reverse halfcircle ;
% path RotPath ; RotPath := halfcircle rotatedaround (origin, 180) ;
\stopuseMPgraphic
\followtokens{Just follow the tokens
,
height=400pt]
\startuseMPgraphic{followtokens}
path RotPath, q , cp;
RotPath := halfcircle scaled 14cm rotated 180 ;
\stopuseMPgraphic
\followtokens{Voranbringen struktureller Politik-Veränderungen}
\startuseMPgraphic{followtokens}
path RotPath, q , cp;
RotPath := quartercircle scaled
gt; >And if I want to place different text between the (half-)circles?
>
> \startuseMPgraphic{followtokens-1}
> path RotPath ; RotPath := halfcircle scaled 7cm rotated 180 ;
> for i=1 upto 6 :
> draw halfcircle scaled (i*cm) rotated 180 ;
> endfor ;
>
On 4/2/2018 5:52 PM, Gerhard Kugler wrote:
Thank you very much!
And if I want to place different text between the (half-)circles?
\startuseMPgraphic{followtokens-1}
path RotPath ; RotPath := halfcircle scaled 7cm rotated 180 ;
for i=1 upto 6 :
draw halfcircle scaled (i*cm
Thank you very much!
And if I want to place different text between the (half-)circles?
Gerhard
On Mon, Apr 02, 2018 at 03:16:11PM +0200, Hans Hagen wrote:
> \useMPlibrary[txt]
>
> \starttext
>
> \startuseMPgraphic{followtokens}
> path RotPath ; RotPath := halfcircle
=48pt,
header=0cm,
footer=0cm,
height=400pt]
\startuseMPgraphic{followtokens}
path RotPath ;
RotPath := halfcircle scaled 7cm rotated 180 ;
\stopuseMPgraphic
\followtokens{Dies ist ein anderer Text}
\startuseMPgraphic{followtokens}
path RotPath ;
RotPath := halfcircle scaled 14cm
]
\startuseMPgraphic{followtokens}
path RotPath ;
RotPath := halfcircle scaled 7cm rotated 180 ;
\stopuseMPgraphic
\followtokens{Dies ist ein anderer Text}
\startuseMPgraphic{followtokens}
path RotPath ;
RotPath := halfcircle scaled 14cm rotated 180 ;
\stopuseMPgraphic
\followtokens
t; > >
> > In the manual is an example on page 233 with the following content:
> Nah! Don't use those macros. They are only for demonstration. Use the
> builtin
> \followtokens instead:
>
>
> \loadmarkfile{meta-imp-txt} % is this supposed to be loaded like that?
\loadmar
tin
\followtokens instead:
\loadmarkfile{meta-imp-txt} % is this supposed to be loaded like that?
\starttext
\startuseMPgraphic{followtokens}
path RotPath ; RotPath := reverse halfcircle ;
\stopuseMPgraphic
\followtokens{Text on a half circle}
\stoptext
>
> -
>
> \
in a more modern way.
%D
%D \startbuffer
%D \basegrid
%D [nx=8,ny=5,
%Ddx=.5,dy=.25,
%Dunit=cm,scale=2,factor=1,
%Doffset=1ex,xstep=2,ystep=1,
%Dalign=middle,style=\tt\tx]
%D \stopbuffer
%D
%D \typebuffer
%D
%D \placefigure
%D {An example of a grid.}
%D {\getbuffer}
\startuseM
]
%
\defineoverlay[CruxOrnament][\useMPgraphic{crux}]
\def\CruxFramed#1{\framed[frame=off,width=12cm,height=fit]{#1}}
\startuseMPgraphic{crux}
color ccc ;
pair p, h[], v[] ;
u := \overlaywidth ; v := \overlayheight ;
hdelta := .15u ; vdelta := .03v ;
drawoptions (withpen pensquare scaled 2
> Best regards: OK
\setupbodyfont[unfonts]
% the following is copied from makempy manual.
\startuseMPgraphic{text}
graphictext \MPstring{string} scaled 4
withdrawcolor \MPcolor{blue} withfillcolor \MPcolor{gray}
withpen pencircle scaled 2pt ;
\stopuseMPgraphic
\startuseMPgraphic{
ction
and a vertical line for current position)
The main problems are:
* How can I pass the first page of each section to MetaPost?
you need to get the logic ok yourself, something like:
\startuseMPgraphic{PageShape}
StartPage ;
numeric n ; n := \number\nofsubpages ;
or [PageColor] [black]
\definecolor [BackgroundColor] [s=.85]
\definecolor [OrnamentColor] [r=.75]
\definecolor [PositionColor] [s=.55]
\defineoverlay
[PageShape][\useMPgraphic{PageShape}]
\startuseMPgraphic{PageShape}
StartPage ;
path p ; pair pa, pb ; numeric len ; color contrastc
[MyFramed]
[frame=off,
loffset=1ex,
roffset=1ex,
foregroundstyle=\ssbf]
\startuseMPgraphic{MyFrame}
picture p ; numeric o ; path a, b ; pair c ;
% p := textext.rt("\MyFramed{\currentconstructiontext}") ;
p :=
textext.rt("\wrappedconstruction{\MyFramed{\currentc
=off,
loffset=1ex,
roffset=1ex,
foregroundstyle=\ssbf]
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
%p := textext.rt(“\FunnyFramed{\enumerationparameter{text}
\convertedcounter[Theorem]}”) ;
p := textext.rt("\FunnyF
=1ex,
roffset=1ex,
foregroundstyle=\ssbf]
\startuseMPgraphic{MyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt("\MyFramed{\currentconstructiontext}") ;
% p :=
textext.rt("\wrappedconstruction{\MyFramed{\currentconstructiontext}}") ;
of Theorems:
\defineframed
[FunnyFramed]
[frame=off,
loffset=1ex,
roffset=1ex,
foregroundstyle=\ssbf]
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt("\FunnyFramed{\enumerationparameter{text}
\convertedcounter[Th
[FunnyFramed]
[frame=off,
loffset=1ex,
roffset=1ex,
foregroundstyle=\ssbf]
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt("\FunnyFramed{\enumerationparameter{text}
\convertedcounter[Theorem]}") ;
o := BodyFontSize ;
a :=
>
> Dalyoung
>
> %% first method
> %1. use \enumerationparameter{text} and add “text=Theorem” in
> \defineenumeration.
> %%%
> \defineframed
> [FunnyFramed]
> [frame=off,
> loffset=1ex,
> roffset=1ex,
> foregroundstyle=\ssbf]
]
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt("\FunnyFramed{\enumerationparameter{text}
\convertedcounter[Theorem]}") ;
o := BodyFontSize ;
a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
p := p shifted (2o,OverlayHeight-ypar
ow to put the theorem counter after chapternumber instead of
\recurselevel.
Here is a sample code.
Thank you for reading.
Best regards,
Dalyoung
framed Text copied from MetaFun manual
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt(\MPstring{FunnyFra
.
\startuseMPgraphic{FunnyFrame}
picture p ; numeric o ; path a, b ; pair c ;
p := textext.rt(\MPstring{FunnyFrame}) ;
o := BodyFontSize ;
a := unitsquare xyscaled (OverlayWidth,OverlayHeight) ;
p := p shifted (2o,OverlayHeight-ypart center p) ;
drawoptions (withpen pencircle scaled 1pt withcolor
ramed text
\defineframedtext
[MyFrame]
[before={\blank[3*big]},
after={\blank[5*big]},
frame=off,
background=MyFrame,
%width=\textwidth,
width=max,
height=fit,
style={\setupbodyfont[9pt]}]
% Defining a label
\definelabel
[Definition]
nd=MyFrame,
%width=\textwidth,
width=max,
height=fit,
style={\setupbodyfont[9pt]}]
% Defining a label
\definelabel
[Definition]
[headstyle=\bf\smallcaps]
\startuseMPgraphic{MyFrame}
path b;
picture p;
%p := textext.rt("\white\Definition");
p := textext.rt("\
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\framedtextpara
]
\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 (2Bo
linecap := squared ;
> > drawoptions(withcolor \MPcolor{darkred}) ;
> > draw ulcorner p -- urcorner p ;
> > setbounds currentpicture to p ;
> > \stopuniqueMPgraphic
> >
> > \defineoverlay[titled][\uniqueMPgraphic{titled}]
> >
> > \startuseMPgrap
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
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
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
?
This happens with current version: 2017.06.27 18:05 but also with a
version that is some weeks old.
/Mikael
\setupcombinations[
distance=1cm,
]
\starttext
\startuseMPgraphic{figa}
draw (1cm,1cm) -- origin -- (1cm,-1cm);
draw boundingbox currentpicture;
\stopuseMPgraphic
\startplacefigure[location
,bottomoffset=1em,
before={\testpage[3]\blank[3*big]},
after={\blank[3*big]}]
\startuseMPgraphic{background:rule}
linecap := butt;
begingroup;
for i=1 upto nofmultipars :
draw (ulcorner multipars[i]--llcorner multipars[i])
withcolor \MPvar{linecolor
\definetextbackground
[Example]
[mp=background:rule,location=paragraph,
rulethickness=3pt,framecolor=red,
leftoffset=1em,rightoffset=1em,
toptoffset=1em,bottomoffset=1em,
before={\testpage[3]\blank[3*big]},
after={\blank[3*big]}]
\startuseMPgraphic{background:rule}
linecap
is it fully red; why?
How to specify text to be partially transparent, too?
TIA.
Best regards,
Lukas
Wouldn't it be better to define the transparency in ConTeXt and use it
for both text and drawing? Like this:
\definecolor [tred] [r=1,g=0,b=0,t=.2,a=1]
\startuseMPgraphic{T}
newpath rc;
in ConTeXt and use it
for both text and drawing? Like this:
\definecolor [tred] [r=1,g=0,b=0,t=.2,a=1]
\startuseMPgraphic{T}
newpath rc; rc := fullsquare xyscaled (50mm, 50mm);
color col; col := (1.,.1,.1);
drawoptions(withcolor \MPcolor{tred}) ;
draw rc withpen pencircle scaled (2.5mm)
Hello,
suppose having the following code:
\startuseMPgraphic{T}
newpath rc; rc := fullsquare xyscaled (50mm, 50mm);
color col; col := (1.,.1,.1);
draw rc withpen pencircle scaled (2.5mm) withcolor %col;
transparent(1, .4, col
]
[background=color,backgroundcolor=yellow]
\startuseMPgraphic{CircleTest}
path p,q ;
p := fullcircle scaled 2cm ;
q := fullcircle scaled 1cm ;
fill p -- reverse q -- cycle withcolor blue;
\stopuseMPgraphic
\starttext
\useMPgraphic{CircleTest
=yellow]
\startuseMPgraphic{CircleTest}
path p,q ;
p := fullcircle scaled 2cm ;
q := fullcircle scaled 1cm ;
fill p -- reverse q -- cycle withcolor blue;
\stopuseMPgraphic
\starttext
\useMPgraphic{CircleTest}
\stoptext
where the background color (yellow
viewer? Is it a font issue?
Okay, I got a clean compile using \definecolor and referencing that in
the MP page.
\setupbackgrounds
[page]
[background=color,backgroundcolor=yellow]
\definecolor[Transp][r=1,t=0,a=12]
\definefont
[DVSrB]
[file:DejaVuSerif-Bold.ttf]
got a clean compile using \definecolor and referencing that in
the MP page.
\setupbackgrounds
[page]
[background=color,backgroundcolor=yellow]
\definecolor[Transp][r=1,t=0,a=12]
\definefont
[DVSrB]
[file:DejaVuSerif-Bold.ttf]
\startuseMPgraphic{HeartTest 1}
shapes, but nothing that I can apply to text glyphs. Undraw doesn’t do it.
\setupbackgrounds
[page]
[background=color,backgroundcolor=yellow]
\definefont
[DVSrB]
[file:DejaVuSerif-Bold.ttf]
\startuseMPgraphic{HeartTest}
picture h;
h := &quo
[subject]
> \setuphead[slide][
> style=\ssb,
> command=\MySlide,
> color=nearlywhite,
> insidesection=\doifnot{\structureuservariable{align}}{top}\vfill,
> aftersection=\doifnot{\structureuservariable{align}}{top}\vfill,
> page=yes,
> ]
>
> % Footer
> \setupp
insidesection=\doifnot{\structureuservariable{align}}{top}\vfill,
aftersection=\doifnot{\structureuservariable{align}}{top}\vfill,
page=yes,
]
% Footer
\setuppagenumbering[location=]
\setupfooter[style=small, color=colortwo]
\setupfootertexts[][\userpagenumber/\lastuserpage]
% Lists
\startuseMPgraphic{itemi
201 - 300 of 1011 matches
Mail list logo