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
0answers
175 views

Scheme for Chemical Potential Energy representation [closed]

I wrote this code to schematically represent the concept of chemical potential energy. This image will be part of a representative diagram of energy transformations in a voltaic cell: chemical ...
6
votes
0answers
86 views

Is this a bug in the pfb file or a bug in metapost's “glyph”?

I've only recently started playing with metapost's "glyph". I've discovered (MWE below) an anomaly with the paths in serifs for the cm font set from these experiments. Starting point: it seems that ...
3
votes
2answers
111 views

add labels and build the path through a list iteration

I had to build a graph with metapost for my physics classes (see below). What I would like to ask you is if there are a way to add the curve and their labels in the some way that i do with tikz: ...
3
votes
2answers
138 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 ...
3
votes
1answer
86 views

Increase image resolution using MetaUML and metapost

I'm using MetaUML to create text-driven UML diagrams. When I generate a figure, with: $ mpost example.mp $ convert ps:example.1 png:example.png a very low-resolution image is generated. If I scale ...
6
votes
1answer
261 views

How to create MetaPost image for LaTeX

Im trying to figure out how to create this image in MetaPost
26
votes
2answers
710 views

Chaotic billiard with TikZ

I'm looking for a TikZ library that could help me to represent different shapes of chaotic billiards. Any idea?
2
votes
0answers
95 views

Omitting visibility marker in MetaUML

Is there a way to omit the visibility (lock symbol) marker in MetaUML Class objects? If I just refrain to use one I get a protected marker as a default. A short example (note: the LaTeX builder has ...
12
votes
2answers
263 views

Is there another better way to have a region with gradient opacity?

My objective is to get a region with gradient opacity. In the following MWE, the region is a quarter of a disk on the top a bird. I made the gradient opacity by partitioning the sector into 45 ...
6
votes
2answers
184 views

Using negative coordinates in EPS file with XeLaTeX

I've run into inconsistent behavior with XeLaTeX and EPS files with negative coordinates. The wrapping block for the figure is calculated correctly; however, the content of the figure is misplaced ...
2
votes
0answers
50 views

Context mptopdf problem [closed]

I've a problem with the following file input graph u=0.5cm; beginfig(0); draw dashpattern(on 5bp); picture pa; pa=currentpicture; currentpicture:=nullpicture; draw dashpattern(on 5bp off ...
8
votes
2answers
200 views

LuaLaTeX and MetaPost

Is there a LuaLaTeX equivalent of \startMPinclusions input mpfile; \stopMPincusions in ConTeXt? That is, if I have \documentclass{article} \usepackage{luamplib} \begin{document} ...
3
votes
1answer
118 views

Using Metapost inline in LaTeX (no ConTeXt)

When I was more active in LaTeX and Metapost (~10 years ago) I could not find a way to directly use Metapost in LaTeX. There were few tutorials on how to use it within ConTeXt, but for using it with ...
0
votes
0answers
76 views

click button and next picture will be shown

I would like to create presentation and export to GIF, for example. I have three files: obr1.mp, obr2.mp, and obr3.mp (which is my pictures drawn). I want have .tex file, where I could press space ...
45
votes
13answers
2k views

What is the simplest way to draw this triangle exactly?

I want to see how we can exactly construct the following diagram as simple as possible. It means that the manual calculation should be avoided. Note that the angle marks attached to angles ...
5
votes
2answers
300 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
253 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
116 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
174 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 ...
6
votes
1answer
221 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
191 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
2answers
246 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
107 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
177 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
163 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 ...
48
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
540 views

How to draw spherical triangles?

Does anyone know how to draw spherical arcs and spherical triangles using LaTeX?
10
votes
1answer
271 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
299 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
1k 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
268 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
197 views

Help with the geometry figure

Can someone help me with creating such a figure in metapost?
4
votes
3answers
662 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
315 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
592 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 ...
4
votes
0answers
192 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
391 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
1k 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
495 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
517 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
235 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
176 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
213 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
327 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
208 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
203 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
110 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
152 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
345 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! ...