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

3
votes
3answers
498 views

Drawing system architecture in Latex

I want to draw a system architecture as in the picture below Can you help me?
4
votes
0answers
216 views

Is fine-grained grid control possible? [closed]

I want to make a variety of checklists which are essentially based on a grid layout. I care about having fine-grained control over the exact placement of labels and boxes. I do not care about ...
3
votes
1answer
417 views

How to insert (if possible) an image inside a Metapost figure? (in plain LaTeX environment)

I'd like to insert an image into a Metapost figure (I'm using MikTeX/LaTeX, no Metafun). I hopefully tried (also thanks to Aditya's suggestion) the following Metapost code (compiled with -tex=pdftex ...
3
votes
0answers
159 views

Use fancy page numbering using Metapost graphic

ConTeXt is a great TeX format specially since Metapost is tightly integrated into it that producing page numbering style like is easily implemented if you know Metapost (which I admit I don't, ...
8
votes
1answer
329 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 ...
24
votes
2answers
660 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 ...
1
vote
0answers
70 views

feynmf working but NOT feynmp (FIXED!) [duplicate]

I'm using Mac Mountainl Lion, TexShop (everything worked before on Leopard). This is the first time I use feynmp on Mountain Lion since I upgraded and it's not working. When I use feynmf it seems ...
2
votes
0answers
331 views

File error in non stop mode [closed]

I am trying to make a feynman diagram using feynmf. My code is \documentclass[a4paper,11pt]{article} \usepackage{xcolor} \usepackage{amsthm} \theoremstyle{definition} \newtheorem{exe}{Exercise} ...
6
votes
1answer
324 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 ...
5
votes
2answers
217 views

Is it possible to pass options to mpost.exe using luamplib?

I would like to use the development version of metapost with luamplib. I've switched over the executable mpost.exe which is presumable called by luamplib somewhere along the line. Now, I would like ...
3
votes
1answer
154 views

Picture and Paragraph in Metapost

How to insert a paragraph in Metapost and a drawing below that? This has to be done within a single Metapost block, (i.e) within a single \startMPcode and \stopMPcode block Sample image :
10
votes
1answer
188 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 ...
2
votes
1answer
242 views

Metapost External Figure

I have a metapost file image.mp containing the following lines: beginfig(0); draw p0; externalfigure "/Users/dsg/tex/images/image.png" xyscaled r0 shifted r1; endfig; When I run mptopdf scene.mp ...
7
votes
2answers
175 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 ...
5
votes
1answer
168 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
103 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 ...
3
votes
1answer
108 views

Problem with package gmp (or with xkeyval?)

I use the "gmp" package which allows to insert MetaPost coding (placed inside an mpost or mpost* environment) in a LaTeX source file. In few words, it does approximately the same job as other packages ...
0
votes
1answer
264 views

Metapost crashes when adding tex labels

I am using Miktex 2.9 (64-bit) and TexnicCenter when compiling Metapost (version 1.504). My files will compile fine without labels. When I try to add a tex label, metapost crashes. I NEED HELP PLEASE! ...
23
votes
1answer
682 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 ...
7
votes
1answer
169 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? ...
4
votes
2answers
553 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 ...
7
votes
1answer
273 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 ...
11
votes
1answer
302 views

(ConTeXt MkIV) Text in PiechartMP

So I need to include some pie charts in my document. As I'm using Metapost for all graphics I tried using the PiechartMP Metapost package. But for some strange reason no text shows up, just a very ...
6
votes
1answer
399 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 ...
2
votes
1answer
189 views

Installing and using MPlib

I have been able to find the manual for MPlib on CTAN, but where can I find the C sources for the library itself? Sorry for asking such a basic question.
9
votes
2answers
141 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 ...
10
votes
2answers
276 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.: ...
25
votes
3answers
619 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 ...
20
votes
1answer
3k 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 ...
4
votes
1answer
376 views

Getting “The memory dump file could not be found” when trying to compile mpost file

I am using texmaker with the following mp example: filenametemplate "%j%c.mps"; beginfig(1); z1=(0,0); z2=(10mm,10mm); drawarrow(z1--z2); label.ulft(btex $A$ etex, .5[z1,z2]); endfig; I keep ...
2
votes
0answers
221 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
1answer
360 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 ...
6
votes
1answer
272 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
102 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 ...
21
votes
3answers
1k 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
371 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
261 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
193 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
130 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
307 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
138 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
102 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
224 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
168 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
224 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
592 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
247 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
258 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
317 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
268 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" ...