Help with MetaPost and Metaobj with latex












1















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










share|improve this question

























  • 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
















1















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










share|improve this question

























  • 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














1












1








1








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










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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



















  • 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










1 Answer
1






active

oldest

votes


















4














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 ;


enter image description here



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 ;


enter image description here



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}


enter image description here






share|improve this answer


























  • 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











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
});


}
});














draft saved

draft discarded


















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









4














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 ;


enter image description here



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 ;


enter image description here



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}


enter image description here






share|improve this answer


























  • 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
















4














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 ;


enter image description here



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 ;


enter image description here



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}


enter image description here






share|improve this answer


























  • 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














4












4








4







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 ;


enter image description here



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 ;


enter image description here



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}


enter image description here






share|improve this answer















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 ;


enter image description here



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 ;


enter image description here



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}


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








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



















  • 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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?