Questions tagged [metafun]

MetaFun is Hans Hagen’s extension to (or module for) the MetaPost language.

Filter by
Sorted by
Tagged with
1 vote
0 answers
61 views

TikZ equivalent cover background of METAFUN

I have this code % cover in METAFUN \startuseMPgraphic{cover} StartPage ; fill Page withcolor white ; pickup pencircle scaled 2mm ; path p ; p := tensecircle(1cm,.75cm,.15cm) xsized(PaperWidth-2cm) ; ...
user avatar
0 votes
1 answer
110 views

Fit all given points in the patatoid

I am trying to adapt this metapost patatoid generator to fit a list of pairs given to a macro. To that purpose I loop through the list of pairs and determine the greatest x and y distances between all ...
user avatar
  • 495
4 votes
2 answers
157 views

Set precise label position in metapost

Is there any option(s) in METAPOST (and/or METAFUN) to label things like TikZ allows it for nodes? Of course I know about label.{top|bot|lft|rt|...} but is there something more precise?
user avatar
  • 495
8 votes
3 answers
338 views

Adding Column Rules in ConTeXt's columnsets / pagecolumns

This is my first time playing with ConText and, while I'd like to think I have some decent programming experience, TeX code is something I've never worked with before (and am sufficiently intimidated ...
user avatar
  • 81
4 votes
1 answer
172 views

ConTeXt: How to change parts and chapters pages background color with MetaFun?

I am trying to reproduce something like this for parts and chapters with MetaFun: Placing the content on the page is simple so I am trying to get the colored background. However I do not know how to ...
user avatar
  • 495
2 votes
1 answer
81 views

Dynamically defining metafun positional variables with \structurelistuservariable in ConTeXt

Following on from this question, I am now trying to achieve the same effect (drawing with metafun in the TOC, from the section number to the edge of the page) using positional overlays instead. ...
user avatar
  • 65
4 votes
1 answer
117 views

Drawing from a framed overlay to the page edge in ConTeXt and Metafun

Using ConTeXt for typesetting and metafun to draw, I would like to create a custom colored overlay for my table of contents. I want to fill a colored rectangle for certain TOC entries that stretches ...
user avatar
  • 65
3 votes
2 answers
124 views

Using sans as a default font in ConTeXt Metapost

When using metapost in ConTeXt, I would like to have all my labels in sans by default. Which option can configure it and which environment should I use to pass it (MPinclusions?) I am aware of this ...
user avatar
  • 2,972
3 votes
2 answers
402 views

Convert numeric into a Roman Numeral inside a metafun loop

How can I automatically convert a number inside a metafun loop? I tried using MPvar but this doesn't work. \starttext \startMPpage for i=1 upto 10: label (i,(10i,0)); label ("\convertnumber{...
user avatar
  • 2,972
1 vote
1 answer
143 views

Fill all elements of a METAPOST array

I would like to fill paths of arrays of arbitral length using a loop. Is there a way to iterate the fill operator on each array element, something equivalent to this shell loop set -A Test foo bar for ...
user avatar
  • 2,972
2 votes
2 answers
232 views

ConTeXt: Fontawesome symbols with MetaFun

I am trying unsuccessfully to pass fontawesome symbols as variable to MetaFun. I tried things like, passing the symbol directly through the variable \usesymbols [fontawesome] \startuniqueMPgraphic{...
user avatar
  • 495
2 votes
2 answers
188 views

ConTeXt: How to force text to fit in a MetaFun box?

How to make text fit in a MetaFun box with specific width ? For now I have \startuseMPgraphic{MPBoxFrame} % Useful values numeric w, h, o, b ; w := 4.5cm ; h := OverlayHeight ; o := ...
user avatar
  • 495
5 votes
1 answer
512 views

Questions about fancyboxes in ConTeXt with MetaFun

I'm trying to reproduce something like that with MetaFun: For now with these links, I managed to get that: \definecolor[darkblue][r=20,g=30,b=50] \startuseMPgraphic{MPTheoremFrame} % Useful ...
user avatar
  • 495
2 votes
1 answer
234 views

Why does this example from the MetaFun manual not work?

[Question also asked on the ConTeXt mailing list but no answer yet so it's probably complicated enough to get an answer, hence repeated here] I would like to use the result of transparent() straight ...
user avatar
  • 173
2 votes
2 answers
157 views

Trouble getting curly braces printed from METAPOST code generated by ConTeXt Lua (with minimal example)

[Question also asked on the ConTeXt mailing list, I'll post a solution from either in the other] The following minimal example illustrates my problem. I need to typeset a generic string (which is read ...
user avatar
  • 173
3 votes
1 answer
75 views

Why does this syntax outputs an error under METAFUN/METAPOST?

Given this MWE (compiled under ConTeXt) \starttext \startMPpage %variables u:=1mm ; numeric l[]; l[1]:=30 ; l[2]:=70 ; draw (0,0) -- (0,100u) ; %this does not work %fill unitsquare xscaled (l[2]-l[...
user avatar
  • 2,972
2 votes
1 answer
124 views

How to align text on baseline in MetaFun without using setMPtext?

I want to draw several pieces of text that should be aligned so I need to be able to place these texts according to their baseline. Looking at the MetaFun manual, pages 143-144, it is explained that ...
user avatar
3 votes
1 answer
213 views

ConTeXt: Heading text surrounded by lines

I'd like to replicate this heading style in ConTeXt: The closest I've come is surrounding a centered text with \thinrules but those are at the baseline of the text instead of horizontally centered ...
user avatar
  • 377
4 votes
1 answer
364 views

Cover page coloring in ConTeXt

How would I go about coloring the top and bottom of a page in ConTeXt/Metafun? Currently I am using this code \definecolor [Top] [h=00ff00] \definecolor [Bottom] [h=ff0000] \definecolor [TitleColor]...
user avatar
2 votes
3 answers
128 views

metapost " missing `,' has been inserted." compilation error

I'm quite new to this language and can't figure out the error in following code. Any help would be appreciated ! verbatimtex \documentclass{article} \usepackage[T1]{fontenc} \usepackage{mathptmx} \...
user avatar
  • 163
1 vote
1 answer
188 views

Help with MetaPost and Metaobj with latex

Kind help with two examples to do metapost and metaobj in latex running from Texicenter. what packages to include and program two examples I read through book not able to understand. First input ...
user avatar
  • 65
6 votes
2 answers
416 views

ConTeXt and Metafun: Framed enumeration with counter as part of overlay

How do you make an enumeration where the enumeration counter appears within a frame decorated with Metafun? The idea is to have something similar to an example on pg. 144 of the Metafun manual: ...
user avatar
  • 1,693
5 votes
1 answer
252 views

ConTeXt and Metafun: Using environment variables inside overlay

I would like to draw a custom frame for the framed environment using Metafun. I am currently hard-coding the frame color within the Metafun definition. However, I would like the Metafun frame to ...
user avatar
  • 1,693
4 votes
1 answer
165 views

ConTeXt: Multiple colour stops for linear_shade

Background Looking to parameterize a horizontal rule (for headers and footers) that has three colour stops (A to B to C) and a variable thickness. For example: Single Stop Code The following code ...
user avatar
12 votes
0 answers
436 views

metafun: Why is the arrow tip not filled? [closed]

Trying out another example I saw that with the metafun format (luatex version) the arrow tips are no longer filled. The following document (to be compile with lualatex) shows the problem: \...
user avatar
5 votes
1 answer
150 views

Metapost graphics not aligned in ConTeXt TABLE

I am using TABLE to design map legend. Symbols should be middle-aligned. As said in the title, the metapost graphics used as symbols are not aligned in my TABLE environment (column 1 and 3), whereas ...
user avatar
  • 2,972
1 vote
1 answer
278 views

expand string array in loop with label

I would like to expand one string array in a short metafun loop. Each box should be labelled with the appropriate string ("classicism", "Lumières", "romanticism"). How can I make the label function, ...
user avatar
  • 2,972
4 votes
1 answer
476 views

Metafun: relative positioning of points and paths

I've read through most of the Metafun manual, but I can't seem to find any mention of a relative positioning system. I have two use cases in mind. First, I would like to position points along a path ...
user avatar
  • 1,693
2 votes
1 answer
313 views

Using Metapost for titles in Context

I'd like to use Metapost to format my titles like this (not exactly like this, so no need to complain about design issues :)): The problem is that when I try to use the following macro I get an error:...
user avatar
1 vote
1 answer
288 views

Integrating lua-generated Metapost graphics in Context

Normally we can integrate Metapost graphics in Context with the use of \startuseMPgraphic{id} and \useMPgraphic{id}. The idea is to define the graphics somewhere and use them somewhere else. However, ...
user avatar
2 votes
1 answer
443 views

Compile metafun book with ConText (getting a cover-like)

Anyone knowns how to create (please sample code) a cover page like this?: http://context.aanhet.net/general/manuals/metafun-p.pdf The sources are available from: http://context.aanhet.net/svn/...
user avatar
  • 21
4 votes
3 answers
461 views

How can I fill a complex path with Metapost/Metafun?

Is there any way to produce exactly following PS and SVG code with Metapost/Metafun? Unfortunately, unfill won't work for me, as there is a background in the resulting page. And this example is ...
user avatar
3 votes
1 answer
2k views

How to insert (if possible) an image inside a Metapost figure? (in plain LaTeX environment)

I'd like to insert an image into a Metapost figure (I'm using MikTeX/LaTeX, no Metafun). I hopefully tried (also thanks to Aditya's suggestion) the following Metapost code (compiled with -tex=pdftex ...
9 votes
1 answer
757 views

How to fix this fancy heading in ConTeXT

I don't know if this is a duplicate or not but we can close it if it is. I have been trying to learn ConTeXt. I specially love the heading and page number formattings that I see in the documentations ...
user avatar
  • 16.7k
10 votes
1 answer
448 views

How to debug METAPOST inlined in ConTeXt? (Or "message" primitive and "loggingall;" in inlined METAPOST)

I have a METAPOST program that works fine with mpost, but fails when I try to run it inline in ConTeXt. In order to debug it, I would like to see the usual METAPOST logging and/or to use the METAPOST "...
user avatar
5 votes
1 answer
829 views

Metapost - Boundary box

I want to make a series of images with Metapost and Context. I want the height and width of the images to be fixed ( like a frame ) and center the picture drawn with Metapost inside that frame. So, is ...
user avatar
  • 135
7 votes
1 answer
1k views

How to install metafun?

How can I install the metafun metapost macros? I have tried to tlmgr install metafun, but it cannot find it. Also a search for “metafun” on ctan yields only a introductory tutorial on ConTeXt, in ...
user avatar
  • 24.9k