【问题标题】:Is it possible to include one MetaPost file into another?是否可以将一个 MetaPost 文件包含到另一个文件中?
【发布时间】:2010-10-10 21:00:19
【问题描述】:

我有两个 metapost 文件:

% test1.mp
beginfig(1):

% foobar code

% code specific to test1

endfig;
end;

% test2.mp
beginfig(1):

% foobar code    

% code specific to test2

endfig;
end;

作为一名程序员,我自然讨厌重复。有没有办法将“foobar 代码”移动到 foobar.mp 文件中,然后将该文件包含在 test1.mp 和 test2.mp 中?比如……

% test1.mp
beginfig(1):

% for illustration...
Include.foobar("foobar.mp");

% code specific to test2

endfig;
end;

【问题讨论】:

    标签: metapost


    【解决方案1】:
    % test1.mp
    beginfig(1):
    input foobar
    endfig;
    end;
    

    【讨论】:

    • input 命令是否记录在任何地方?我试图搜索有关它的信息,但找不到任何东西。
    • 另外,当使用 lualatex 内置的 mplib 时,输入机制似乎不起作用——任何解决方案/解决方法?
    猜你喜欢
    • 2010-09-13
    • 1970-01-01
    • 1970-01-01
    • 2021-09-25
    • 1970-01-01
    • 2012-05-01
    • 2020-01-24
    • 2011-10-27
    • 1970-01-01
    相关资源
    最近更新 更多