lualatex / luamplib

generic TeX package - including MetaPost code in LuaTeX documents
http://ctan.org/pkg/luamplib
16 stars 11 forks source link

Spurious files when combining luamplib and the mpcolornames package #45

Closed franckpastor closed 9 years ago

franckpastor commented 10 years ago

Hello,

I've got something strange (though seemingly harmless) happening when I load the mpcolornames MetaPost package inside a mplibcode environment. For example, if I typeset this simple code with LuaLaTeX:

\documentclass{article}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
  input mpcolornames;
\end{mplibcode}
\end{document}

Five auxilary files are then produced. They are all completely empty. Their names are: luamplib_input_mpcolornames_mp, luamplib_input_mpcolornames_spec_dvipsnam_def_mp, luamplib_input_mpcolornames_spec_svgnam_def_mp, luamplib_input_mpcolornames_spec_x11nam_def_mp, luamplib_input_mpcolornames_spec_xcolor_sty_mp,

Yet stranger, each of them is dated from 28/07/11!

Besides that, the mpcolornames package works as expected. Maybe this behavior could be reproduced with another package, but I don't know of any yet, and it is something I didn't noticed up to know although I use mpcolornames very much.

Any idea of what is happening?

I'm using the version 2.6.1 of luamplib with MacTeX 2013 (i.e. TeX Live 2013 on Mac OS X).

dohyunkim commented 10 years ago

That's exactly what luamplib is expected to do.

Those strange files are cache files. If they are empty, it means that their original counterparts do not contain btex...etex or verbatimtex...etex commands. The modification time of cache file is intentionally synced with the original file, so that luamplib can detect whether the original file has changed or not since the creation of cache.

If you don't want to see cache files in the current working directory, create a file named luamplib.cfg under the directory ~/texmf/tex/luatex/luamplib/ (the directory might have to be different on your system, as I am using vanilla TeX Live, not MacTeX), with a line similar to the following:

\mplibcachedir{~/somewhere/writable/directory/luamplibcache}

The directory indicated here should be existant in advance and writable.

luamplib.cfg can also contain other luamplib settings such as \mplibnumbersystem or any other macros defined by users. luamplib will read the file at the end of package loading, if it exists.

franckpastor commented 10 years ago

OK, but if it is what luamplib is expected to do, how come that these cache files appear since only recently? (Version 2.6.0 ou 2.6.1, I guess). They did not appear at all before. If they were created, then they were located somewhere else.

dohyunkim commented 10 years ago

OK, just pushed a new version to github repo. Now the default directory for cache files is not CWD, but $TEXMFVAR/luamplib_cache, which on my system is ~/.texlive2014/texmf-var/luamplib_cache. I have tested this update on my Mac with TeX Live 2014 pretest. So cannot sure whether it will work on Windows or with other TeX distributions. Hope so with fingers crossed.

franckpastor commented 10 years ago

It seems to work fine with MacTeX 2013 anyway, no problem up to now. I think it was the right decision, I don't know any (La)TeX users who are fond of the storage of auxiliary files inside their working directory, however necessary they are. Thanks!