Help with MetaPost and Metaobj with latex
Kind help with two examples to do metapost and metaobj in latex running from Texicenter.
what packages to include and program two examples
I read through book not able to understand.
First
input metafun
draw fulldiamond scaled 1cm withcolor blue;
second
input metaobj
nczigzag(a)(b);
nczigzag(a)(b)
"angleA(-90)","angleB(120)",
"linetension(0.8)","coilwidth(2mm)",
"linearc(0.1mm)";
drawObj(a,b);
Below code not working help
documentclass{article}
usepackage{luamplib}
begin{document}
begin{mplibcode}
input test.mp
end{mplibcode}
end{document}
where test.mp
beginfig(1) ;
draw fulldiamond scaled 1cm withcolor blue ;
endfig ;
end ;
Then ran it in in LuLatex but errors and output not coming
second if in the above in above instead of test.mp as above code
if we have test.mp as
input metaobj
beginfig(1) ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
endfig ;
end ;
How to run without errors Kind help
pdftex luatex metapost metafun
add a comment |
Kind help with two examples to do metapost and metaobj in latex running from Texicenter.
what packages to include and program two examples
I read through book not able to understand.
First
input metafun
draw fulldiamond scaled 1cm withcolor blue;
second
input metaobj
nczigzag(a)(b);
nczigzag(a)(b)
"angleA(-90)","angleB(120)",
"linetension(0.8)","coilwidth(2mm)",
"linearc(0.1mm)";
drawObj(a,b);
Below code not working help
documentclass{article}
usepackage{luamplib}
begin{document}
begin{mplibcode}
input test.mp
end{mplibcode}
end{document}
where test.mp
beginfig(1) ;
draw fulldiamond scaled 1cm withcolor blue ;
endfig ;
end ;
Then ran it in in LuLatex but errors and output not coming
second if in the above in above instead of test.mp as above code
if we have test.mp as
input metaobj
beginfig(1) ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
endfig ;
end ;
How to run without errors Kind help
pdftex luatex metapost metafun
You will find an answer to your first question in tex.stackexchange.com/questions/454934/…
– sztruks
Jan 19 at 16:11
Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 5:03
This is a new question. Please ask it as a separate question.
– sztruks
Jan 22 at 7:22
add a comment |
Kind help with two examples to do metapost and metaobj in latex running from Texicenter.
what packages to include and program two examples
I read through book not able to understand.
First
input metafun
draw fulldiamond scaled 1cm withcolor blue;
second
input metaobj
nczigzag(a)(b);
nczigzag(a)(b)
"angleA(-90)","angleB(120)",
"linetension(0.8)","coilwidth(2mm)",
"linearc(0.1mm)";
drawObj(a,b);
Below code not working help
documentclass{article}
usepackage{luamplib}
begin{document}
begin{mplibcode}
input test.mp
end{mplibcode}
end{document}
where test.mp
beginfig(1) ;
draw fulldiamond scaled 1cm withcolor blue ;
endfig ;
end ;
Then ran it in in LuLatex but errors and output not coming
second if in the above in above instead of test.mp as above code
if we have test.mp as
input metaobj
beginfig(1) ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
endfig ;
end ;
How to run without errors Kind help
pdftex luatex metapost metafun
Kind help with two examples to do metapost and metaobj in latex running from Texicenter.
what packages to include and program two examples
I read through book not able to understand.
First
input metafun
draw fulldiamond scaled 1cm withcolor blue;
second
input metaobj
nczigzag(a)(b);
nczigzag(a)(b)
"angleA(-90)","angleB(120)",
"linetension(0.8)","coilwidth(2mm)",
"linearc(0.1mm)";
drawObj(a,b);
Below code not working help
documentclass{article}
usepackage{luamplib}
begin{document}
begin{mplibcode}
input test.mp
end{mplibcode}
end{document}
where test.mp
beginfig(1) ;
draw fulldiamond scaled 1cm withcolor blue ;
endfig ;
end ;
Then ran it in in LuLatex but errors and output not coming
second if in the above in above instead of test.mp as above code
if we have test.mp as
input metaobj
beginfig(1) ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
endfig ;
end ;
How to run without errors Kind help
pdftex luatex metapost metafun
pdftex luatex metapost metafun
edited Jan 22 at 6:29
Martin Scharrer♦
200k45636818
200k45636818
asked Jan 19 at 14:47
sriramsriram
356
356
You will find an answer to your first question in tex.stackexchange.com/questions/454934/…
– sztruks
Jan 19 at 16:11
Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 5:03
This is a new question. Please ask it as a separate question.
– sztruks
Jan 22 at 7:22
add a comment |
You will find an answer to your first question in tex.stackexchange.com/questions/454934/…
– sztruks
Jan 19 at 16:11
Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 5:03
This is a new question. Please ask it as a separate question.
– sztruks
Jan 22 at 7:22
You will find an answer to your first question in tex.stackexchange.com/questions/454934/…
– sztruks
Jan 19 at 16:11
You will find an answer to your first question in tex.stackexchange.com/questions/454934/…
– sztruks
Jan 19 at 16:11
Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 5:03
Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 5:03
This is a new question. Please ask it as a separate question.
– sztruks
Jan 22 at 7:22
This is a new question. Please ask it as a separate question.
– sztruks
Jan 22 at 7:22
add a comment |
1 Answer
1
active
oldest
votes
MetaFun
MetaFun are not macros which can be input, but it is another format (sort of like Plain TeX vs. LaTeX). So to run a file with MetaFun you have to preload the format with mpost '&metafun' test.mp.
beginfig(1) ;
draw fulldiamond scaled 1cm withcolor blue ;
endfig ;
end ;

MetaObj
Your MetaObj example can't work because you are trying to connect objects a and b which do not exist. I just made two circles and placed them somewhere.
input metaobj
beginfig(1) ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
endfig ;
end ;

Embedding the figures in a document
You tagged the question with luatex, so we can use luamplib. Since MetaFun is actually a superset of plain MetaPost, we can globally switch the format to MetaFun using mplibsetformat{metafun}. We also add some convenience code in everymplib and everyendmplib so we don't have to type beginfig and endfig every time and the picture will always be in horizontal mode.
documentclass{beamer}
usepackage{luamplib}
mplibsetformat{metafun}
everymplib{
verbatimtex leavevmode etex ;
beginfig(0) ;
}
everyendmplib{
endfig ;
}
begin{document}
begin{frame}
begin{mplibcode}
draw fulldiamond scaled 1cm withcolor blue ;
end{mplibcode}
end{frame}
begin{frame}
begin{mplibcode}
input metaobj ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
end{mplibcode}
end{frame}
end{document}

Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 3:46
@sriram In LaTeX or in plain MetaPost?
– Henri Menke
Jan 22 at 6:47
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f470878%2fhelp-with-metapost-and-metaobj-with-latex%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
MetaFun
MetaFun are not macros which can be input, but it is another format (sort of like Plain TeX vs. LaTeX). So to run a file with MetaFun you have to preload the format with mpost '&metafun' test.mp.
beginfig(1) ;
draw fulldiamond scaled 1cm withcolor blue ;
endfig ;
end ;

MetaObj
Your MetaObj example can't work because you are trying to connect objects a and b which do not exist. I just made two circles and placed them somewhere.
input metaobj
beginfig(1) ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
endfig ;
end ;

Embedding the figures in a document
You tagged the question with luatex, so we can use luamplib. Since MetaFun is actually a superset of plain MetaPost, we can globally switch the format to MetaFun using mplibsetformat{metafun}. We also add some convenience code in everymplib and everyendmplib so we don't have to type beginfig and endfig every time and the picture will always be in horizontal mode.
documentclass{beamer}
usepackage{luamplib}
mplibsetformat{metafun}
everymplib{
verbatimtex leavevmode etex ;
beginfig(0) ;
}
everyendmplib{
endfig ;
}
begin{document}
begin{frame}
begin{mplibcode}
draw fulldiamond scaled 1cm withcolor blue ;
end{mplibcode}
end{frame}
begin{frame}
begin{mplibcode}
input metaobj ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
end{mplibcode}
end{frame}
end{document}

Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 3:46
@sriram In LaTeX or in plain MetaPost?
– Henri Menke
Jan 22 at 6:47
add a comment |
MetaFun
MetaFun are not macros which can be input, but it is another format (sort of like Plain TeX vs. LaTeX). So to run a file with MetaFun you have to preload the format with mpost '&metafun' test.mp.
beginfig(1) ;
draw fulldiamond scaled 1cm withcolor blue ;
endfig ;
end ;

MetaObj
Your MetaObj example can't work because you are trying to connect objects a and b which do not exist. I just made two circles and placed them somewhere.
input metaobj
beginfig(1) ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
endfig ;
end ;

Embedding the figures in a document
You tagged the question with luatex, so we can use luamplib. Since MetaFun is actually a superset of plain MetaPost, we can globally switch the format to MetaFun using mplibsetformat{metafun}. We also add some convenience code in everymplib and everyendmplib so we don't have to type beginfig and endfig every time and the picture will always be in horizontal mode.
documentclass{beamer}
usepackage{luamplib}
mplibsetformat{metafun}
everymplib{
verbatimtex leavevmode etex ;
beginfig(0) ;
}
everyendmplib{
endfig ;
}
begin{document}
begin{frame}
begin{mplibcode}
draw fulldiamond scaled 1cm withcolor blue ;
end{mplibcode}
end{frame}
begin{frame}
begin{mplibcode}
input metaobj ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
end{mplibcode}
end{frame}
end{document}

Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 3:46
@sriram In LaTeX or in plain MetaPost?
– Henri Menke
Jan 22 at 6:47
add a comment |
MetaFun
MetaFun are not macros which can be input, but it is another format (sort of like Plain TeX vs. LaTeX). So to run a file with MetaFun you have to preload the format with mpost '&metafun' test.mp.
beginfig(1) ;
draw fulldiamond scaled 1cm withcolor blue ;
endfig ;
end ;

MetaObj
Your MetaObj example can't work because you are trying to connect objects a and b which do not exist. I just made two circles and placed them somewhere.
input metaobj
beginfig(1) ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
endfig ;
end ;

Embedding the figures in a document
You tagged the question with luatex, so we can use luamplib. Since MetaFun is actually a superset of plain MetaPost, we can globally switch the format to MetaFun using mplibsetformat{metafun}. We also add some convenience code in everymplib and everyendmplib so we don't have to type beginfig and endfig every time and the picture will always be in horizontal mode.
documentclass{beamer}
usepackage{luamplib}
mplibsetformat{metafun}
everymplib{
verbatimtex leavevmode etex ;
beginfig(0) ;
}
everyendmplib{
endfig ;
}
begin{document}
begin{frame}
begin{mplibcode}
draw fulldiamond scaled 1cm withcolor blue ;
end{mplibcode}
end{frame}
begin{frame}
begin{mplibcode}
input metaobj ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
end{mplibcode}
end{frame}
end{document}

MetaFun
MetaFun are not macros which can be input, but it is another format (sort of like Plain TeX vs. LaTeX). So to run a file with MetaFun you have to preload the format with mpost '&metafun' test.mp.
beginfig(1) ;
draw fulldiamond scaled 1cm withcolor blue ;
endfig ;
end ;

MetaObj
Your MetaObj example can't work because you are trying to connect objects a and b which do not exist. I just made two circles and placed them somewhere.
input metaobj
beginfig(1) ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
endfig ;
end ;

Embedding the figures in a document
You tagged the question with luatex, so we can use luamplib. Since MetaFun is actually a superset of plain MetaPost, we can globally switch the format to MetaFun using mplibsetformat{metafun}. We also add some convenience code in everymplib and everyendmplib so we don't have to type beginfig and endfig every time and the picture will always be in horizontal mode.
documentclass{beamer}
usepackage{luamplib}
mplibsetformat{metafun}
everymplib{
verbatimtex leavevmode etex ;
beginfig(0) ;
}
everyendmplib{
endfig ;
}
begin{document}
begin{frame}
begin{mplibcode}
draw fulldiamond scaled 1cm withcolor blue ;
end{mplibcode}
end{frame}
begin{frame}
begin{mplibcode}
input metaobj ;
newCircle.a(btex A etex) ;
newCircle.b(btex B etex) ;
a.c=origin ;
b.c=(3cm,2cm) ;
nczigzag(a)(b) ;
nczigzag(a)(b) "angleA(-90)","angleB(120)",
"linetension(0.8)",
"coilwidth(2mm)", "linearc(0.1mm)" ;
drawObj(a,b) ;
end{mplibcode}
end{frame}
end{document}

edited Jan 22 at 8:29
answered Jan 20 at 20:53
Henri MenkeHenri Menke
72.1k8160269
72.1k8160269
Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 3:46
@sriram In LaTeX or in plain MetaPost?
– Henri Menke
Jan 22 at 6:47
add a comment |
Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 3:46
@sriram In LaTeX or in plain MetaPost?
– Henri Menke
Jan 22 at 6:47
Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 3:46
Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 3:46
@sriram In LaTeX or in plain MetaPost?
– Henri Menke
Jan 22 at 6:47
@sriram In LaTeX or in plain MetaPost?
– Henri Menke
Jan 22 at 6:47
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f470878%2fhelp-with-metapost-and-metaobj-with-latex%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You will find an answer to your first question in tex.stackexchange.com/questions/454934/…
– sztruks
Jan 19 at 16:11
Is it possible to create frame like slide (like beamer slides) when we fun as metafun IF so help with an example with above two in two different frames
– sriram
Jan 22 at 5:03
This is a new question. Please ask it as a separate question.
– sztruks
Jan 22 at 7:22