MetaPost uses a language based on that of Metafont to produce precise technical illustrations. Its output is scalable PostScript or SVG, rather than the bitmaps Metafont creates. This tag is compatible with {diagrams}.

learn more… | top users | synonyms

5
votes
2answers
260 views

graph of function with metapost

I have to create graph of function 3x^4 − 11x^3 + 12x^2 − 4x + 1 ; interval <0,1;1> . I have just func.mp input gjktc.mp; u:=1mm; path p[]; beginfig(1); draw (0,0)--(10u,10u); draw ...
6
votes
1answer
232 views

Full colored Triangle and Circle in Metapost

The question may be trivial, but I need your help, to draw a full colored triangle and circle (where the triangle will be inside the circle). Here is my file pic_1.mp: input gjktc.mp; u:=1mm; ...
3
votes
1answer
111 views

Metapost and ConTeX

I am completely new to ConTeXt and have just started to experiment with writing metapost directly within ConTeXt. My problem is that some of my existing metapost files call other metapost files which ...
7
votes
1answer
161 views

ConTeXt+MetaPost: Non-conflicting random background and foreground colours

Overview Looking to create a page that has a random (and non-consecutively repeating) background colour with titles that are also random. Problem The code has two problems. First, generating a ...
5
votes
1answer
201 views

MetaPost: Randomly variably thick curves

Overview Looking to emulate the following sinusoidal wave having random variations in both its filled and outline thickness: The wave has two parts: a variably thick filling and a variably thick ...
6
votes
1answer
176 views

MetaPost: Non-uniform periodic tessellations

Overview Looking to create backgrounds that have regular polygons aligned to a grid. Problem The space between the polygons varies, even though the radius for the polygons has been calculated in ...
8
votes
1answer
194 views

MetaPost: Adjust colour value (brightness/luminosity)

Background In MetaPost, colours can be lightened or darkened by calling the transparency function. However, this allows other colours to show through, which isn't necessarily desirable all the time. ...
5
votes
1answer
101 views

ConTeXt: Randomly lighten or darken a colour within a threshold

Overview Looking to randomize the colours of squares of a checkerboard so that some are slightly lighter and some are slightly darker, relative to another colour. Problem The following sets a base ...
5
votes
1answer
150 views

Faster Metapost SVG Output with TeX?

I am generating some diagrams with METAPOST. I need the output in SVG format. My labels are generated by calls to LaTeX via Tex.mp and its TEX METAPOST definition (also called a macro). My ...
0
votes
0answers
143 views

Im trying to set up a graph but keep gettin error “isolated expression”

beginfig(1); numeric u; path xaxis,yaxis; Scale: 1=u u=0.5in; yaxis= (0,-4.1u)--(0,4.2u); xaxis= (-4.1u,0)--(4.2u,0); pickup pencircle scaled 1pt; drawarrow xaxis; drawarrow yaxis; pickup pencircle ...
47
votes
6answers
2k views

How to automatically draw tree diagram of prime factorization with LaTeX?

I want to have a simple interface to automatically draw tree diagrams of prime factorization. For example, by invoking the following code, \PrimeTree{36} \PrimeTree{90} \PrimeTree{112} ...
13
votes
2answers
473 views

How to draw spherical triangles?

Does anyone know how to draw spherical arcs and spherical triangles using LaTeX?
9
votes
1answer
263 views

What programmable drawing tool(s) can solve how to fill a region with a path

I've recently become interested in computer numerical control (CNC), and have been considering using METAPOST in a CNC work-flow (using pstoedit to convert .pdf (or .mp) files to G-Code). The extant ...
7
votes
1answer
283 views

Wrong TFM generated by mf2pt1 in TeXLive 2013

I need to generate a font from METAFONT file. I used mf2pt1 and generated PFB file and TFM file, but TFM file was incorrect. I tried to generate TMF file of cmr10.mf by mf2pt1, then looked at ...
10
votes
6answers
928 views

How to preview images generated by MetaPost?

I use the old MetaPost program to create graphics. My problem is that, to see the result of my MetaPost figures, I have to compile first the .mp file and then the .tex file where I've inserted them. ...
7
votes
2answers
255 views

Putting circle into a right triangle

I need help with MetaPost in putting circle into the bottom left corner of a right triangle. Here is my work: beginfig(1) pair A,B,C,D,E,F,O,G,H,I,J,AA, BB, CC, HB, HF, DD, EE,FF,h; ...
3
votes
1answer
179 views

Help with the geometry figure

Can someone help me with creating such a figure in metapost?
3
votes
3answers
586 views

Drawing system architecture in Latex

I want to draw a system architecture as in the picture below Can you help me?
4
votes
0answers
302 views

Is fine-grained grid control possible? [closed]

I want to make a variety of checklists which are essentially based on a grid layout. I care about having fine-grained control over the exact placement of labels and boxes. I do not care about ...
3
votes
1answer
531 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 ...
3
votes
0answers
178 views

Use fancy page numbering using Metapost graphic

ConTeXt is a great TeX format specially since Metapost is tightly integrated into it that producing page numbering style like is easily implemented if you know Metapost (which I admit I don't, ...
8
votes
1answer
371 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 ...
28
votes
2answers
908 views

What is Metapost/Metafont and how can I get started using it?

Inspired by Why Metapost discrimination?, I'd like to come to know Metapost far better than I do now. All I really know is that Metapost is a language for describing graphics, and Metafont is used ...
2
votes
0answers
74 views

feynmf working but NOT feynmp (FIXED!) [duplicate]

I'm using Mac Mountainl Lion, TexShop (everything worked before on Leopard). This is the first time I use feynmp on Mountain Lion since I upgraded and it's not working. When I use feynmf it seems ...
2
votes
0answers
420 views

File error in non stop mode [closed]

I am trying to make a feynman diagram using feynmf. My code is \documentclass[a4paper,11pt]{article} \usepackage{xcolor} \usepackage{amsthm} \theoremstyle{definition} \newtheorem{exe}{Exercise} ...
6
votes
1answer
420 views

Type phase symbol in ConTeXt, like LaTeX steinmetz package

I am trying to create an electrical phase symbol in ConTeXt like that produced by the \phase{} command from LaTeX's steinmetz package. Here is what the symbol looks like: Is there something out ...
5
votes
2answers
230 views

Is it possible to pass options to mpost.exe using luamplib?

I would like to use the development version of metapost with luamplib. I've switched over the executable mpost.exe which is presumable called by luamplib somewhere along the line. Now, I would like ...
3
votes
1answer
168 views

Picture and Paragraph in Metapost

How to insert a paragraph in Metapost and a drawing below that? This has to be done within a single Metapost block, (i.e) within a single \startMPcode and \stopMPcode block Sample image :
10
votes
1answer
206 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 ...
2
votes
1answer
297 views

Metapost External Figure

I have a metapost file image.mp containing the following lines: beginfig(0); draw p0; externalfigure "/Users/dsg/tex/images/image.png" xyscaled r0 shifted r1; endfig; When I run mptopdf scene.mp ...
7
votes
2answers
195 views

Why won't this Metapost while loop terminate?

The following loop fails to terminate and I have no idea why. I've either violated some syntax rule, there's an issue with the self reference in n:= floor (n/2);, or I've missed something ...
5
votes
1answer
193 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 ...
5
votes
1answer
107 views

Context - Error creating boxes in loop

The following code creates an array of boxes to represent an array. \startMPinclusions input boxes ; \stopMPinclusions \starttext \startluacode function createGraphic(k,c,indH) local i=1 ...
3
votes
1answer
135 views

Problem with package gmp (or with xkeyval?)

I use the "gmp" package which allows to insert MetaPost coding (placed inside an mpost or mpost* environment) in a LaTeX source file. In few words, it does approximately the same job as other packages ...
0
votes
1answer
314 views

Metapost crashes when adding tex labels

I am using Miktex 2.9 (64-bit) and TexnicCenter when compiling Metapost (version 1.504). My files will compile fine without labels. When I try to add a tex label, metapost crashes. I NEED HELP PLEASE! ...
23
votes
1answer
836 views

More elegant way to achieve this same camera perspective projection model?

I just finished a camera perspective projection model using TikZ. Although, while I'm pretty satisfied with the result, it took me a lot of time to do it. It's easy to see from the code below that I'm ...
7
votes
1answer
194 views

Metapost intersectiontimes

In the code below intersectiontimes is not giving an intersection point of the two paths. Could anyone provide some guidance on how to find (and mark) the intersection points of the curves below? ...
4
votes
2answers
630 views

What tool was used to generate these technical diagrams?

I was reading a paper or Computed Tomography, and I found these two nice diagrams: And I was wondering, what tool was used to make them. I've worked with Tikz for example, but I believe it would ...
7
votes
1answer
319 views

How to draw dash-dotted curves using MetaPost?

Is it possible to (easily) draw dash-dotted curves in MetaPost, i.e. curves that alternate between a dash and a dot? For either dashed or dotted curves, I use the draw command and end it with dashed ...
11
votes
1answer
330 views

(ConTeXt MkIV) Text in PiechartMP

So I need to include some pie charts in my document. As I'm using Metapost for all graphics I tried using the PiechartMP Metapost package. But for some strange reason no text shows up, just a very ...
6
votes
1answer
469 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 ...
2
votes
1answer
228 views

Installing and using MPlib

I have been able to find the manual for MPlib on CTAN, but where can I find the C sources for the library itself? Sorry for asking such a basic question.
9
votes
2answers
158 views

Defining a point on a path by direction of another path

Is it possible to define a point when I have two paths such as: beginfig(1); u := 1cm; path p[]; p0 := (1u,3u)--(2u,2u); p1 := (2u,0)--(3u,2u); for i=p0,p1: draw i; endfor; endfig; end so ...
10
votes
2answers
306 views

How to let text flow around irregular-shaped graphics in ConTeXt?

I have some illustrations which I need to scan and place within a document. The illustrations come in various shapes, with no straight edges, and are bound by lots empty white space, e.g.: ...
25
votes
3answers
713 views

How do I make a superellipse node shape in tikz?

A superellipse is a kind of closed curve which can be used as a "intermediate" shape between ellipse and rectangle. A parameter can control its "roundness". I find it a pleasant alternative to the ...
21
votes
1answer
4k views

Package for typesetting Feynman diagrams (efficiency of `feynmp` and `tikz`)

Is there any good package for typesetting lots of Feynman diagrams? My question arise because Feynmp: Circle with three vertices lead me take a look at the documentation for the feynmf/feynmp ...
4
votes
1answer
435 views

Getting “The memory dump file could not be found” when trying to compile mpost file

I am using texmaker with the following mp example: filenametemplate "%j%c.mps"; beginfig(1); z1=(0,0); z2=(10mm,10mm); drawarrow(z1--z2); label.ulft(btex $A$ etex, .5[z1,z2]); endfig; I keep ...
2
votes
0answers
239 views

Why no GUI for Metafont? [closed]

Why has no-one ever created a graphical user interface for Metafont ? One can easily imagine a system that would allow interactive adjustment of the font parameters, with near-real-time display of ...
4
votes
1answer
448 views

How to include a .mp file into a LaTex file?

I used metagraf to create the figure I wanted and saved it as a .mp file and I wanted to use the command "includegraphics{**.mps}" to include the corresponding figure but it said wrong, no such file ...
6
votes
1answer
291 views

btex and etex in luamplib labels

I've been experimenting with METAPOST and in particular with luamplib. I found that I couldn't have tex typeset labels with the btex/etex construct as apparently is possible with straight up METAPOST. ...