Re: [NTG-context] \startMPcode and \startMPpage
Dear Hans, Thank you for the reply. Since \startMPcode … \stopMPcode form is used in the manual, I think that it is OK to use it for all cases. Thank you again. Best regards, Dalyoung > 2020. 4. 17. 오전 5:01, Hans Hagen 작성: > > On 4/16/2020 8:36 PM, Jeong Dal wrote: >> Hi, >> The following sample code is working well in the \startMPpage ~ \stopMPpage, >> but is not working in the \startMPcode ~ \stopMPcode. >> The error message is >> \textfont0 is undefined (character 63) >> l.6 \setstrut\strut $A$ >> If I remove “$” from the code, it is also working in \startMPcode ~ >> \stopMPcode. >> Is there anything which I have to set for \startMPcode? > > \starttext ... \stoptext > > or > > \startMPpage[instance=doublefun] > > \stopMPpage > >> Best regards, >> Dalyoung >> >> \startMPcode{doublefun} >> %\startMPpage >> numeric count, temp[], tt, minus, u; u := 1cm; >> path p,q,r; >> pair A,B,C,D; >> string varName, ss, pos[]; >> p := unitsquare xyscaled (8u,3.5u); >> *draw p;* >> * >> * >> pos[0] := "bot"; >> pos[1] := "rt"; >> pos[2] := "top"; >> pos[3] := "lft"; >> varName := "yxwz"; >> count := 0; >> pickup pencircle scaled 5pt; >> for i = 0 upto 3: >> drawdot (point i of p); >> draw lmt_text[ >> text = "$" & char(65+i) & "$", >> anchor = pos[i], >> offset = 2pt, >> position = point i of p, >> ]; >> endfor; >> %\stopMPpage >> \stopMPcode >> ___ >> If your question is of interest to others as well, please add an entry to >> the Wiki! >> maillist : ntg-context@ntg.nl <mailto:ntg-context@ntg.nl> / >> http://www.ntg.nl/mailman/listinfo/ntg-context >> <http://www.ntg.nl/mailman/listinfo/ntg-context> >> webpage : http://www.pragma-ade.nl <http://www.pragma-ade.nl/> / >> http://context.aanhet.net <http://context.aanhet.net/> >> archive : https://bitbucket.org/phg/context-mirror/commits/ >> <https://bitbucket.org/phg/context-mirror/commits/> >> wiki : http://contextgarden.net <http://contextgarden.net/> >> ___ > > > -- > > - > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl <http://www.pragma-ade.nl/> | > www.pragma-pod.nl <http://www.pragma-pod.nl/> > - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] \startMPcode and \startMPpage
On 4/16/2020 8:36 PM, Jeong Dal wrote: Hi, The following sample code is working well in the \startMPpage ~ \stopMPpage, but is not working in the \startMPcode ~ \stopMPcode. The error message is \textfont0 is undefined (character 63) l.6 \setstrut\strut $A$ If I remove “$” from the code, it is also working in \startMPcode ~ \stopMPcode. Is there anything which I have to set for \startMPcode? \starttext ... \stoptext or \startMPpage[instance=doublefun] \stopMPpage Best regards, Dalyoung \startMPcode{doublefun} %\startMPpage numeric count, temp[], tt, minus, u; u := 1cm; path p,q,r; pair A,B,C,D; string varName, ss, pos[]; p := unitsquare xyscaled (8u,3.5u); *draw p;* * * pos[0] := "bot"; pos[1] := "rt"; pos[2] := "top"; pos[3] := "lft"; varName := "yxwz"; count := 0; pickup pencircle scaled 5pt; for i = 0 upto 3: drawdot (point i of p); draw lmt_text[ text = "$" & char(65+i) & "$", anchor = pos[i], offset = 2pt, position = point i of p, ]; endfor; %\stopMPpage \stopMPcode ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ -- - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] \startMPcode and \startMPpage
Hi, The following sample code is working well in the \startMPpage ~ \stopMPpage, but is not working in the \startMPcode ~ \stopMPcode. The error message is \textfont0 is undefined (character 63) l.6 \setstrut\strut $A$ If I remove “$” from the code, it is also working in \startMPcode ~ \stopMPcode. Is there anything which I have to set for \startMPcode? Best regards, Dalyoung \startMPcode{doublefun} %\startMPpage numeric count, temp[], tt, minus, u; u := 1cm; path p,q,r; pair A,B,C,D; string varName, ss, pos[]; p := unitsquare xyscaled (8u,3.5u); draw p; pos[0] := "bot"; pos[1] := "rt"; pos[2] := "top"; pos[3] := "lft"; varName := "yxwz"; count := 0; pickup pencircle scaled 5pt; for i = 0 upto 3: drawdot (point i of p); draw lmt_text[ text = "$" & char(65+i) & "$", anchor = pos[i], offset = 2pt, position = point i of p, ]; endfor; %\stopMPpage \stopMPcode ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] startMPpage..stopMPpage written to a separate PDF?
Gerben Wierda schrieb am 05.04.2020 um 12:27: On 5 Apr 2020, at 11:34, Hans Hagen wrote: On 4/5/2020 12:29 AM, Gerben Wierda wrote: I have a series of startMPpage—stopMPpage pairs (with MP code inbetween). These now become separate pages in a single PDF. But I need them to become separate PDF’s each during my ConTeXt run, with a name of my own choosing. Is this possible? I guess this will be problematic, but one can hope (maybe some very low level TeX trickery)... no (i would probably cook up something but it's not worth the trouble and it would add lots of ugly code deep down) but Yes, I was thinking about some low level open/writeout stuff in TeX but was scared to try. Still, a \startMPfile{pdffilename}..\stopMPfile (instead of page) would have been great... Something like this: \starttext \startbuffer[square] \startMPpage draw fullsquare scaled 10 withcolor red ; \stopMPpage \stopbuffer \typesetbufferonly[square] \startbuffer[circle] \startMPpage draw fullcircle scaled 10 withcolor green ; \stopMPpage \stopbuffer \typesetbuffer[circle] \startbuffer[triangle] \startMPpage draw fulltriangle scaled 10 withcolor blue ; \stopMPpage \stopbuffer \savebuffer[list=triangle,prefix=no,file=triangle.tex] \typesetfile[triangle.tex][] \stoptext Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] startMPpage..stopMPpage written to a separate PDF?
> On 5 Apr 2020, at 12:27, Gerben Wierda wrote: > > Alternatively, I could have a step before this to turn the input XML into > many separate XMLs and have many ConTeXt runs. Probably that is the best way > to do it. Each generated XML would have all of the original XML except it > would only have one ‘view’ in it and the rest removed. Or you could write out a shell script while processing the run. function moduledata.archimate(filename) local root = xml.load(filename) warnIfVerbose( "Processing %s", filename) local shfile = io.open(tex.jobname.. ".sh", "w") local i = 1 for view in xml.collected(root,"diagrams/view") do local viewName = xml.text(view,"/name") shfile:write(string.format('mutool merge -o "%s.pdf" %s "%s.pdf" ', viewName, i, tex.jobname)) i = i + 1 …. end shfile:close() and process that shell script at the end of the run. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] startMPpage..stopMPpage written to a separate PDF?
> On 5 Apr 2020, at 11:34, Hans Hagen wrote: > > On 4/5/2020 12:29 AM, Gerben Wierda wrote: >> I have a series of startMPpage—stopMPpage pairs (with MP code inbetween). >> These now become separate pages in a single PDF. But I need them to become >> separate PDF’s each during my ConTeXt run, with a name of my own choosing. >> Is this possible? I guess this will be problematic, but one can hope (maybe >> some very low level TeX trickery)... > no (i would probably cook up something but it's not worth the trouble and it > would add lots of ugly code deep down) but Yes, I was thinking about some low level open/writeout stuff in TeX but was scared to try. Still, a \startMPfile{pdffilename}..\stopMPfile (instead of page) would have been great... > you can use for instance mutool etc to split pdf’s I can’t do that simply because it would mean lots and lots of manual work (including typing long names every time) each time I automatically produce the PDFs. I am talking hundreds of views generated anew every time and they all need to end up in a separate file. I need some sort of automatic flow. It’s OK if the PDF with all the pages is an intermediate and use a tool to split this into separate files with separate file names (so an additional step in the workflow) but I would have to create th eextraction script automatically during the ConTeXt run. Alternatively, I could have a step before this to turn the input XML into many separate XMLs and have many ConTeXt runs. Probably that is the best way to do it. Each generated XML would have all of the original XML except it would only have one ‘view’ in it and the rest removed. > > Hans > > - > Hans Hagen | PRAGMA ADE > Ridderstraat 27 | 8061 GH Hasselt | The Netherlands > tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl > - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] startMPpage..stopMPpage written to a separate PDF?
On 4/5/2020 12:29 AM, Gerben Wierda wrote: I have a series of startMPpage—stopMPpage pairs (with MP code inbetween). These now become separate pages in a single PDF. But I need them to become separate PDF’s each during my ConTeXt run, with a name of my own choosing. Is this possible? I guess this will be problematic, but one can hope (maybe some very low level TeX trickery)... no (i would probably cook up something but it's not worth the trouble and it would add lots of ugly code deep down) but you can use for instance mutool etc to split pdf's Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] startMPpage..stopMPpage written to a separate PDF?
I have a series of startMPpage—stopMPpage pairs (with MP code inbetween). These now become separate pages in a single PDF. But I need them to become separate PDF’s each during my ConTeXt run, with a name of my own choosing. Is this possible? I guess this will be problematic, but one can hope (maybe some very low level TeX trickery)... Thanks, G ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] buffers inside startMPpage
Thank you Wolfgang. This suits my needs just fine. Kind regards, Jan Willem Flamma > On 14 okt. 2016, at 10:34, Wolfgang Schuster <schuster.wolfg...@gmail.com> > wrote: > >> Jan Willem Flamma <mailto:jwfregis...@icloud.com> 14. Oktober 2016 um 10:12 >> Dear list members, >> >> I create all my MetaFun drawings in a separate environment file where each >> individual drawing sits inside a start/stopbuffer. This allows me to easily >> use those drawings in all my documents using \processMPbuffer[name]. Works >> just fine. >> >> However, I also wish to have all the drawing available in a pdf file (each >> drawing on a separate page). This allows me to split the pdf and use the >> drawing elsewhere (e.g. in a Powerpoint) or include page(s) from the pdf in >> another document. >> >> The below MWE represent my MetaFun drawings file. >> The idea is that by uncommenting the \enablemode[makepdf] I can create the >> pdf file with drawings. It seems however that startMPpage does not accept >> buffers (I also tried processbuffer and processMPbuffer). >> >> Is it possible to somehow make this work? > You can use > > \startTEXpage > \processMPbuffer[…] > \stopTEXpage > > but loading a buffer in MPpage doesn’t work because the content of the > environment > is just passed to MetaPost and buffers can’t be loaded inside MetaPost code > unless > Hans adds a function for this, e.g. > > \startMPcode > buffer("mybuffer") > \stopMPcode > > Wolfgang > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] buffers inside startMPpage
Jan Willem Flamma <mailto:jwfregis...@icloud.com> 14. Oktober 2016 um 10:12 Dear list members, I create all my MetaFun drawings in a separate environment file where each individual drawing sits inside a start/stopbuffer. This allows me to easily use those drawings in all my documents using \processMPbuffer[name]. Works just fine. However, I also wish to have all the drawing available in a pdf file (each drawing on a separate page). This allows me to split the pdf and use the drawing elsewhere (e.g. in a Powerpoint) or include page(s) from the pdf in another document. The below MWE represent my MetaFun drawings file. The idea is that by uncommenting the \enablemode[makepdf] I can create the pdf file with drawings. It seems however that startMPpage does not accept buffers (I also tried processbuffer and processMPbuffer). Is it possible to somehow make this work? You can use \startTEXpage \processMPbuffer[…] \stopTEXpage but loading a buffer in MPpage doesn’t work because the content of the environment is just passed to MetaPost and buffers can’t be loaded inside MetaPost code unless Hans adds a function for this, e.g. \startMPcode buffer("mybuffer") \stopMPcode Wolfgang ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] buffers inside startMPpage
Dear list members, I create all my MetaFun drawings in a separate environment file where each individual drawing sits inside a start/stopbuffer. This allows me to easily use those drawings in all my documents using \processMPbuffer[name]. Works just fine. However, I also wish to have all the drawing available in a pdf file (each drawing on a separate page). This allows me to split the pdf and use the drawing elsewhere (e.g. in a Powerpoint) or include page(s) from the pdf in another document. The below MWE represent my MetaFun drawings file. The idea is that by uncommenting the \enablemode[makepdf] I can create the pdf file with drawings. It seems however that startMPpage does not accept buffers (I also tried processbuffer and processMPbuffer). Is it possible to somehow make this work? Thanks and regards, Jan Willem Flamma %\enablemode[makepdf] \startbuffer[fig1] draw fullcircle scaled 2cm withcolor red ; \stopbuffer \startbuffer[fig2] draw unitsquare scaled 2cm withcolor red ; \stopbuffer \startmode[makepdf] \starttext \startMPpage \getbuffer[fig1] \stopMPpage \startMPpage \getbuffer[fig2] \stopMPpage \stoptext \stopmode ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] \setuppapersize and \startMPpage
2006/5/11, Aditya Mahajan [EMAIL PROTECTED]: On Wed, 10 May 2006, Johan Sandblom wrote: Thank you, this almost works, but the title graphic (of thesis size) is not centered on the A4 paper, but in the lower right corner. How can I make it go to the right place? \definepapersize[thesis][width=169mm, height=239mm] \setuppapersize[thesis][A4] \starttext \startMPgraphic % Some metafun \stopMPgraphic \loadcurrentMPgraphic{possibly something should go here?} \placeMPgraphic % Some text \stoptext Untested, but how about \loadcurrentMPgraphic %{width=\textwidth} %Try with and without textwidth \placefigure [here] {none} {\placeMPgraphic} Yes, I tried that; with no arguments to \loadcurrentMPgraphic the thesis page is placed on the bottom of the A4 and not quite in the middle (?). with width=\textwidth or \makeupwidth the result is the same. Aditya PS: In future, also copy to the list, others may have better idea on how to do this. Yes, I had intended to, and thought I did, but apparently I am more trigger happy than I allow for ... Thank you for your help, Johan Regards, Johan 2006/5/9, Aditya Mahajan [EMAIL PROTECTED]: On Tue, 9 May 2006, Johan Sandblom wrote: Dear expertise, I have the following: \definepapersize[thesis][width=169mm, height=239mm] \setuppapersize[thesis][A4] \setuplayout [location=middle, marking=on] \setuppagenumbering [alternative=doublesided, location=marginedge, state=stop] \starttext % Title page \startMPpage % Some metafun \stopMPpage % Some text \stoptext The resulting pdf has a smaller first page (thesis size) while the rest are A4 with the thesis pages place centrally. I would like to see the title page placed on an A4 sheet as well. What am I doing wrong? MPpage creates a page with dimensions equal to the bounding box of the graphic. If you want to center a MP figure on your title page, use \startMPgraphic Aditya -- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008 -- Johan Sandblom N8, MRC, Karolinska sjh t +46851776108 17176 Stockholm m +46735521477 Sweden What is wanted is not the will to believe, but the will to find out, which is the exact opposite - Bertrand Russell -- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008 -- Johan Sandblom N8, MRC, Karolinska sjh t +46851776108 17176 Stockholm m +46735521477 Sweden What is wanted is not the will to believe, but the will to find out, which is the exact opposite - Bertrand Russell ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] \setuppapersize and \startMPpage
Johan Sandblom wrote: 2006/5/11, Aditya Mahajan [EMAIL PROTECTED]: On Wed, 10 May 2006, Johan Sandblom wrote: Thank you, this almost works, but the title graphic (of thesis size) is not centered on the A4 paper, but in the lower right corner. How can I make it go to the right place? \definepapersize[thesis][width=169mm, height=239mm] \setuppapersize[thesis][A4] \starttext \startMPgraphic % Some metafun \stopMPgraphic \loadcurrentMPgraphic{possibly something should go here?} \placeMPgraphic % Some text \stoptext Untested, but how about \loadcurrentMPgraphic %{width=\textwidth} %Try with and without textwidth \placefigure [here] {none} {\placeMPgraphic} Yes, I tried that; with no arguments to \loadcurrentMPgraphic the thesis page is placed on the bottom of the A4 and not quite in the middle (?). with width=\textwidth or \makeupwidth the result is the same. Aditya PS: In future, also copy to the list, others may have better idea on how to do this. Yes, I had intended to, and thought I did, but apparently I am more trigger happy than I allow for ... Thank you for your help, Johan Regards, Johan 2006/5/9, Aditya Mahajan [EMAIL PROTECTED]: On Tue, 9 May 2006, Johan Sandblom wrote: Dear expertise, I have the following: \definepapersize[thesis][width=169mm, height=239mm] \setuppapersize[thesis][A4] \setuplayout [location=middle, marking=on] \setuppagenumbering [alternative=doublesided, location=marginedge, state=stop] \starttext % Title page \startMPpage % Some metafun \stopMPpage % Some text \stoptext The resulting pdf has a smaller first page (thesis size) while the rest are A4 with the thesis pages place centrally. I would like to see the title page placed on an A4 sheet as well. What am I doing wrong? MPpage creates a page with dimensions equal to the bounding box of the graphic. If you want to center a MP figure on your title page, use \startMPgraphic Aditya -- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008 \definepapersize[thesis][width=169mm, height=239mm] \setuppapersize[thesis][A4] \definelayer[page][width=\paperwidth,height=\paperheight] \starttext \startTEXpage \setlayer [page] [preset=lefttop,x=3cm,y=4cm] {\startMPcode fill fullcircle scaled 10cm; \stopMPcode} \tightlayer[page] \stopTEXpage \stoptext - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] \setuppapersize and \startMPpage
2006/5/11, Hans Hagen [EMAIL PROTECTED]: \definepapersize[thesis][width=169mm, height=239mm] \setuppapersize[thesis][A4] \definelayer[page][width=\paperwidth,height=\paperheight] \starttext \startTEXpage \setlayer [page] [preset=lefttop,x=3cm,y=4cm] {\startMPcode fill fullcircle scaled 10cm; \stopMPcode} \tightlayer[page] \stopTEXpage \stoptext This works if I change \paperwidth and \paperheight to \printpaperwidth and \printpaperheight and change the dimensions slightly. Thank you, Johan - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl - -- Johan Sandblom N8, MRC, Karolinska sjh t +46851776108 17176 Stockholm m +46735521477 Sweden What is wanted is not the will to believe, but the will to find out, which is the exact opposite - Bertrand Russell ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] \setuppapersize and \startMPpage
Dear expertise, I have the following: \definepapersize[thesis][width=169mm, height=239mm] \setuppapersize[thesis][A4] \setuplayout [location=middle, marking=on] \setuppagenumbering [alternative=doublesided, location=marginedge, state=stop] \starttext % Title page \startMPpage % Some metafun \stopMPpage % Some text \stoptext The resulting pdf has a smaller first page (thesis size) while the rest are A4 with the thesis pages place centrally. I would like to see the title page placed on an A4 sheet as well. What am I doing wrong? Johan -- Johan Sandblom N8, MRC, Karolinska sjh t +46851776108 17176 Stockholm m +46735521477 Sweden What is wanted is not the will to believe, but the will to find out, which is the exact opposite - Bertrand Russell ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] \setuppapersize and \startMPpage
On Tue, 9 May 2006, Johan Sandblom wrote: Dear expertise, I have the following: \definepapersize[thesis][width=169mm, height=239mm] \setuppapersize[thesis][A4] \setuplayout [location=middle, marking=on] \setuppagenumbering [alternative=doublesided, location=marginedge, state=stop] \starttext % Title page \startMPpage % Some metafun \stopMPpage % Some text \stoptext The resulting pdf has a smaller first page (thesis size) while the rest are A4 with the thesis pages place centrally. I would like to see the title page placed on an A4 sheet as well. What am I doing wrong? MPpage creates a page with dimensions equal to the bounding box of the graphic. If you want to center a MP figure on your title page, use \startMPgraphic Aditya -- Aditya Mahajan, EECS Systems, University of Michigan http://www.eecs.umich.edu/~adityam || Ph: 7342624008 ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] \setupMPvariables in \startMPpage
David Arnold wrote: All, Why doesn't this work? %output=pdf \startuseMPgraphic{usquare} draw unitsquare scaled 4cm; \stopuseMPgraphic \starttext \startMPpage \useMPgraphic{square} \stopMPpage \stoptext because you nest a graphic, kind of beginfig(1) beginfig(2) draw unitsquare scaled 4cm; endfig ; endfig ; Hans ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] \setupMPvariables in \startMPpage
David Arnold wrote: Why doesn't this work? %output=pdf \startuseMPgraphic{usquare} draw unitsquare scaled \MPvar{u}; \stopuseMPgraphic \starttext \startMPpage \setupMPvariables[usquare][u=4cm] \includeMPgraphic{usquare} \stopMPpage \stoptext because (1) after startMPpage metapost code is expected (or something like \includeMPgraphic{...} that expands to mp code (2) when the setup is moved outside the startMPpage, contex does not know what vars to preset however, this works (MPrawvar is undocumented, yet) \startuseMPgraphic{usquare} draw unitsquare scaled \MPrawvar{usquare}{u}; \stopuseMPgraphic \starttext \setupMPvariables[usquare][u=4cm] \startMPpage \includeMPgraphic{usquare} \stopMPpage \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] \startMPpage ... \stopMPpage
David Arnold wrote: % \startMPpage % \includeMPgraphic{EnglishRule} % \stopMPpage you can only include a simple usable graphic, defined with \startuseMPgraphic; unique mp graphics are more tricky and involve (once we have lua in tex we can find ways around this since then we can (1) implement some of the unique housekeeping in lua and (2) fool tex with hidden expansions) Hans ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] \setupMPvariables in \startMPpage
All, Why doesn't this work? %output=pdf \startuseMPgraphic{usquare} draw unitsquare scaled 4cm; \stopuseMPgraphic \starttext \startMPpage \useMPgraphic{square} \stopMPpage \stoptext Why doesn't this work? %output=pdf \startuseMPgraphic{usquare} draw unitsquare scaled \MPvar{u}; \stopuseMPgraphic \starttext \startMPpage \setupMPvariables[usquare][u=4cm] \includeMPgraphic{usquare} \stopMPpage \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] \setupMPvariables in \startMPpage
Hi David, without digging into depth, it works if you change MPpage into TEXpage Willi David Arnold wrote: All, Why doesn't this work? %output=pdf \startuseMPgraphic{usquare} draw unitsquare scaled 4cm; \stopuseMPgraphic \starttext \startMPpage \useMPgraphic{square} \stopMPpage \stoptext Why doesn't this work? %output=pdf \startuseMPgraphic{usquare} draw unitsquare scaled \MPvar{u}; \stopuseMPgraphic \starttext \startMPpage \setupMPvariables[usquare][u=4cm] \includeMPgraphic{usquare} \stopMPpage \stoptext ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] \startMPpage ... \stopMPpage
Hans, Taco, et al, There's a quote in metafun-s.pdf (page 539) that says You can embed the graphic in a \startMPpage construct and process it with TEXEXEC. In that case you have the full MetaFun functionality available. Before processing the file, TEXEXEC will do a couple of checks on the file. It will also make sure that the auxiliary files (mpt for textext’s and mpo for outline fonts) are taken care of too. I am really unsure of what this means as the code below will attest. Simply uncomment % \startMPpage % \includeMPgraphic{EnglishRule} % \stopMPpage at the end and the file will not compile. Just what can and cannot be used between a \startMPpage ... \stopMPpage pair? This is first introduced in metafun-s.pdf on page 214 and wish there were more said there. %output=pdf \setupcolors[state=start] \definecolor[gridlines][s=0.7] \startMPinclusions color gridlines; gridlines:=\MPcolor{gridlines}; \stopMPinclusions \starttext \setupMPvariables [EnglishRule] [height=1ex, width=\localhsize, color=darkred] \startuniqueMPgraphic{EnglishRule}{height,width,color} numeric height; height=\MPvar{height}; x1=0; x3=\MPvar{width}; x2=x4=.5x3; y1=y3=0; y2:=-y4=height/2; fill z1..z2..z3 z3..z4..z1 cycle withcolor \MPvar{color}; \stopuniqueMPgraphic \defineblank [EnglishRule] [medium] \def\EnglishRule% {\startlinecorrection[EnglishRule] \setlocalhsize \noindent \reuseMPgraphic{EnglishRule} \stoplinecorrection} Why is this called an English line? \startnarrower \EnglishRule Is it because they cannot draw a straight one? This could be ture after a few strong beers, but then, ow do Germans draw a line? \EnglishRule \stopnarrower \defineblank [EnglishRule] [big] Why is this called an English line? \startnarrower \EnglishRule Is it because they cannot draw a straight one? This could be ture after a few strong beers, but then, ow do Germans draw a line? \EnglishRule \stopnarrower % \startMPpage % \includeMPgraphic{EnglishRule} % \stopMPpage \stoptext %%% Local Variables: %%% mode: conTeXt-en %%% End:___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context