I am trying my hand at Metapost using luamplib. Any time that I try to include a metapost conditional I get the errorĀ ! Undefined control sequence. I have no idea what I am doing incorrectly. Below is a minimal example. It compiles fine without the if .. fi statement.
\documentclass[letterpaper]{article}
\usepackage{luatextra}
\usepackage{luamplib}
\begin{document}
This is a test.
\begin{mplibcode}
beginfig(1);
numeric ux, uy, r;
ux = 1in; uy = s*1in;
s = uniformdeviate(2);
r = uniformdeviate(360);
if (r<90):
label("Acute",(0,0));
else:
label("Obtuse",(0,0));
fi;
pair A, B, C;
A = (0,0) rotated r; B = (1ux, 0) rotated r; C = (0, 1uy) rotated r;
path triangle;
triangle = A--B--C--cycle;
draw triangle;
label("A",A);
label("B",B);
label("C",C);
boolean q;
q:= true;
endfig;
\end{mplibcode}
\end{document}
Being new to Metapost, I may be doing the conditionals incorrectly,
but it is hard to find examples on the Internet. The log file is
attached.
Jason T. Stein, B. Sc. (1998), B. Ed. (2002)
metapost_test.log
Description: Binary data
