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

3
votes
0answers
27 views

Processing metafont source with metapost

I have a file say test.mp that contains: outputtemplate := "%j-%c.eps"; mode=localfont; mag=100.375; input cmr10.mf; When I run mpost as follow: mpost&mfplain test.mp Some of the glyphs ...
2
votes
1answer
34 views

Metapost “odd” operator fails with negative value?

Has anyone else noticed that in Metapost the odd operator appears to fail with negative numbers? Here's my test program (which works with both Metafont and Metapost). for i=-2 upto 2: show(i); ...
2
votes
1answer
62 views

Proper use of the emp package

I've used metapost for generating figures for my latex documents for some time, but I've always managed them as separate documents, and included the resulting graphics into the latex document using ...
3
votes
1answer
106 views

how to efficiently code in metapost?

I am trying to get better at metapost, but the error messages are pretty cryptic (if there are at all) and it always takes a big effort go compile an mp file. Up 'best' program for writing and ...
2
votes
0answers
136 views

MetaPost to PDF in Texmaker (miktex)

I am trying to make the MPost command in Texmaker work. I am using the Texmaker in windows 7 with miktex. So far I used the example document below. When using the windows console I was able to use ...
3
votes
1answer
37 views

Minipage inside MetaPost label within GMP - what is wrong?

Any clues please?? The following MWE will not compile. Line where minipage environment was used seems to be the offensor. With that left out compiling is OK. \documentclass{beamer} ...
7
votes
0answers
100 views

Union of Paths in MetaPost

I'd like to compute the union of a collection of outlines in MetaPost. I'm aware of the buildcycle macro (in combination with cutbefore and cutafter). However, that macro is not very useful because I ...
3
votes
1answer
53 views

OpenType MPlib labels with luatex-plain

I am trying to get the luamplib to work with the luatex-plain -format. I installed BasicTeX2014, and then did tlmgr install context. Then I did luatex --ini ...
3
votes
1answer
87 views

how to use metapost package boxes

Try to make a text box, like "framed" text in context using metapost by following the example mpboxes or metapost examples \startMPpage %input boxes boxit.a(btex test etex); a.c = (0,0); ...
1
vote
0answers
60 views

Is the introduction chapter 0 or 1? [closed]

I know this question, is not directly about tex: What is the norm in science: Is the introduction the 1st or 0st chapter?
5
votes
0answers
54 views

metaobj point as object

i give a first look to metaobj package and i try to define a triangle (almost as in the manual). So here's the EDIT (fpast request) code : input metaobj; vardef newTriangle@# text options= ...
2
votes
1answer
181 views

Metapost labels do not work with MiKTeX 2.9

I have upgraded from MiKTeX 2.8 to 2.9. All the label commands that earlier worked in Metapost are not working anymore. I am using MiKTeX in conjunction with TeXnicCenter. The MetaPost version ...
20
votes
6answers
762 views

Generating Random arrows in tikz

I would like to draw this figure : Hence, I resort to TikZ. But, it seems to be very difficult drawing arrows precisely in TikZ with the precise locations (x,y). I have achieved this: Here is the ...
4
votes
1answer
44 views

Define a pair/point as a pair/point along a path length METAPOST

Is it possible to define a pair as a point along a specified length of a path? so for example beginfig u=2cm; path x; x=(0,0)..u*dir(225); %v= a point along a fraction of the length of x in a ...
3
votes
1answer
65 views

Translate a path in Metapost

Is there a way to draw a path that was defined by relationships between pairs centered around a specific point? I basically want to create a path that I can translate anywhere I want in my image. ...
31
votes
6answers
2k views

How to make the length of a car moving on a roller coaster track remain unchanged?

For any arbitrary parametric smooth curve, how can I make the length of a car remain unchanged? \documentclass[pstricks,border=12pt]{standalone} \usepackage{pst-plot,pst-node} \pstVerb { ...
11
votes
1answer
76 views

Inline purified PostScript (MPS)

I just learned how to inline PDF code using the \pdfliteral command and that purified Encapsulated PostScript generated by METAPOST or purifyeps can be converted to PDF code by pdfLaTeX. However, I ...
3
votes
1answer
45 views

btex \begin{align} …\end{align} etex METAPOST issue

I seem to be having trouble getting my code to carry out any amsmath command with the btex--etex environment in a metapost file. The appropriate packages are defined withint my tex file, so I really ...
6
votes
2answers
93 views

How to distinguish between Metafont and MetaPost?

Background I'm trying to make a nice SVG out of Knuth's Dangerous Bend symbol based on his own code, for which the obvious tool to use is MetaPost. However, I'd prefer to still be able to process the ...
11
votes
4answers
416 views

Plot the cusp catastrophe surface

I'm trying to draw (plot) the Cusp catastrophe surface into latex using any software logic. I am completely stuck because I'm definitely not a mathematician. The surface has the potential: V(x) = ...
3
votes
1answer
89 views

Drawing with a macro

I have just began using MetaPost and I would liked to be able to put a grid on my images, so I could easily read coordinates from it. I would liked to write a macro, that I could import while creating ...
6
votes
0answers
96 views

How to define a sort of reference in METAPOST?

Assume we are defining a canvas abstract data type in METAPOST, where some tasks are gathered. I would like to define a kind of reference to the last added task, but I do not know METAPOST good enough ...
8
votes
2answers
211 views

How to create a wavy lines with MetaPost?

I am looking for a macro or whatever code that can draw a wavy curves with MetaPost. In other words, I need a wavy/spring version of what follows: beginfig(1); z1 = (0,0); z2 = (3,2); z3 = (6,0); ...
2
votes
1answer
75 views

Hatching Package with Metapost

I am new in metapost and I am unsure as to re-define the withcolor command to revert back to the metapost default. I am trying to draw the cross section of a cylinder, where the inner circle is ...
38
votes
12answers
3k views

Drawing a Reuleaux Triangle

A Reuleaux triangle is a shape of constant width sort of like a rounded equilateral triangle. (Reuleaux triangle - Wikipedia, the free encyclopedia) It can be formed by the intersection of three ...
3
votes
1answer
57 views

adjust uniformdeviate values

I need to insert in the rectangle all my 10 molecules in random way (angle and x,y position). I don't know what is wrong with my code. \startMPinclusions vardef spring (expr a, b, w, h, n) = pair ...
4
votes
1answer
66 views

lost linear_shade output

What is wrong with my code? The second call of SoundEnergy lost the black/white gradient. \startMPinclusions def SoundEnergy = path pr ; pr := unitsquare xscaled .3cm yscaled 2cm ; ...
7
votes
3answers
226 views

How to automatically draw the images of a point placed between 2 inclined mirrors?

Consider a point X placed between two inclined mirrors as follows. \documentclass[pstricks,border=20pt,12pt]{standalone} \usepackage{pst-eucl} \def\Angle{37}% extreme case in which 360/\Angle-1 is ...
4
votes
2answers
129 views

Why two intersected paths can't buildcycle in MetaPost?

Suppose that I have two path: beginfig(0) u:=10pt; vardef randomcirc(expr O, r, w) = save p,i; pair p; numeric i; p=O+right*r; p for i=1 upto 9: .. (p rotatedaround(O, ...
6
votes
1answer
118 views

The array in metapost

Suppose I have defined an array of points pair p[]; Then are p.0, p0, p[0] different? Can I use p.01, p01, p[01]?
7
votes
3answers
356 views

MetaPost: How to fill cycle path with slanted lines?

Suppose I have build a cycle path with bulidcycle: path pa[]; pa.0:=(-6u,0){dir 90} .. (0,8u){dir 0}; pa.01:=pa.0 reflectedabout(origin, (0,1)); pa.1:=(-6u,0){dir -90} .. (0,-3u){dir 0}; pa.11:=pa.1 ...
7
votes
1answer
381 views

Feynmp / metapost - labels not working

I am trying to draw a simple Feynman diagram with FeynMP. I use the following code to generate by .mp file - note I use the fmfgraphs environment. \documentclass{article} \usepackage{feynmp} ...
40
votes
9answers
3k views

The Spiral of Roots in TikZ

How can one create a spiral of roots as shown in the diagram below: where one can use a command to draw more parts to the spiral. For example, a command like \sqrtspiral{1}, \sqrtspiral{2}, ...
3
votes
2answers
118 views

metapost, metaobj and labels

I found this trick posted by Aditya some time ago that allowed to use metaobj in context. Currently this code no longer works. Currently, are there any way to use metaobj in context? The main problem ...
4
votes
1answer
188 views

Electron distribution box diagram

Just for sharing. Improvements are welcome. \starttext Electron distribution box diagram \startMPcode picture finalpicture ; finalpicture := nullpicture ; numeric n ; n := 0 ; bboxmargin := 0pt ; ...
5
votes
0answers
163 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
78 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
100 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
129 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
70 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
232 views

How to create MetaPost image for LaTeX

Im trying to figure out how to create this image in MetaPost
26
votes
2answers
665 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
81 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
252 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
168 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
44 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
184 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
109 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
75 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 ...
44
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 ...