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

1
vote
0answers
22 views

How to change glyph in cmcbxti10 Type1 font?

Glyph 111 of Type1 font cmcbxti10 has some protrusions on top and on bottom. Consider the following MetaPost file: prologues := 3; outputtemplate := "glyph%c.eps"; beginfig(1); picture a; a = ...
8
votes
1answer
32 views

How to access north, south, east and west anchors for boxes in Metapost

I am attempting to draw the figure shown in the picture below in Metapost, where it is important that the edge between the boxes starts at the middle of the bottom line of the "perfect" box, and ends ...
2
votes
1answer
48 views

Weird MetaPost output when using PNG

Whenever I try to output PNGs with metapost, I get really bizarre outputs. For reference, I'm using Windows 7 with MiKTeX 2.9. The metapost code I'm using is adapted from the metafont example on the ...
2
votes
1answer
50 views

How does MetaPost compare to MetaFont, featurewise?

I'm interested in possibly using MetaPost to design a font for a writing system of my own invention. One of the appeals of the Meta* languages is MetaFont's "pen" features. However, MetaFont itself is ...
3
votes
1answer
63 views

Coding brachistochrone curve in Metapost

I need a picture like this one (without vector s, start and end) in metapost. The blue curve is an inverted cycloid, the green one is an arc of circle. I have no idea how to do it, so any kind of help ...
2
votes
1answer
99 views

How to flip certain pixels of a QR code?

I would like to modify the data (black square or white square) in a QR code so that to display any graphic feature of my own choice in the code at the expense of sacrificing a certain amount of its ...
2
votes
1answer
31 views

Metapost : bypass errors mpost multi fig

I'm working on a multi fig Metapost file. I'm wondering if it is possible to bypass the error message during running mpost and correctly export the other fig if there is a error in one of them ? ...
2
votes
1answer
37 views

Metapost : input file within macros

I like to have separate .mp files to organize my Metapost projects. But I'm facing this error message when I try to input file within a macro File names can't appear within macros. Even with this very ...
5
votes
2answers
105 views

Hierarchical semantic network

I would like to reproduce a hierarquical semantic network like this (Memory and Learning, from brain to behavior", Mark A. Gluck) My main problem is to add the lateral information in each box. ...
1
vote
1answer
77 views

Graph of sin(1/x) in Metapost

How can one draw the graph of sin(1/x) in metapost, the domain being any interval near 0, say (0.0001, 2)? I tried using for loop. It does not work. Help. beginfig(0) for i=1 upto 100: draw (...
3
votes
1answer
59 views

Metapost suffix to string

Is there a way to convert suffix to string? More specifically, i need to do something like this: def myMacro (suffix a, b) = something.a = fOne(a); something.b = fOne(b); something....
1
vote
4answers
165 views

Drawing a Curve for a Function Diagram

I want to draw the following diagram in LaTeX. How can I do this?
1
vote
1answer
49 views

How to parametrise vardef declarations for suffixed variables with tags?

In metapost, I'm trying to define a macro which provides declarations for various related properties. I have an "object" (xyz in this example) which I'm representing by a suffix on a variable, and ...
3
votes
2answers
74 views

Extend a line to find the intersection time on a path

I'm writing metapost. I have a curve between two points (z0 and z1), and an arbitary point somewhere nearby (z2). I reflect z2 about the straight line z0--z1 to give its opposing counterpart, z3. I ...
4
votes
2answers
110 views

Positioning a vertex directly above another vertex in feynMF

I have been trying to replicate this Feynman diagram with feynMF. (Image from [1]). The first part, the double line, is rather easy, as it is already present in feynMF as the heavy style. For the ...
0
votes
0answers
40 views

ligtable in metafont

I would like to combine three characters, should they appear consecutively, and replace the three with a single glyph (which is pre-defined). Is it possible to use ligtable to do it in a metafont file ...
3
votes
1answer
59 views

How put two glyphs to mp image and get kerning

Is possible to put two glyphs in any place in MetaPost and get kerning between it? for example using Lato-Regular.ttf 'ab' in 1.7cm,2cm and get information kerning 'a' and 'b' or put 'a' in ...
2
votes
1answer
73 views

On flexibility/power of metapost to create graphs

I have the following pgfplots graph embedded in a TeX document that I am happy with. Recently, reading up on metapost, I'd like to try to recreate the graph with it. \begin{figure}[ht] \centering ...
5
votes
1answer
185 views

How to draw dots equally spaced along a path?

Is it possible to draw dots with Metapost so that each dot is separated from its first neighbour by the same distance along an arbitrary path? I do not want their real distance to be regular! Rather, ...
4
votes
4answers
204 views

With which package will I create, in the shortest code, two points with horizontal error bars with overlap region dashed?

Pgfplots? Metapost? Tikz? As I can't make it right now with any of them, I have to choose one of them to study. Which of them? Which has shortest code? Which has best image quality? I don't mind if ...
4
votes
1answer
49 views

What's “logarifm” in Metapost and why I get the error “Undefined control sequence”?

I'm trying the following Metapost sample: http://www.ursoswald.ch/metapost/tutorial/TeXLabels.html With the following code: \documentclass{article} \usepackage{luamplib} \everymplib{input ...
1
vote
3answers
134 views

real MetaPost space

In MetaPost I label something with: Label(1)(percent, ", 269 GiB") (inwards, 0) withcolor (1, 1, 0) ; Unfortionately the space after the comma and the space between 269 and GiB is represented by a ...
3
votes
1answer
107 views

How do I use piechartmp to make pie charts with Metapost?

This is my MetaPost input file: prologues := 3 ; outputformat := "%j-%c.eps" ; input piechartmp; beginfig(1); SetupColors((0.7, 0.7), this, this) ; SetupPercent(this, "%") ; Segment(64, "acc"...
2
votes
1answer
49 views

ps2pdf crahes on MetaPost generated .eps figure

I generated with MetaPost the example in "LaTeX Graphics Companion", 2nd ed., p. 174, above. The eps is generated. The header: %!PS %%BoundingBox: -123 -92 64 43 %%HiResBoundingBox: -122.84787 -91....
1
vote
1answer
120 views

question concerning MetaPost usage

Dear Frank Mittelbach, I bought your book "The LaTeX Graphics Companion", second edition. I have a question concerning a MetaPost example in that book, p. 174 above. I have put this in a file called ...
3
votes
0answers
86 views

Save Feynman diagram files in a subfolder

Suppose one has a simple Feynman diagram, such as the following MWE (which has to be run with -shell-escape, I guess this is to allow compilation to "escape the shell" to run metapost). \...
9
votes
1answer
181 views

draw salts and ions with education purposes

I want to draw some schematic representations of salts for educational purposes. The figure shows a example which can be generated with the metapost code below. I would like to improve the draws in ...
4
votes
0answers
56 views

How to round the corner in a cycle metapost path, when the first/last point is a corner? [closed]

It is useful to have most simple coordinates, to define picture primitives, such as the "fullcircle" expression. When I define a 1x1 rectangle prologues:=3; outputtemplate:="%j-%c.png"; outputformat:...
4
votes
1answer
66 views

MetaPost & gmp package. How to use diacritical signs inside mpost?

First of all, I've read this question: Proper use of the emp package. But... How to use diacritical signs inside mpost? Like ā, ä, ā, ä, ǟ, ḑ, ē, ī... The project was created on overleaf.com. \...
1
vote
1answer
50 views

Can I query the current value of randomseed in Metapost?

Metapost allows you to set a seed for the random number generator, so that you can get a predictable sequence of numbers from uniformdeviate and normaldeviate. I can set it like this: randomseed := ...
0
votes
1answer
167 views

Draw a transparent box (over a grid)

How can I draw a transparent box in Metafont? I would like to have something like the legend in this graph: https://de.wikipedia.org/wiki/Datei:Articlecount_topten_wikipedia.svg. You could say I want ...
4
votes
2answers
377 views

Fonts in math expressions in Metapost

I try to create a Metapost figure that contains math fonts, like: beginfig(1); label.urt(btex $\mathfrak{b}$ etex,(100,0)); label(btex $\mathcal{X}_{\eta}$ etex,(-15,55)); endfig; end ...
23
votes
5answers
684 views

Recreate the sphere in TeX.SX logo

I'm trying to recreate this But looking in this Meta question the only code provided doesn't give that output %!TEX TS-program = xelatex \documentclass{minimal} \usepackage{pst-solides3d} \begin{...
19
votes
8answers
1k views

Compute and draw a convex hull

How can I use TikZ (+ LuaTeX), PSTricks, MetaPost, Asymptote, etc. to draw the convex hull of a set of points specified in no particular order? Here's an example where the convex hull was computed by ...
5
votes
2answers
397 views

Drawing Kano Model

I was wondering if someone can indicate me the easiest way to sketch the following picture. I started using the axis environment from pgfplots package as you can see from my code below, but then I got ...
5
votes
1answer
187 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
253 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
191 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 ...
12
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
96 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; ...
2
votes
0answers
180 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
133 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
130 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 ...
10
votes
9answers
5k 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
118 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
88 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
95 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
88 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
108 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
225 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 ...