【发布时间】: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