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

2
votes
2answers
433 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 ...
2
votes
1answer
37 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
46 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 ...
2
votes
1answer
25 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 ? ...
3
votes
1answer
58 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 ...
2
votes
1answer
94 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
30 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
94 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
73 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 ...
12
votes
6answers
2k 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. ...
3
votes
1answer
55 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); ...
1
vote
4answers
160 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
43 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
102 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 ...
113
votes
11answers
12k 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 ...
0
votes
0answers
35 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 ...
34
votes
2answers
8k views

Package for typesetting Feynman diagrams (efficiency of `feynmp` and `tikz`)

This question led to a new package: TikZ-Feynman Is there any good package for typesetting lots of Feynman diagrams? My question arise because Feynmp: Circle with three vertices lead me take a ...
8
votes
1answer
1k 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} ...
2
votes
1answer
65 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 ...
1
vote
3answers
131 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 ...
5
votes
1answer
181 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
202 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 ...
4
votes
1answer
47 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 ...
3
votes
1answer
97 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, ...
2
votes
1answer
44 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 ...
1
vote
1answer
114 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
79 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
180 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 ...
3
votes
1answer
187 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 ...
4
votes
0answers
52 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"; ...
4
votes
1answer
61 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
49 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
155 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 ...
3
votes
0answers
407 views

Why no GUI for Metafont? [closed]

Why has no-one ever created a graphical user interface for Metafont? One can easily imagine a system that would allow interactive adjustment of the font parameters, with near-real-time display of ...
4
votes
3answers
371 views

Underline in metauml

\documentclass{article} \usepackage[shellescape]{gmp} \begin{document} \begin{figure} \begin{mpost}[use] input metauml; Class.A("A") ("-instance: A") ("-A()", "+instance(): A"); ...
2
votes
1answer
181 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 ...
4
votes
2answers
358 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
671 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} ...
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 ...
3
votes
1answer
675 views

Where is mp.exe in MikTeX 2.9?

I am a a retired software engineer and a newbie on this site. Please execuse me for the naiveness in my question. I am using Windows, XP and Vista. Other OS's are not affordable to me for now. I used ...
42
votes
3answers
3k 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 ...
10
votes
1answer
195 views

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

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 ...
11
votes
4answers
1k 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) = ...
7
votes
2answers
370 views

btex and etex in luamplib labels

I've been experimenting with METAPOST and in particular with luamplib. I found that I couldn't have tex typeset labels with the btex/etex construct as apparently is possible with straight up METAPOST. ...
5
votes
2answers
393 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 ...
92
votes
3answers
7k 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 ...
6
votes
3answers
3k views

MetaPost pictures in PDFLaTeX

To include MetaPost pictures in a latex file compiled by pdflatex I usually do something like \usepackage[pdftex]{graphicx} ... \includegraphics{filename-without-mps} but this requires all metapost ...
11
votes
1answer
229 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 ...