Tagged Questions

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
85 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 ...
12
votes
2answers
258 views

Is there another better way to have a region with gradient opacity?

My objective is to get a region with gradient opacity. In the following MWE, the region is a quarter of a disk on the top a bird. I made the gradient opacity by partitioning the sector into 45 ...
6
votes
2answers
175 views

Using negative coordinates in EPS file with XeLaTeX

I've run into inconsistent behavior with XeLaTeX and EPS files with negative coordinates. The wrapping block for the figure is calculated correctly; however, the content of the figure is misplaced ...
2
votes
0answers
46 views

Context mptopdf problem [closed]

I've a problem with the following file input graph u=0.5cm; beginfig(0); draw dashpattern(on 5bp); picture pa; pa=currentpicture; currentpicture:=nullpicture; draw dashpattern(on 5bp off ...
8
votes
2answers
190 views

LuaLaTeX and MetaPost

Is there a LuaLaTeX equivalent of \startMPinclusions input mpfile; \stopMPincusions in ConTeXt? That is, if I have \documentclass{article} \usepackage{luamplib} \begin{document} ...
3
votes
1answer
114 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 ...
0
votes
0answers
76 views

click button and next picture will be shown

I would like to create presentation and export to GIF, for example. I have three files: obr1.mp, obr2.mp, and obr3.mp (which is my pictures drawn). I want have .tex file, where I could press space ...
45
votes
13answers
2k views

What is the simplest way to draw this triangle exactly?

I want to see how we can exactly construct the following diagram as simple as possible. It means that the manual calculation should be avoided. Note that the angle marks attached to angles ...
5
votes
2answers
287 views

graph of function with metapost

I have to create graph of function 3x^4 − 11x^3 + 12x^2 − 4x + 1 ; interval <0,1;1> . I have just func.mp input gjktc.mp; u:=1mm; path p[]; beginfig(1); draw (0,0)--(10u,10u); draw ...
6
votes
1answer
242 views

Full colored Triangle and Circle in Metapost

The question may be trivial, but I need your help, to draw a full colored triangle and circle (where the triangle will be inside the circle). Here is my file pic_1.mp: input gjktc.mp; u:=1mm; ...
3
votes
1answer
114 views

Metapost and ConTeX

I am completely new to ConTeXt and have just started to experiment with writing metapost directly within ConTeXt. My problem is that some of my existing metapost files call other metapost files which ...
7
votes
1answer
168 views

ConTeXt+MetaPost: Non-conflicting random background and foreground colours

Overview Looking to create a page that has a random (and non-consecutively repeating) background colour with titles that are also random. Problem The code has two problems. First, generating a ...
6
votes
1answer
213 views

MetaPost: Randomly variably thick curves

Overview Looking to emulate the following sinusoidal wave having random variations in both its filled and outline thickness: The wave has two parts: a variably thick filling and a variably thick ...
6
votes
1answer
182 views

MetaPost: Non-uniform periodic tessellations

Overview Looking to create backgrounds that have regular polygons aligned to a grid. Problem The space between the polygons varies, even though the radius for the polygons has been calculated in ...
8
votes
2answers
226 views

MetaPost: Adjust colour value (brightness/luminosity)

Background In MetaPost, colours can be lightened or darkened by calling the transparency function. However, this allows other colours to show through, which isn't necessarily desirable all the time. ...
5
votes
1answer
105 views

ConTeXt: Randomly lighten or darken a colour within a threshold

Overview Looking to randomize the colours of squares of a checkerboard so that some are slightly lighter and some are slightly darker, relative to another colour. Problem The following sets a base ...
5
votes
1answer
163 views

Faster Metapost SVG Output with TeX?

I am generating some diagrams with METAPOST. I need the output in SVG format. My labels are generated by calls to LaTeX via Tex.mp and its TEX METAPOST definition (also called a macro). My ...
0
votes
0answers
155 views

Im trying to set up a graph but keep gettin error “isolated expression”

beginfig(1); numeric u; path xaxis,yaxis; Scale: 1=u u=0.5in; yaxis= (0,-4.1u)--(0,4.2u); xaxis= (-4.1u,0)--(4.2u,0); pickup pencircle scaled 1pt; drawarrow xaxis; drawarrow yaxis; pickup pencircle ...
48
votes
6answers
2k views

How to automatically draw tree diagram of prime factorization with LaTeX?

I want to have a simple interface to automatically draw tree diagrams of prime factorization. For example, by invoking the following code, \PrimeTree{36} \PrimeTree{90} \PrimeTree{112} ...
13
votes
2answers
506 views

How to draw spherical triangles?

Does anyone know how to draw spherical arcs and spherical triangles using LaTeX?
9
votes
1answer
265 views

What programmable drawing tool(s) can solve how to fill a region with a path

I've recently become interested in computer numerical control (CNC), and have been considering using METAPOST in a CNC work-flow (using pstoedit to convert .pdf (or .mp) files to G-Code). The extant ...
7
votes
1answer
290 views

Wrong TFM generated by mf2pt1 in TeXLive 2013

I need to generate a font from METAFONT file. I used mf2pt1 and generated PFB file and TFM file, but TFM file was incorrect. I tried to generate TMF file of cmr10.mf by mf2pt1, then looked at ...
10
votes
6answers
1k 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. ...
7
votes
2answers
260 views

Putting circle into a right triangle

I need help with MetaPost in putting circle into the bottom left corner of a right triangle. Here is my work: beginfig(1) pair A,B,C,D,E,F,O,G,H,I,J,AA, BB, CC, HB, HF, DD, EE,FF,h; ...
3
votes
1answer
189 views

Help with the geometry figure

Can someone help me with creating such a figure in metapost?
3
votes
3answers
609 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
311 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
556 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
183 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
377 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 ...
28
votes
2answers
1k 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 ...
2
votes
0answers
74 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
452 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
456 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
234 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
171 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
209 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
307 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
201 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
197 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
109 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
146 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
325 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
886 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
197 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
656 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
335 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
342 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
487 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
236 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.