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

2
votes
0answers
143 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
110 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
235 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
173 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
233 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
669 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
300 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
273 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
330 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
300 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" ...
75
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
833 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
954 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
320 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
1k 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
694 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: ...
59
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
249 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
455 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 ...
2
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
662 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
403 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
237 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
555 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 ...
86
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
204 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
346 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
384 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
413 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
370 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
557 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
344 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
403 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
657 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
646 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
313 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); ...
24
votes
2answers
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
542 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
582 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
360 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
470 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 = ...
5
votes
5answers
1k views

Commutative diagrams using MetaPost or Asymptote

Xy-pic, TikZ and PSTricks seem to be the graphics packages commonly used to draw commutative diagrams. Having heard about the power of MetaPost and Asymptote, I would like to experiment with them. ...
8
votes
4answers
567 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(): ...
10
votes
1answer
1k 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 ...
38
votes
8answers
5k 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 ...
4
votes
2answers
2k 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 ...
12
votes
3answers
2k 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)); ...