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.
68
votes
8answers
5k views
Simulating hand-drawn lines
I am working on a project that will have some vector graphics, perhaps using TikZ (or a similar tool). All of the graphics consists of lines, in shades of gray. However, the lines from TikZ appear too ...
59
votes
3answers
2k 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 ...
58
votes
6answers
2k views
Curve through a sequence of points with Metapost and TikZ
This question led to a new package:
hobby
I found Metapost best for drawing complex smooth curves (i.e., Bezier, splines), since you do not have to directly specify Bezier control points. ...
31
votes
8answers
4k views
Is anybody using TeX for business reporting?
Would TeX (LaTeX, ConTeXt, etc) be a good solution for PDF business reports that require dynamically generated graphs and tables?
I need to create financial reports that must look top-notch in their ...
24
votes
3answers
398 views
How do I make a superellipse node shape in tikz?
A superellipse is a kind of closed curve which can be used as a "intermediate" shape between ellipse and rectangle. A parameter can control its "roundness". I find it a pleasant alternative to the ...
23
votes
1answer
403 views
More elegant way to achieve this same camera perspective projection model?
I just finished a camera perspective projection model using TikZ. Although, while I'm pretty satisfied with the result, it took me a lot of time to do it. It's easy to see from the code below that I'm ...
20
votes
2answers
2k 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 ...
19
votes
1answer
187 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 ...
16
votes
3answers
628 views
Why does anyone prefer Metapost?
TikZ (together with its PGF backend) is the most widely used picture drawing tool by regulars here, having more than 50x as many questions as for Metapost, alongside a wealth of documentation and user ...
13
votes
0answers
585 views
Industrial schematics [closed]
I'm investigating if it is possible to generate electrical schematics for industrial machinery with the LaTeX ecosystem. They are quite different from electronic circuits because are developed ...
11
votes
4answers
895 views
A good METAPOST alternative for plotting 3d surfaces
I find METAPOST to be a wonderful software to create 2d charts and figures.
Can you name me a few good alternatives to METAPOST for drawing 3d surfaces?
The crucial feature I'm looking for is the ...
10
votes
1answer
807 views
Embedding MetaPost in LaTeX document
I have problem using the emp package in TeXlive 2010. When I try to use it with empcmds it prints contents to output. If I use emp it parser fails after first character.
Also - how should I import ...
10
votes
1answer
819 views
Package for typesetting Feynman diagrams (efficiency of `feynmp` and `tikz`)
Is there any good package for typesetting lots of Feynman diagrams?
My question arise because Feynmp: Circle with three vertices lead me take a look at the documentation for the feynmf/feynmp ...
9
votes
3answers
1k views
Graphing sine function in MetaPost
I'm trying to reconstruct this picture in MetaPost:
So far came up with this:
draw (-1cm,0)--(3cm,0);
draw (0,1cm)--(0,-1cm);
draw fullcircle scaled 1.8cm;
label(btex $y$ etex,(0,1.2cm));
...
9
votes
1answer
122 views
How to debug METAPOST inlined in ConTeXt? (Or “message” primitive and “loggingall;” in inlined METAPOST)
I have a METAPOST program that works fine with mpost, but fails when I try to run it inline in ConTeXt. In order to debug it, I would like to see the usual METAPOST logging and/or to use the METAPOST ...
9
votes
2answers
103 views
Defining a point on a path by direction of another path
Is it possible to define a point when I have two paths such as:
beginfig(1);
u := 1cm;
path p[];
p0 := (1u,3u)--(2u,2u);
p1 := (2u,0)--(3u,2u);
for i=p0,p1: draw i; endfor;
endfig;
end
so ...
8
votes
2answers
178 views
How to let text flow around irregular-shaped graphics in ConTeXt?
I have some illustrations which I need to scan and place within a document. The illustrations come in various shapes, with no straight edges, and are bound by lots empty white space, e.g.:
...
8
votes
1answer
191 views
How to fix this fancy heading in ConTeXT
I don't know if this is a duplicate or not but we can close it if it is.
I have been trying to learn ConTeXt. I specially love the heading and page number formattings that I see in the documentations ...
8
votes
2answers
451 views
automatic resizing of edges with long labels
I would like to know if there is a way to automatically resize edges when they have long labels. For example, the following code
\documentclass[10pt]{article}
\usepackage{tikz}
...
8
votes
1answer
1k views
pgf/tikz vs metapost
Can the experts here comment on the pros and cons of these two languages? I have been using metapost for a long time and I was wondering if I should learn pgf/tikz also.
How does both languages ...
8
votes
4answers
481 views
Error in PS generated by MetaUML
If I use following example (or any other):
input metauml;
beginfig(1);
Class.A("Point")
("+x: int",
"+y: int") ();
Class.B("Circle")
("radius: int")
("+getRadius(): ...
8
votes
1answer
442 views
Calculate font metrics for glyphs inside MetaPost figures
I'm looking for a way to calculate the ascent and descent of a character glyph after it has been scaled and then drawn into a MetaPost figure.
With TikZ, I can do this fairly easily by performing ...
8
votes
1answer
175 views
Should I have changed MetaObj or is there a better way?
I want to use MetaObj to arrange some diagrams. I have some nice, color MetaPost drawings of components for my diagrams.
I create the picture objects like this:
input metaobj;
def picphone =
...
7
votes
3answers
304 views
Which plotting tool is more likely to stay stable in the basics: MetaPost, PStricks or pgfplots?
I have been looking at the three (major ?) tools---MetaPost, PStricks or pgfplots for plotting data together with LaTeX. My experience is this:
MetaPost code can demand lots of lines for simple ...
7
votes
2answers
113 views
Why won't this Metapost while loop terminate?
The following loop fails to terminate and I have no idea why. I've either violated some syntax rule, there's an issue with the self reference in n:= floor (n/2);, or I've missed something ...
7
votes
1answer
132 views
How to draw dash-dotted curves using MetaPost?
Is it possible to (easily) draw dash-dotted curves in MetaPost, i.e. curves that alternate between a dash and a dot?
For either dashed or dotted curves, I use the draw command and end it with dashed ...
7
votes
1answer
89 views
Metapost intersectiontimes
In the code below intersectiontimes is not giving an intersection point of the two paths. Could anyone provide some guidance on how to find (and mark) the intersection points of the curves below? ...
7
votes
1answer
137 views
Get all intersection points in MetaPost
On MetaPost, I can use p intersectionpoint q to get a intersection point. But It will only return one point. How can I get all intersection points?
6
votes
1answer
471 views
How to generate EAN barcodes with TikZ or MetaPost?
I'm looking for way to generate EAN barcodes with LuaLaTeX. I'm aware of this question; the solution to that needs pstricks, which won't work easily with LuaLaTeX (I don't want to install GhostScript ...
6
votes
3answers
701 views
mpgraphics: Unable to compile using MikTex on Windows
This is an example from mpgraphics package documentation:
\documentclass{article}
\usepackage{mpgraphics}
\begin{document}
\begin{mpinline}
draw (20,20)--(0,0)--(0,30)--(30,0)--(0,0)
\end{mpinline}
...
6
votes
2answers
139 views
Errors Mpgraph in ConTeXt
I need to put some bar charts in a ConTeXt document. I'm using mkiv from TeX Live 2011, under Gentoo GNU/Linux. I tried using Gnuplot but I found mpgraph suits better my needs.
I'm using this TeX ...
6
votes
1answer
141 views
Type phase symbol in ConTeXt, like LaTeX steinmetz package
I am trying to create an electrical phase symbol in ConTeXt like that produced by the \phase{} command from LaTeX's steinmetz package.
Here is what the symbol looks like:
Is there something out ...
6
votes
1answer
149 views
How to install metafun?
How can I install the metafun metapost macros?
I have tried to tlmgr install metafun, but it cannot find it. Also a search for “metafun” on ctan yields only a introductory tutorial on ConTeXt, in ...
6
votes
1answer
174 views
How can I use german umlauts in MetaUML
I have the following files:
metaumlfile.mp:
input metauml;
beginfig(1);
Class.Benutzer("Benutzer")
()
("+üben(): void");
drawObjects(Benutzer);
endfig;
end
...
6
votes
1answer
190 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
1answer
116 views
Metapost - Boundary box
I want to make a series of images with Metapost and Context. I want the height and width of the images to be fixed ( like a frame ) and center the picture drawn with Metapost inside that frame. So, is ...
5
votes
1answer
73 views
Problems with mfplain
When I read the file mfplain into Metapost, I get about a dozen error messages complaining about redundant and inconsistent equations. It's hard to believe that there is really anything wrong with ...
5
votes
1answer
157 views
ConTeXt MarkIV: Pagenumber in layer not working
I want to put pagenumber and navigation into a layer, but the counter for pagenumber is not working. Here's a minimal example:
\usemodule[graph]
\usesymbols[nav]
\setupsymbolset[navigation 1]
...
5
votes
1answer
448 views
+500
OpenType fonts for Metapost Labels
Is it possible to use OpenType fonts in MetaPost labels?
I use MiKTeX 2.9. I hoped something like mpost --tex=dvilualatex <myfile>.mp might work, but no luck.
Suggestions?
I tried this, but ...
5
votes
1answer
75 views
MetaPost label positioning based on the text baseline
We are all familiar with MetaPost labels:
label.top(btex $a_t$ etex, z0);
The problem with the above is that the positioning is based on the entire label, including the subscript.
How do I ...
4
votes
2answers
885 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 :
...
4
votes
2answers
1k 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 ...
4
votes
2answers
372 views
What tool was used to generate these technical diagrams?
I was reading a paper or Computed Tomography, and I found these two nice diagrams:
And I was wondering, what tool was used to make them. I've worked with Tikz for example, but I believe it would ...
4
votes
1answer
232 views
Creating a grid which fills available text area on a page in ConTeXt?
I have some pages containing only a small paragraph at the top and a large empty area where readers can add notes or draw, e.g.:
_______________
| |
| This is some |
| text in a pa- |
...
4
votes
1answer
98 views
How to fine-tune the vertical placement of characters in ConTeXt?
I need to insert a dot symbol, such as “•” or a METAPOST circle into my document, at different heights between the baseline and top of characters, like this example:
_____ _____ ...
4
votes
1answer
173 views
Non-intersecting lines on class diagram
\documentclass{article}
\usepackage[shellescape]{gmp}
\begin{document}
\begin{mpost}[use,mpsettings={input metauml;}]
Class.A("A")()();
Class.B("B")()();
Class.C("C")()();
Class.D("D")()();
B.n = ...
4
votes
1answer
79 views
Context - Error creating boxes in loop
The following code creates an array of boxes to represent an array.
\startMPinclusions
input boxes ;
\stopMPinclusions
\starttext
\startluacode
function createGraphic(k,c,indH)
local i=1
...
4
votes
1answer
150 views
How to include a .mp file into a LaTex file?
I used metagraf to create the figure I wanted and saved it as a .mp file and I wanted to use the command "includegraphics{**.mps}" to include the corresponding figure but it said wrong, no such file ...
4
votes
1answer
156 views
metauml: Realization link doesn't work
\documentclass{article}
\usepackage[shellescape]{gmp}
\begin{document}
\begin{figure}
\begin{mpost}[use]
input metauml;
Interface.A("Interface")
();
A.info.iAttributeStack.top := 0;
...
4
votes
1answer
329 views
How to use MetaPost with TeXlipse?
I would like to to use TeXlipse, MetaPost and MetaUML to generate requirements specifications. The problem I have is that I haven't found an easy way to incorporate MetaPost in TeXlipse build. There ...

