Questions tagged [metapost]
MetaPost is a programming language (based on Metafont) that produces precise technical illustrations. You can compile MP source from the command line to produce PostScript or SVG or PNG output. Or you can use the luamplib package to include MP source directly in a lualatex document. This tag is compatible with {diagrams}.
549 questions
3
votes
1
answer
61
views
invoking mpost from latexmk
I want to create mps from mp code with mpost.
My mp files always have a single pic only.
On the console I use something like
mpost -interaction=nonstopmode -recorder -s prologues=2 -s 'outputtemplate=&...
5
votes
3
answers
233
views
Plot any real sequence of real variables as in Geogebra and Desmos
Several years ago, I created a GeoGebra script to plot any real sequence of real variables. As you can see from the screenshot, there is a command on the left:
Sequence({(n, 1/n)}, n, 1, M)
which ...
1
vote
0
answers
43
views
Vector tips in 3D also in TikZ [duplicate]
It is a follow in the case 3D for this question: Tips of METAPOST arrows as in TikZ
and it is a curiosity. I have add an answer here making two graphs with Desmos and Geogebra 3D for an answer in math....
5
votes
2
answers
96
views
How can I define a MetaPost command which takes strings as parameters?
How can I define a MetaPost command which takes strings as parameters?
See 10.2 of the MetaPost manual. I wasn't able to follow it for non-decimal (non-numeric) parameters.
\startMPdefinitions
def ...
2
votes
1
answer
189
views
Tips of METAPOST arrows as in TikZ
Considering that I not know a very good manual of METAPOST, is it possible to have the same tips of METAPOST also in TikZ?
\documentclass{article}
\usepackage{luamplib}
\mplibtextextlabel{enable}
\...
3
votes
2
answers
117
views
MWE to compile tree diagrams using the mptrees package
I am trying to compile tree diagrams using the mptrees package (I like this) with LuaLaTeX and luamplib. On TeX Stack Exchange, I found only one question on this topic,
background color with \mpcolor
...
2
votes
1
answer
89
views
How can I include multi-paragraph text (with math) in a MetaPost rectangle as a type area?
I'm trying to create a rectangle in MetaPost and use it as a type area for typeset content — ideally including paragraphs, math, and inline formatting.
I know how to insert a single line of text using ...
3
votes
1
answer
352
views
mcf2graph package: a minimal working code
I am trying to compile a minimal document using the mcf2graph package with XeLaTeX/LuaLaTeX:
\documentclass[border=10mm]{standalone}
\usepackage{mcf2graph}
\begin{document}
\end{document}
! LaTeX ...
7
votes
1
answer
216
views
3D projective transformations on text in LuaMetaFun
I recently asked about performing 2D affine transformations on text in LuaMetaFun: linear transformation of letter in MetaPost.
I want to perform 3D projective transformations on text in LuaMetaFun.
...
2
votes
0
answers
97
views
3D Sphere in MetaPost
I have drawn a top-down view of a sphere in MetaPost.
Is there a way that is native to MetaPost in which I can rotate the sphere, or look at it from a different angle?
This is my current picture:
and ...
3
votes
1
answer
83
views
A basic 3D parametric curve renderer in luametafun
I want to create a basic 3D parametric curve renderer for luametafun.
I have most of the code set up, but I cannot diagnose the error:
luatex warning > mplib: run script: parametric.lua:42: Failed ...
3
votes
1
answer
109
views
making a MetaPost command (with keys) from Lua
I am trying to make a MetaPost command from Lua, as described in https://tex.stackexchange.com/a/746408/319072.
I'm open to any feedback on how to do this more correctly.
Currently it errors.
My goal ...
2
votes
1
answer
164
views
go directly from Lua to MetaPost, bypassing ConTeXt
I have too many context calls which input strings to a .tex file, causing it to exceed the token limit.
I want to go directly from Lua to MetaPost, bypassing ConTeXt.
What is the way to do this from a ...
1
vote
0
answers
83
views
How to not recompile unchanged mfpic graphs each time
I am currently writing a document with a lot of pictures generated using the mfpic package. Using a structure from an answer here, I was able to make my main file render the images in one single ...
8
votes
1
answer
185
views
Parametric curve function in ConTeXt, using Lua. Specifically, how to input the parametric equations
Reference: create a ConTeXt command which takes optional key=value parameters, as well as mandatory parameters
I am trying to make a function which takes a parametric curve and inputs it to a list of ...