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

4
votes
3answers
646 views

Drawing system architecture in Latex

I want to draw a system architecture as in the picture below Can you help me?
5
votes
1answer
30 views

Anchor macro for paths

I am trying to build a macro to assign anchors for a given path. This is what I have: beginfig(1); def anchors(expr p) = pair p.n, p.e, p.s, p.w; p.n := .5(ulcorner p + urcorner p); p.e := ...
0
votes
0answers
27 views

Metapost - ! I can't find file `mpIdZQs7.aux'

I try to compile a simple metapost graphic with a TeX label (for subscript). The problem is that when I try to run 'mpost --tex=latex file.mp' I get an error. Looking through log files it seems that ...
18
votes
3answers
629 views

Automatically generate graphics which shows light diffusion on a rough surface

I just want to make an image like this (using tikz or pstricks) of light reflexion and diffusion: What I am interested in is, how this can be done (semi)-automatically via tikz or pstricks: ...
0
votes
0answers
27 views

Unexplainable MetaPost Errors with drawarrow & math

I've run into some trouble with MetaPost's unhelpful errors, and cannot figure out why the snippet below kicks the following error: ! Extra tokens will be flushed. to be read again ...
2
votes
2answers
132 views

Hypersphere inscribed within hypercube

Let's consider a hypersphere of radius r inscribed in a hypercube with sides of length 2r. Than take the ratio of the volume of the hypersphere of radius r to the hypercube with side length l = 2r. We ...
8
votes
2answers
237 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. ...
26
votes
2answers
2k views

Milestone graphic in TikZ

This question led to a new project for a TikZ based solution: timeline The author of the original artwork has posted his METAPOST based library: blueprint How could I implement a ...
7
votes
1answer
150 views

Concentric Cylinders with tikz

I am trying to draw two concentric cylinders with tikz to show the change in volume with respect to radius, while the height remains fixed. The left ilustration below is the first drawing, where the ...
2
votes
1answer
33 views

How to import metapost to .tex properly and how to do it without importing

I have read several questions related to metapost and latex here on TEX SE, but I still cannot solve my own problem. So it is a very basic problem. I am trying to include a metapost graphic in my ...
5
votes
1answer
65 views

How to handle dependencies in METAPOST

I am working on the Blueprint package, a graphical toolkit for project managers and system designers, and time has come to tidy up the library design. There is several modules in the library and I ...
5
votes
2answers
2k views

metapost and pdflatex

I'm trying to use figures created with metapost in a TeX document compiled with pdflatex, but I have some troubles. I did as advised here, but it fails! My code is this : ...
2
votes
0answers
20 views

Different results of running metapost on two systems

I have a problem with a metapost and LaTeX file. I use LaTeX and metapost on two different macs, both with the same version of OS X (10.9.5) and both with, as far as I can tell the same installation ...
4
votes
0answers
65 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
41 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
81 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 ...
7
votes
0answers
113 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
131 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
164 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
53 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} ...
3
votes
1answer
62 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 ...
25
votes
3answers
3k views

Create a symbol font from SVG symbols

Is it possible to create an own scalable font from a set of symbols (~700), all in SVG format. All of them are symbols (like Zapf Dingbats), so there would be no need for special settings like ...
3
votes
1answer
118 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); ...
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 { ...
1
vote
0answers
68 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?
2
votes
1answer
202 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 ...
5
votes
0answers
62 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= ...
20
votes
6answers
824 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 ...
77
votes
3answers
4k views

Fundamental differences : PSTricks, TikZ/PGF and others

OK, since this is a pretty vague and subjective question. I need to set up some borders around the discussion that I intend to benefit from. But before anything, I certainly do NOT want to excite the ...
4
votes
1answer
53 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 ...
90
votes
8answers
9k views

Simulating hand-drawn lines

I am working on a project that will have some vector graphics, perhaps using TikZ (or a similar package). All of the graphics consists of lines, in shades of gray. However, the lines from TikZ appear ...
3
votes
1answer
76 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. ...
7
votes
1answer
297 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 ...
11
votes
1answer
86 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 ...
1
vote
2answers
477 views

Metapost label based on variable value

I want to label a scale based on a variable value and I wrote a metapost code like this. $ := 1; for i = -.3cm step .6cm until 3.6cm: label.bot(str$,(i,-3.7cm)); $ := incr($); endfor; It ...
3
votes
1answer
49 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
99 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
483 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) = ...
13
votes
2answers
528 views

How to draw spherical triangles?

Does anyone know how to draw spherical arcs and spherical triangles using LaTeX?
3
votes
1answer
105 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 ...
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 ...
6
votes
0answers
106 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 ...
5
votes
2answers
234 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
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 ...
8
votes
2answers
235 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
95 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 ...
4
votes
1answer
71 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 ; ...
3
votes
1answer
59 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 ...
7
votes
3answers
234 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 ...
8
votes
3answers
419 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 ...