luamplib: global definitions without inheritance

by Scott H.   Last Updated October 09, 2019 15:23 PM

Is there a way of globally metapost macros using luamplib and without enabling inheritance for mplibcode code blocks? It seems possible since it appears that this is what luamplib does when setting the format.

I'm running MikTex on Windows, so the metafun format doesn't work. As such, I'm inputting mp-tool.mpiv for each mplibcode block using \everymplib. This works fine I guess, but it seems pretty inefficient. I looked at the luamplib.cfg file, but this seems only to take latex macros, and thus any metapost definitions would need to be enclosed in an mplibcode block, and inheritance enabled for them to be available in further blocks.

I could simply enable inheritance, but as I understand it this applies globally and so I worry that doing so could lead to errors that are difficult for me to diagnose (I'm just learning).

Equivalently, is there a way to have subsequent code blocks inherit definitions from some given code block, but not others?

Related Questions

luamplib Multiple beginfigures

Updated May 03, 2018 15:23 PM

How is luamplib.cfg to be used?

Updated October 09, 2019 04:23 AM

How can I draw this picture/diagramm?

Updated January 10, 2018 13:23 PM

Lualatex: using verbatimtex in metapost

Updated October 26, 2017 10:23 AM