[luatex] luamplib : btex etex and \mpcolor in macros

Maxime Chupin notezik at gmail.com
Mon Nov 21 16:48:11 CET 2016


Hi,

I want to define LaTeX macros containing some MP code that I want to use in
mplibcode environment :

-----------------
\documentclass{article}
\usepackage{luamplib}
\usepackage{fontspec}

\newcommand\test{draw (0,0) -- (2cm,0) withcolor \mpcolor{red}}
\newcommand\testb{label(btex $x$ etex, (0,0));}

\begin{document}
\begin{mplibcode}
beginfig(0);
\test
endfig;
\end{mplibcode}
\end{document}
-------------------

But there is a problème with \mpcolor (\test):
-------------------
\test ->draw (0,0) -- (2cm,0) withcolor \mpcolor
                                                 {red}
l.14 \end{mplibcode}
-------------------
an a problem with btex etex (\testb) :
-------------------
(luamplib)               ! You can only use `btex' or `verbatimtex' in a
file.
-------------------

Do you understand why ? and do you have a solution ?
All the best,

-- 
Maxime Chupin
Site personnel : http://fougeriens.org/~mc/
Site professionnel : https://www.ceremade.dauphine.fr/~chupin/
<http://www.ceremade.dauphine.fr/%7Echupin/>
adresse libre : chupin at fougeriens.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/luatex/attachments/20161121/1cad19fc/attachment.html>


More information about the luatex mailing list