New answers tagged

4

The brachistochrone is an inverted cycloid. You can plot one in Metapost by imagining that you are rolling a wheel along the x-axis. Here is another cycloid diagram question. prologues := 3; outputtemplate := "%j%c.eps"; beginfig(1); numeric u, r; u = 5mm; r = 4u; path xx, yy, A, B, C; xx = (left -- 8 right) scaled u; yy = (up -- 8 down) scaled u; ...


1

This is an attempt to show that the spirit of what I want can be done by knowledge of basic latex programming. Here is what I came up with: \documentclass{article} \usepackage{tikz} \usepackage{ifthen} \usepackage{intcalc} \usepackage{qrcode} \begin{document} \qrcode[]{Dummy code}%Original code \vspace{1cm} %Corrupted code \begin{tikzpicture}[scale=0.1] ...


1

What you get in the end might not be usable, because errors in a figure may affect the following ones. However, there's a way for calling Metapost without it stopping at errors asking for input: mpost -interaction=batchmode metapost.mp is what you're looking for. No output on the terminal, just to the log file. In case of errors the exit code will be ...


2

You can use readfrom: string rf; def init = forever: rf:=readfrom "var.mp"; exitif rf=EOF; scantokens(rf); endfor closefrom "var.mp"; draw (0,A)--(10,B)--(20,C); enddef; beginfig(1); init; endfig; end.


1

After cfr suggestion I post my own code because Tikz/forest don't works in ConteXt. The function pins(box name)(left "e" or right "d")("characteristic one","characteristic two", ...) do the job. \startMPdefinitions input boxes; \stopMPdefinitions \starttext \startMPcode % best guess at the required colors color mid_blue, dark_blue, laranja, dentro, ...


7

I'm posting this because you indicated an interest in seeing a TikZ/Forest version. Forest is the most flexible and powerful TikZ-based method to draw trees. However, I'm not sure this is compatible with ConTeXt, even though TikZ itself is. Obviously you would not need inputenc, for example, which I'm using here to handle the unicode quotation marks. These ...


2

update With the posted desired picture the original code is not applicable since the horizontal axis in the desired picture is probably log scale. Also, with the picture update, the OP's original logic of putting 1/x in the first coordinate and x in the second coordinate also makes sense. The modified code plot has a horizontal axis in log scale. It also ...



Top 50 recent answers are included