Closed franckpastor closed 10 years ago
Edit: I've forgotten the last line of my program, \end{document}
(as I already said, I can't edit my posts since my browser is not supported by GitHub anymore).
Another typo: it must be read \begin{tabular}{c}
and not \begin{tabular}{cc}
in the examples. It doesn't change anything about the error messages, though.
UPDATE: Inserting a space between \begin{tabular}
and {c}
inside the btex
and etex
flags, and between the two arguments of the \try
macro, make the problematic examples suddenly work. So the following program runs fine:
\documentclass{article}
\usepackage{luamplib}
\newcommand{\try}[2]{\begin{tabular}{c} #1 \\ #2 \end{tabular}}
\begin{document}
\begin{mplibcode}
beginfig(1);
label(btex \try{!} {?} etex, origin);
label(btex \begin{tabular} {c} ! \\ ? \end{tabular} etex, (1cm, 0));
endfig;
\end{mplibcode}
\end{document}
Still, I'm more baffled than ever when it comes to explain this…
There's a bug in parsing routine. I have an idea how to patch, but today I'm so busy. Will be back tommorrow.
It turned out that there was a silly bug in the parsing code. Very shameful to me. Asterisk (*) is a special character in the lua string manipulation. However I overlooked it carelessly. Pushed a patch a moment ago. @franckpastor Thank you very much for testing and finding this bug.
The patched version has removed the problem. Cheers again!
In my country it is said that the only device without defect is the one that has not yet been build. So there's nothing to be ashamed of! ;-)
Hello,
I've just tried to typeset multiline labels inside a mplibcode environment, and I've noticed unexpected behaviors. The following program tries to sum up all the experiments I've made on this subject.
\end{document}
First, I tried to define a LaTeX command
\try
typesetting two lines of text, via atabular
environment. As shown in the comments of the program, this macro works when inserted as\try ! ?
inside alabel
instruction, between thebtex
andetex
flags. But inserted as\try{!}{?}
, it doesn't work.It doesn't work either if I try to insert the
tabular
environment directly in the label, in this formbtex \begin{tabular}{cc} ! \\ ? \end{tabular} etex
. But it does work with the syntaxbtex \tabular{cc} ! \\ ? \endtabular etex
. Inspired by this, I tried to define another macro, the\secondtry
of my example, using this syntax, but it won't work either.All these examples work fine with standalone MetaPost.
I hope I've not been too confusing, but in fact I'm a bit confused by all this. It reminds me the kind of problems you may encounter when using the
gmp
package (it's this package's documentation which gave me the\tabular … \endtabular
trick, by the way), but it seems more complex than this. What could be the explanation?