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

learn more… | top users | synonyms

0
votes
0answers
91 views

Sushi and other diagrams [closed]

I found this nice peace of art work on 9gag. There is a lot of those illustrations on 9gag. So I wondered how are they made. I am curious, is it possible to make this in LaTeX? All right, I am sure ...
5
votes
1answer
64 views

Why doesn't metapost know about the path in my feynmp code?

I'm trying to use FeynMP to draw a Feynman diagram exactly like this but with a photon line inside the circle. This code works perfectly to create the diagram above: \fmfleft{i} \fmfright{o} ...
6
votes
2answers
95 views

How does the angle key from arrows.meta TikZ library work?

The title says it all. How does angle=<angle>:<first dimen> <second dimen> works. More exactly, what do the first length and the second length mean? \usetikzlibrary{arrows.meta} ...
4
votes
0answers
66 views

Code to preview metapost output?

Does anyone out there have a cute way of previewing images generated by MetaPost? As far as I can tell, after making the .mp file there is a bit a process for viewing the file. I figure there aught to ...
11
votes
5answers
2k views

How one can draw 405 degree angle in learning material?

I would like to know how one can draw teaching material of trigonometry in LaTeX? Namely, I was looking how to draw 405 degree angle i.e. unit circle, a line segment to the circumference and a spiral ...
3
votes
2answers
50 views

Problem with `plot` option for `gdraw` in MetaPost

I have the following problem with MetaPost and graph package for it. So I have a source: input graph; beginfig(1) draw begingraph(16cm, 2cm); gdraw "a.txt" plot "+"; endgraph; ...
0
votes
0answers
46 views

Metapost Labels Errors!

This is my Metapost code that I wrote on Sublime Text on Windows 7: filenametemplate "%j-%3c.mps"; verbatimtex %&latex \documentclass{article} \usepackage{amsmath,amssymb} \begin{document} etex ...
2
votes
0answers
81 views

Yannis's yinit font (gothic initials) and metapost

I am trying to produce EPS standalone files for all Gothic Initials from the Yannis'metafont sources recently reissued by Karl Berry for TL2014 (texmf-dist/fonts/source/public/gothic/). I run ...
4
votes
1answer
103 views

Metapost error related with ConTeXt

I try to reuse this code from fpast (Generating Random arrows in tikz) in context but I found a error message associated with the freelabel() function. If I try to add the labels with label() function ...
3
votes
1answer
110 views

vectors with marks for forces representation

In the first approach to teaching forces are presented to students diagrams with various forces and asked to them to group the forces according to their orientation, direction and magnitude. I often ...
8
votes
8answers
722 views

Drawing minimal xy axis

can anybody help me to draw this minimal example of an xy axis? I couldn't find anything similar on the forum. The axis should be black but the grid behind it a shade o gray, dashed. It would be ...
0
votes
0answers
68 views

How include MetaPost from ConTeXt to LaTeX?

I found ConTeXt document and I get file with MetaPost like this : % language=uk % author : Hans Hagen, PRAGMA ADE, NL % license : Creative Commons, Attribution-NonCommercial-ShareAlike 3.0 ...
3
votes
2answers
70 views

Bad 'numberprecision' has been ignored

I just read that it's possible to run METAPOST with a binary numbersystem (mpost -numbersystem binary) and that it's possible to specify the number of bits by assigning a value to the variable ...
4
votes
1answer
83 views

parametric overlay in context

I am trying to make something like excel databars in context TABLE enviroment. I have created overlay, that should draw the databar, but I can't figure out, how to pass data into that overlay. Is it ...
2
votes
0answers
47 views

Semantics of Intersections in MetaPost/MetaFont

I may have discovered a bug in MetaPost and MetaFont but before I report it, I'd like to make sure it really is a bug. From an intuitive point of view I'd expect that if two paths have an ...
0
votes
1answer
38 views

Metapost won't compile from the command line

I just downloaded MiKTeX and started to learn Metapost. I created the text file example.mp and went to cmd with command "mpost example" and it says: "I can't open file 'example' " I know that it ...
3
votes
1answer
123 views

Milestone graphic in TikZ with rectangles

Within the forum I found this nicely designed milestone / timeline graphic: Milestone graphic in TikZ Regarding this graphic I would like to make two adaptations: How can I adjust the code in order ...
16
votes
4answers
409 views

How to draw random simple closed smooth curves but with the same perimeter?

I want to draw some random simple smooth closed curves. Each smooth curve must have the same perimeter but different area. See the following figure to illustrate what I meant clearly. Each smooth ...
1
vote
1answer
83 views

metapost annotation

Metapost is a powerful tool for drawing, but not sure if it's more easier than tikz for annotation. Is it possible to draw this annotation graph with metapost? tikz code: ...
5
votes
1answer
66 views

Incomplete trace of a function

Why the curve is not drawn to the point x1 ? \starttext \startMPcode xmin := -1; xmax := 5; ymax :=4 ;ymin:=-4; u := 1cm; pickup pencircle scaled 1pt ; a:=2-sqrt(3); b:=2+sqrt(3); def ...
5
votes
1answer
39 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
32 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 ...
0
votes
0answers
39 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
272 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 ...
4
votes
2answers
63 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 ...
7
votes
1answer
252 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 ...
5
votes
1answer
81 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 ...
2
votes
0answers
25 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 ...
20
votes
3answers
754 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: ...
4
votes
0answers
82 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
49 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
124 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 ...
4
votes
1answer
173 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
234 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
63 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} ...
11
votes
1answer
164 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
80 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 ...
4
votes
1answer
161 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
75 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
68 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
258 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
955 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
70 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
87 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
113 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
68 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
110 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
628 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) = ...
4
votes
1answer
126 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 ...