Hi, I can't understand why the following code does not work. Could someone help me out here? \starttext \startMPpage draw textext("\convertnumber{r}{12}"); draw textext("\convertnumber{r}{" & "12" & "}"); \stopMPpage \stoptext The first draw statement works perfectly. But the second one throws out errors and complains as follows: .....test.tex: ! Missing number, treated as zero <to be read again> <argument> \number " & "12" & " \romannumerals #1->\clf_romannumerals \numexpr #1 \relax <argument> ... draw textext("\convertnumber {r}{" & "12" & "} "); \meta_process_graphic ...currentMPformat }data {#1 ;}initializations {\meta_f... \page_fitting_stop_command ...eter \c!command {#1} \page_fitting_stop_normal Is there a workaround here? Ultimately I want to replace "12" with a loop variable in MetaPost. Thanks, ~MHB
On Sun, 3 Mar 2019 12:52:53 -0500
Mohammad Hossein Bateni
Hi,
I can't understand why the following code does not work. Could someone help me out here?
\starttext \startMPpage draw textext("\convertnumber{r}{12}"); draw textext("\convertnumber{r}{" & "12" & "}"); \stopMPpage \stoptext
The first draw statement works perfectly. But the second one throws out errors and complains as follows:
Because luatex intercepts and processes \convertnumber{r}{ and tries to pass this result to MP as a string, not the other way around. Alan
This is quite counterintuitive... It also happens if I define a string
variable, use concatenate operator to set its value, and then finally pass
the string to textext macro.
Is there a way to get around this issue?
On Sun, Mar 3, 2019, 1:13 PM Alan Braslau
On Sun, 3 Mar 2019 12:52:53 -0500 Mohammad Hossein Bateni
wrote: Hi,
I can't understand why the following code does not work. Could someone help me out here?
\starttext \startMPpage draw textext("\convertnumber{r}{12}"); draw textext("\convertnumber{r}{" & "12" & "}"); \stopMPpage \stoptext
The first draw statement works perfectly. But the second one throws out errors and complains as follows:
Because luatex intercepts and processes \convertnumber{r}{ and tries to pass this result to MP as a string, not the other way around.
Alan
participants (2)
-
Alan Braslau
-
Mohammad Hossein Bateni