I have two metapost files:
% test1.mp
beginfig(1):
% foobar code
% code specific to test1
endfig;
end;
% test2.mp
beginfig(1):
% foobar code
% code specific to test2
endfig;
end;
As a programmer, I naturally hate duplication. Is there a way of moving the "foobar code" into a foobar.mp file, and then including this file in both test1.mp and test2.mp? For example...
% test1.mp
beginfig(1):
% for illustration...
Include.foobar("foobar.mp");
% code specific to test2
endfig;
end;
% test1.mp
beginfig(1):
input foobar
endfig;
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With