[metapost] multiple and nested input

Josef Eschgfaeller esg at unife.it
Tue Sep 1 20:38:56 CEST 2020


I work with High Sierra and TexLive 2018
on an iMac. Since it seems that also the
-mem (or &) commands don't work, I
modified the file ".../base/mpost.pm" as follows
("Alfa" should become the root file for a little library),
adding only the second input line:
--------------------------------------------------
% $Id: mpost.mp,v 1.1 2005/05/06 09:11:09 taco Exp $
% Public domain.

input plain;
input /Users/je/Programmiersprachen/Metapost/Bibliothek/Alfa;
dump
--------------------------------------------------
I create now the following files (in the same directory):
--------------------------------------------------
% Alfa.
input /Users/je/Programmiersprachen/Metapost/Bibliothek/aux;
input /Users/je/Programmiersprachen/Metapost/Bibliothek/conf;
dump
--------------------------------------------------
% aux.
def out (text name)=outputtemplate:=name & ".mps"; enddef;
dump
--------------------------------------------------
% conf.
bboxmargin:=0;
dump
--------------------------------------------------
Now I write (elsewhere) a file "ex":
--------------------------------------------------
% ex.
out("ex");
beginfig(1);
endfig;
dump
--------------------------------------------------
>From the shell with "mpost ex" I obtain:
--------------------------------------------------
This is MetaPost, version 2.00 (TeX Live 2018) (kpathsea version 6.3.0)
(/usr/local/texlive/2018/texmf-dist/metapost/base/mpost.mp
(/usr/local/texlive/2018/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005)
(/Users/je/Programmiersprachen/Metapost/Bibliothek/Alfa
(/Users/je/Programmiersprachen/Metapost/Bibliothek/aux ) ) ) (./ex [1])
*
--------------------------------------------------
and the file "ex.mps" is created (but apparently "conf"
is not loaded). But when I interchange the two inputs
 in "Alfa", the macro "out" is not found (and, if I
understand well, the file "aux" is not loaded):
--------------------------------------------------
This is MetaPost, version 2.00 (TeX Live 2018) (kpathsea version 6.3.0)
(/usr/local/texlive/2018/texmf-dist/metapost/base/mpost.mp
(/usr/local/texlive/2018/texmf-dist/metapost/base/plain.mp
Preloading the plain mem file, version 1.005)
(/Users/je/Programmiersprachen/Metapost/Bibliothek/Alfa
(/Users/je/Programmiersprachen/Metapost/Bibliothek/conf ) ) ) (./ex
>> out
! Isolated expression.
<to be read again>
                   (
l.3 out(
        "ex.mps");
?
--------------------------------------------------
A little tricky ... Thanks again.

Josef Eschgfaeller


More information about the metapost mailing list.