Hi Olivier, olivier Turlier schrieb:
Hi everybody, I try to draw several metapost page backgrounds (code found at http://melusine.eu.org/syracuse/poulecl/divers/papiers/ ) for manual sketchs on A4 paper. Obviously, it does'nt work, and I don't know why. TIA for any answers. Not so short examples are attached.
not so short working example attached. I had some problems with MP (compilations stops in MP; CTRL-D or typing 'end' works)...I donno. Some eof mess. Best wishes, Peter
------------------------------------------------------------------------
___________________________________________________________________________________ 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://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
\mainlanguage[fr] %D Format de papier A4. \setuppapersize[A4][A4] \setuplayout [width=middle, topspace=1.5cm, height=middle, header=1cm, footer=1cm] \setupcolors[state=start] \MPinclusions{\input constantes.mp \input papiers.mp} \starttext %---------------------------------------------------------------------------------- \startuseMPgraphic{Papier5trait} %input constantes; %input papiers; color macouleur; macouleur = .7(green+blue); % beginfig(1); papiercinq((-5,-5),(5,5),macouleur); % endfig; % end \stopuseMPgraphic \defineoverlay[Papier5trait][\useMPgraphic{Papier5trait}] % \defineframedtext[Papier5trait][background=Papier5trait,width=fit,offset=2ex,frame=on,framecolor=red,rulethickness=3pt,corner=round,style=type] % \defineframedtext[Papier5trait][align=middle,width=\overlaywidth,height=\overlayheight,frame=off,background=Papier5trait] % \definetextbackground[Papier5trait][location=paragraph,backgroundcolor=white,before=\blank,after=\blank] \startsetups[Papier5trait] %\startstandardmakeup \setupbackgrounds [page] [background=Papier5trait] %\stopstandardmakeup \setuplayout%[reset] % without parameter--> recalculate layout \stopsetups %---------------------------------------------------------------------------------- \startuseMPgraphic{Papier5point} %input constantes; %input papiers; color macouleur; macouleur = .7(red+blue); % beginfig(1); papierpointe((-5,-5),(5,5),macouleur); % endfig; % end \stopuseMPgraphic \defineoverlay[Papier5point][\useMPgraphic{Papier5point}] % \defineframedtext[Papier5point][background=Papier5point,width=fit,offset=2ex,frame=off] \startsetups[Papier5point] %\startstandardmakeup \setupbackgrounds [page] [background=Papier5point] %\stopstandardmakeup \setuplayout%[reset] \stopsetups %---------------------------------------------------------------------------------- \startuseMPgraphic{Papiermillimetre} %input constantes; %input papiers; color macouleur; macouleur = .8*orange; % beginfig(1); papiermil((-4cm,-4cm),1,1,(-5,-5),(5,5),macouleur); % endfig; % end \stopuseMPgraphic \defineoverlay[Papiermillimetre][\useMPgraphic{Papiermillimetre}] % \defineframedtext[Papiermillimetre][background=Papiermillimetre,width=fit,offset=2ex,frame=off] \startsetups[Papiermillimetre] %\startstandardmakeup \setupbackgrounds [page] [background=Papiermillimetre] %\stopstandardmakeup \setuplayout%[reset] \stopsetups %---------------------------------------------------------------------------------- \startuseMPgraphic{Papier10trait} %input constantes; %input papiers; color macouleur; macouleur = .7(red+green); % beginfig(1); papierun((-5,-5),(5,5),macouleur); % endfig; % end \stopuseMPgraphic \defineoverlay[Papier10trait][\useMPgraphic{Papier10trait}] % \defineframedtext[Papier10trait][background=Papier10trait,width=fit,offset=2ex,frame=off] \startsetups[Papier10trait] %\startstandardmakeup \setupbackgrounds [page] [background=Papier10trait] %\stopstandardmakeup \setuplayout%[reset] \stopsetups %---------------------------------------------------------------------------------- \startuseMPgraphic{Papiercahierseyes} %input constantes; %input papiers; color macouleur; macouleur = .7[red,blue]; % beginfig(1); papiercahier((-5,-5),(5,5),macouleur); % endfig; % end \stopuseMPgraphic \defineoverlay[Papiercahierseyes][\useMPgraphic{Papiercahierseyes}] % \defineframedtext[Papiercahierseyes][background=Papiercahierseyes,width=fit,offset=2ex,frame=off] \startsetups[Papiercahierseyes] %\startstandardmakeup \setupbackgrounds [page] [background=Papiercahierseyes] %\stopstandardmakeup \setuplayout%[reset] \stopsetups %---------------------------------------------------------------------------------- \startuseMPgraphic{Papierisotrait} %input constantes; %input papiers; color macouleur; macouleur = .7[green,red]; % beginfig(1); papierisom((-5,-5),(5,5),macouleur); % endfig; % end \stopuseMPgraphic \defineoverlay[Papierisotrait][\useMPgraphic{Papierisotrait}] % \defineframedtext[Papierisotrait][background=Papierisotrait,width=fit,offset=2ex,frame=off] \startsetups[Papierisotrait] %\startstandardmakeup \setupbackgrounds [page] [background=Papierisotrait] %\stopstandardmakeup \setuplayout%[reset] \stopsetups %----------------------------------------------------------------------------- % \setupbackgrounds[page][background=Papier5trait] \setups[Papier5trait] \startstandardmakeup % \framed[background=Papier5trait]{1 } % \startPapier5trait 1 \vfill{} % \stopPapier5trait %\setupbackgrounds[page][background=] \page \stopstandardmakeup %----------------------------------------------------------------------------- % \setupbackgrounds[page][background=Papier5point] \setups[Papier5point] \startstandardmakeup 2 \vfill{} %\setupbackgrounds[page][background=] \page \stopstandardmakeup %----------------------------------------------------------------------------- % \setupbackgrounds[page][background=Papiermillimetre] \setups[Papiermillimetre] \startstandardmakeup % \startPapiermillimetre 3 \vfill{} % \stopPapiermillimetre %\setupbackgrounds[page][background=] \page \stopstandardmakeup %----------------------------------------------------------------------------- % \setupbackgrounds[page][background=Papier10trait] \setups[Papier10trait] \startstandardmakeup 4 \vfill{} %\setupbackgrounds[page][background=] \page \stopstandardmakeup %----------------------------------------------------------------------------- % \setupbackgrounds[page][background=Papiercahierseyes] \setups[Papiercahierseyes] \startstandardmakeup 5 \vfill{} %\setupbackgrounds[page][background=] \page \stopstandardmakeup %----------------------------------------------------------------------------- % \setupbackgrounds[page][background=Papierisotrait] \setups[Papierisotrait] \startstandardmakeup 6 \vfill{} %\setupbackgrounds[page][background=] \page \stopstandardmakeup \stoptext