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

23
votes
3answers
2k 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 ...
3
votes
4answers
416 views

How can I draw a right angle with MetaPost?

I want to use MetaPost to draw a right angle BAC. A = (20,30), B = (0,0), the top of the angle is point A. How can I compute the coordinate of point C?
7
votes
1answer
327 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?
2
votes
1answer
199 views

Code for reading Metafont definitions

I need some C code to generate Bezier curves from Metafont source code. Ideally, I'd like to have a C/C++ function with the following specifications: Input: an array of text strings (the lines in the ...
4
votes
1answer
144 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: _____ _____ ...
3
votes
1answer
359 views

How to change the font for metauml?

I am using the emp package in order to use metauml for drawing UML-models. So far so good. this is a minimal example: \documentclass{scrartcl} \usepackage{emp} \ifx\pdftexversion\undefined ...
2
votes
0answers
148 views

no output with \usepackage{emp} [closed]

I'm trying to embed MetaPost graphics inside a LaTeX file using the emp package, with pdflatex. When I include the line: \usepackage{emp} %part 1 pdflatex doesn't produce any output (it says 0 ...
5
votes
1answer
114 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 ...
6
votes
1answer
239 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] ...
6
votes
2answers
175 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 ...
4
votes
1answer
239 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 = ...
1
vote
1answer
693 views

METAPOST (mptopdf) complains: can't open file `mp-tool'

I just did a clean install of Mountain Lion and MacTeX 2012. Now I can't compile my .mp files anymore using the "mptopdf" Terminal command. This is the output I get: MPtoPDF 1.4.1 : running 'mpost ...
4
votes
1answer
311 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
2answers
279 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"); ...
3
votes
2answers
350 views

Too many compiles when using latexmk with mpgraphics

\documentclass{article} \usepackage{mpgraphics} \begin{document} \begin{figure} . \label{fig:a} \caption{a} \end{figure} \begin{mpinline} draw (20,20)--(0,0)--(0,30)--(30,0)--(0,0) \end{mpinline} ...
3
votes
1answer
311 views

Multiple lines of TeX output between btex and etex in METAPOST

As you know, this is how to create labels in METAPOST: label(btex some text etex, (0,0)); How do I place text on multiple lines -- in this case such that "some" appears on one line, and "text" ...
76
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 ...
13
votes
0answers
859 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 ...
6
votes
3answers
976 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} ...
5
votes
1answer
331 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- | ...
12
votes
4answers
2k 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 ...
2
votes
1answer
720 views

How to draw an optical lattice

I want to make in TikZ or MetaPost an image of a two dimensional lattice with oscillations like these: (Source: http://www.uibk.ac.at/th-physik/qo/research/opticallattices.html) or this one: ...
60
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. ...
6
votes
1answer
258 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 ...
3
votes
1answer
460 views

Draw rounded cube

How can I draw a rounded cube using Asymptote, Metapost or anything that produces high quality graphics? A rounded cube is for example the boundary of the minkovski sum C+S where C=[-1,1]^3 and S is ...
4
votes
1answer
2k views

feynmf with pdflatex [duplicate]

Possible Duplicate: How to use kile with feynmf or feynmp? I would like to use feynmf, or better feynmp, with pdflatex. My first idea was to replace all the files file.[0-9]* which are ...
7
votes
1answer
687 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 ...
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 : ...
1
vote
1answer
417 views

Metapost compiler freezes when I add labels

I installed texlive-metapost in Linux Mint (similar to Ubuntu), and each time I compile a MetaPost figure which contains a label, the compiler finishes the job, but the picture is not saved as ps, ...
2
votes
1answer
241 views

Metapost - Color portions of a curve with different colors

I searched a bit and didn't find something that relates to this. Suppose I created a closed curve in Metapost with the command p:=z_1..z_2..z_3..cycle. Is it possible to color pieces of this curve ...
4
votes
0answers
564 views

Creating a colored bar chart using MetaPost or pgfplots [closed]

Right now I have this: input graph input sarith beginfig(1) draw begingraph(3cm,2cm) gdata("data1.d", v, path p; augment p (v1,0); augment p (v1,v2); augment p (v1 Sadd ...
89
votes
8answers
8k 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
209 views

Using Latexmk with mpost [duplicate]

Is it possible to tell latexmk to execute mpost paper.mp after each compilation run if paper.mp has changed? I tried to create a custom latexmkrc rule: add_cus_dep('mp', '1', 0, 'mpost'); sub mpost ...
7
votes
3answers
351 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 ...
3
votes
1answer
396 views

graphing problems in metapost

I have some data as follows (first and second columns) in the file mydata.d that I want to graph: 8 98826 year 2008 9 104925 year 2009 10 140153 year 2010 11 178414 year 2011 As we have ...
11
votes
1answer
2k 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 ...
1
vote
2answers
435 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 ...
0
votes
1answer
385 views

metapost macro for drawing filled circle not working

The following macro draws a black circle only on the first invocation. The remaining three circles are unfilled. Where am I going wrong? def big(expr z) = begingroup save a; path a; a = fullcircle ...
6
votes
1answer
576 views

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 ...
1
vote
1answer
358 views

Tutorial for emp package

I really like the idea of the emp package - you write your MetaPost sources directly in LaTeX source. However, I can't make this package work. I read the official readme, but to no avail. Some of my ...
2
votes
2answers
413 views

Change background color in metapost

I have a metapost diagram using colour that when displayed in normal latex (with a white background) works well. Now, I want to add the same diagram to a presentation done in Beamer (Warsaw theme) ...
0
votes
1answer
672 views

Metapost use venn package

I use TexShop, and I have successfully compiled an example which uses metapost code directly in LaTeX code ( by running pdflatex, then metapost, then finally pdflatex again). this code uses mpfic ...
5
votes
2answers
678 views

How to use mplib directly from lua?

I am trying to plot some graphics calling mplib from lualatex. The 'standard' way is the use of luamplib package and mplibcode environment. I was wandering, is there a way to call mplib from lua ...
3
votes
1answer
318 views

mirror figure in metapost

With a valid figure, I would like to always produce the mirror figure. To clarify my thought, I'm looking for some tricks to do something like: beginfig(1); ... endfig; beginfig(2); ...
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 ...
9
votes
2answers
553 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} ...
9
votes
1answer
605 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 ...
4
votes
1answer
363 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 ...
2
votes
1answer
472 views

MetaUML — generate image as output

I'm planning to use MetaUML to automatically generate UML diagrams (as images) and display them. I found that there is an utility, mptopdf, that helps generating the output as a PDF file: mptopdf ...
8
votes
1answer
205 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 = ...