Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- startuseMPgraphic{mp:tcolorbox}
- path p, q; numeric w, h, o;
- w := OverlayWidth; h := OverlayHeight; o := BodyFontSize;
- q := (0,0) -- (0,h) -- (w,h) -- (w,0) -- cycle;
- p := (0,0) -- (0,h+2o) -- (w,h+2o) -- (w,0) -- cycle;
- p := p cornered (o);
- fill p withcolor OverlayColor;
- draw p withcolor OverlayLineColor withpen pencircle scaled OverlayLineWidth;
- p := (0,h) -- (0,h+2o) -- (w,h+2o) -- (w,h) -- cycle;
- p := p cornered (o);
- filldraw p -- cycle withcolor OverlayLineColor;
- draw textext.rt(MPstring{tcolorbox}) shifted (o,h+o) withcolor white;
- setbounds currentpicture to q;
- stopuseMPgraphic
- defineoverlay[tcolorbox][useMPgraphic{mp:tcolorbox}]
- definesetframetitle
- {setMPtext{tcolorbox}{strutframedparameter{title}}}
- defineframedtext
- [tcolorbox]
- [frame=off,
- background=tcolorbox,
- backgroundcolor=white,
- framecolor=darkred,
- rulethickness=2pt,
- extras=setframetitle]
- starttext
- starttcolorbox
- [title={Knuth},
- backgroundcolor=lightgray]
- samplefile{knuth}
- stoptcolorbox
- stoptext
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement