* metapost question
@ 2008-06-18 11:14 Thomas A. Schmitz
2008-06-18 11:43 ` Wolfgang Schuster
2008-06-18 11:58 ` Peter Rolf
0 siblings, 2 replies; 55+ messages in thread
From: Thomas A. Schmitz @ 2008-06-18 11:14 UTC (permalink / raw)
To: mailing ConTeXt users list for
Hi all,
probably an easy question: for a presentation, I would like to have an
area of my slide highlighted by placing a transparent grey layer on
top of the slide and having one area of this layer completely
transparent, a bit like this screenshot: http://debaday.debian.net/wp-content/uploads/2007/05/key3.jpg
Any suggestions for the easiest way to achieve this effect?
Thanks
Thomas
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2008-06-18 11:14 metapost question Thomas A. Schmitz
@ 2008-06-18 11:43 ` Wolfgang Schuster
2008-06-18 11:58 ` Peter Rolf
1 sibling, 0 replies; 55+ messages in thread
From: Wolfgang Schuster @ 2008-06-18 11:43 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Wed, Jun 18, 2008 at 1:14 PM, Thomas A. Schmitz
<thomas.schmitz@uni-bonn.de> wrote:
> Hi all,
>
> probably an easy question: for a presentation, I would like to have an
> area of my slide highlighted by placing a transparent grey layer on
> top of the slide and having one area of this layer completely
> transparent, a bit like this screenshot: http://debaday.debian.net/wp-content/uploads/2007/05/key3.jpg
> Any suggestions for the easiest way to achieve this effect?
\setupexternalfigures[location={local,global,default}]
\definecolor[tgray][r=.8,t=.5,a=1]
\startuseMPgraphic{highlighted}
path p, q ;
p = unitsquare xyscaled(OverlayWidth,OverlayHeight) ;
q= fullcircle scaled 3cm shifted (12cm,10cm) ;
fill p--reverse q--cycle withcolor \MPcolor{tgray} ;
\stopuseMPgraphic
\defineoverlay[image][\overlayfigure{hacker}]
\defineoverlay[shade][\useMPgraphic{highlighted}]
\setupbackgrounds[page][background={image,shade}]
\setuppapersize[S6][S6]
\starttext
\page[empty]
\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://tex.aanhet.net
archive : https://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2008-06-18 11:14 metapost question Thomas A. Schmitz
2008-06-18 11:43 ` Wolfgang Schuster
@ 2008-06-18 11:58 ` Peter Rolf
2008-06-18 12:11 ` Thomas A. Schmitz
1 sibling, 1 reply; 55+ messages in thread
From: Peter Rolf @ 2008-06-18 11:58 UTC (permalink / raw)
To: mailing list for ConTeXt users
Thomas A. Schmitz schrieb:
> Hi all,
>
> probably an easy question: for a presentation, I would like to have an
> area of my slide highlighted by placing a transparent grey layer on
> top of the slide and having one area of this layer completely
> transparent, a bit like this screenshot: http://debaday.debian.net/wp-content/uploads/2007/05/key3.jpg
> Any suggestions for the easiest way to achieve this effect?
>
> Thanks
>
\startuniqueMPgraphic{dim:and:focus}{fw,fh,fx,fy,c}
begingroup
save q ;
path q;
q:= (unitsquare xyscaled(\MPvar{fw},\MPvar{fh})
smoothed 4px)
shifted (\MPvar{fx},\MPvar{fy});
fill OverlayBox--reverse q-- cycle withcolor \MPvar{c} ;
% draw q withpen pxcpen withcolor darkgray;
setbounds currentpicture to OverlayBox ; % just to be safe in case of
outside focus rectangle
endgroup;
\stopuniqueMPgraphic
no further explanations :D
best wishes, peter
> Thomas
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2008-06-18 11:58 ` Peter Rolf
@ 2008-06-18 12:11 ` Thomas A. Schmitz
0 siblings, 0 replies; 55+ messages in thread
From: Thomas A. Schmitz @ 2008-06-18 12:11 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Jun 18, 2008, at 1:58 PM, Peter Rolf wrote:
> \startuniqueMPgraphic{dim:and:focus}{fw,fh,fx,fy,c}
> begingroup
> save q ;
> path q;
>
> q:= (unitsquare xyscaled(\MPvar{fw},\MPvar{fh})
> smoothed 4px)
> shifted (\MPvar{fx},\MPvar{fy});
>
> fill OverlayBox--reverse q-- cycle withcolor \MPvar{c} ;
>
> % draw q withpen pxcpen withcolor darkgray;
> setbounds currentpicture to OverlayBox ; % just to be safe in case
> of
> outside focus rectangle
> endgroup;
> \stopuniqueMPgraphic
>
> no further explanations :D
>
> best wishes, peter
Peter, Wolfgang,
thanks so much! I had no idea "reverse" could work like this,
wonderful. I will try and build this into my presentation module.
Thomas
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* MetaPost Question
@ 2015-12-06 20:54 Context NTG
2015-12-06 21:49 ` Alan BRASLAU
2015-12-07 15:58 ` Context NTG
0 siblings, 2 replies; 55+ messages in thread
From: Context NTG @ 2015-12-06 20:54 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1370 bytes --]
I am trying to graph a cylinder. Is there a way to draw a more elliptic
top/bottom. This one seems some flattened at the top and bottom. I would
like to hatch the mid elliptic that is collored grey now. Is there a way to
do this.
Thanks
Jeroen
\placefigure
[here,force]
[fig:tubing]
{Tubular Linear Volumetric Capacity}
{\startMPcode
draw (0,0){up} ... (1.25cm, 2mm) ... (2.5cm,0){down} ... (1.25cm, -2mm) ...
cycle;
draw (0,0) -- (0,-5cm) dashed evenly;
draw (2.5cm,0) -- (2.5cm,-5cm) dashed evenly;
draw (0,-5cm){up} ... (1.25cm, -4.8cm) ... (2.5cm,-5cm){down} ... (1.25cm,
-5.2cm) ... cycle dashed evenly;
draw (-.2cm,0){up} ... (1.25cm, 3.5mm) ... (2.7cm,0){down} ... (1.25cm,
-3.5mm) ... cycle;
draw (-.2cm,0) -- (-.2cm,-5cm);
draw (2.7cm,0) -- (2.7cm,-5cm);
draw (-.2cm,-5cm){up} ... (1.25cm, -4.7cm) ... (2.7cm,-5cm){down} dashed
evenly;
draw (-.2cm,-5cm){down} ... (1.25cm, -5.3cm) ... (2.7cm,-5cm){up};
fill (0,-2.5cm){up} ... (1.25cm, -2.3cm) ... (2.5cm,-2.5cm){down} ...
(1.25cm, -2.7cm) ... cycle withcolor (.6,.6,.6) dashed evenly;
label.top("tubular",(1.26cm,-1.1cm));
label.top("inside area",(1.28cm,-1.6cm));
label.top("($in^2$)",(1.28cm,-2.2cm));
draw (3.25cm,-5cm) -- (3.25cm,0);
drawarrow (3.25cm,-5) -- (3.25cm,0);
drawarrow (3.25cm,0) -- (3.25cm,-5cm);
label.top("tubular length ($in$)",(5.2cm,-2.75cm));
\stopMPcode}
[-- Attachment #1.2: Type: text/html, Size: 2688 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: MetaPost Question
2015-12-06 20:54 MetaPost Question Context NTG
@ 2015-12-06 21:49 ` Alan BRASLAU
2015-12-07 15:58 ` Context NTG
1 sibling, 0 replies; 55+ messages in thread
From: Alan BRASLAU @ 2015-12-06 21:49 UTC (permalink / raw)
To: Context NTG; +Cc: mailing list for ConTeXt users
Please change your mailing name and address.
In order to draw 3D perspective diagrams in MetaPost,
you will need to transform 3D paths to a 2D projection.
There are many methods to accomplish this, and there are several MP
modules that have been written to address this issue.
One fairly simple and elegant approach is available from Urs Oswald:
http://www.ursoswald.ch/metapost/tutorial.html
Alan
On Sun, 6 Dec 2015 21:54:38 +0100
Context NTG <contextntg@gmail.com> wrote:
> I am trying to graph a cylinder. Is there a way to draw a more
> elliptic top/bottom. This one seems some flattened at the top and
> bottom. I would like to hatch the mid elliptic that is collored grey
> now. Is there a way to do this.
>
> Thanks
> Jeroen
>
>
>
> \placefigure
>
> [here,force]
>
> [fig:tubing]
>
> {Tubular Linear Volumetric Capacity}
>
> {\startMPcode
>
>
> draw (0,0){up} ... (1.25cm, 2mm) ... (2.5cm,0){down} ... (1.25cm,
> -2mm) ... cycle;
>
> draw (0,0) -- (0,-5cm) dashed evenly;
>
> draw (2.5cm,0) -- (2.5cm,-5cm) dashed evenly;
>
> draw (0,-5cm){up} ... (1.25cm, -4.8cm) ... (2.5cm,-5cm){down} ...
> (1.25cm, -5.2cm) ... cycle dashed evenly;
>
>
> draw (-.2cm,0){up} ... (1.25cm, 3.5mm) ... (2.7cm,0){down} ...
> (1.25cm, -3.5mm) ... cycle;
>
> draw (-.2cm,0) -- (-.2cm,-5cm);
>
> draw (2.7cm,0) -- (2.7cm,-5cm);
>
> draw (-.2cm,-5cm){up} ... (1.25cm, -4.7cm) ... (2.7cm,-5cm){down}
> dashed evenly;
>
> draw (-.2cm,-5cm){down} ... (1.25cm, -5.3cm) ... (2.7cm,-5cm){up};
>
>
> fill (0,-2.5cm){up} ... (1.25cm, -2.3cm) ... (2.5cm,-2.5cm){down} ...
> (1.25cm, -2.7cm) ... cycle withcolor (.6,.6,.6) dashed evenly;
>
> label.top("tubular",(1.26cm,-1.1cm));
>
> label.top("inside area",(1.28cm,-1.6cm));
>
> label.top("($in^2$)",(1.28cm,-2.2cm));
>
>
> draw (3.25cm,-5cm) -- (3.25cm,0);
>
> drawarrow (3.25cm,-5) -- (3.25cm,0);
>
> drawarrow (3.25cm,0) -- (3.25cm,-5cm);
>
> label.top("tubular length ($in$)",(5.2cm,-2.75cm));
>
>
> \stopMPcode}
--
Alan Braslau
CEA DSM-IRAMIS-SPEC
CNRS UMR 3680
Orme des Merisiers
91191 Gif-sur-Yvette cedex FRANCE
tel: +33 1 69 08 73 15
fax: +33 1 69 08 87 86
mailto:alan.braslau@cea.fr
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: MetaPost Question
2015-12-06 20:54 MetaPost Question Context NTG
2015-12-06 21:49 ` Alan BRASLAU
@ 2015-12-07 15:58 ` Context NTG
1 sibling, 0 replies; 55+ messages in thread
From: Context NTG @ 2015-12-07 15:58 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 3105 bytes --]
I guess the code I am looking for is the below to hatch the cut-out
section. How can I load the MetaPost hatching package in Context minimals
so it understands the hatchfill command?
Thanks
Jeroen
\startMPinclusions
input hatching;
\stopMPinclusions
\starttext
\placefigure[here,force][fig:tubing]{Tubular Linear Volumetric Capacity}
{\startMPcode
% inner circle
draw fullcircle xscaled 2.5cm yscaled 0.7cm shifted (1.25cm,0);
draw (0,0) -- (0,-5cm) dashed evenly;
draw (2.5cm,0) -- (2.5cm,-5cm) dashed evenly;
draw fullcircle xscaled 2.5cm yscaled 0.7cm shifted (1.25cm,-5cm) dashed
evenly;
%outer circle
draw fullcircle xscaled 2.9cm yscaled 1cm shifted (1.25cm,0);
draw (-.2cm,0) -- (-.2cm,-5cm);
draw (2.7cm,0) -- (2.7cm,-5cm);
draw halfcircle scaled 2.9cm yscaled 0.012cm shifted (1.25cm,-5cm) dashed
evenly;
draw halfcircle scaled 2.9cm yscaled 0.012cm rotated 180 shifted
(1.25cm,-5cm);
%cut-out section
hatchfill circle withcolor (45, 5mm, -.5bp);
fill fullcircle xscaled 2.5cm yscaled 0.7cm shifted (1.25cm,-2.7cm)
withcolor (.6,.6,.6);
label.top("tubular",(1.26cm,-1.3cm));
label.top("inside area",(1.28cm,-1.8cm));
label.top("($in^2$)",(1.28cm,-2.4cm));
%arrows and label ID
drawarrow (0,-4.1cm) -- (2.5cm,-4.1cm);
drawarrow (2.5cm,-4.1cm) -- (0,-4.1cm);
label.top("ID ($in$)",(1.26cm,-4.15cm));
%arrows and label tubular length
draw (3.25cm,-5cm) -- (3.25cm,0);
drawarrow (3.25cm,-5) -- (3.25cm,0);
drawarrow (3.25cm,0) -- (3.25cm,-5cm);
label.top("tubular length ($in$)",(5.2cm,-2.75cm));
\stopMPcode}
\stoptext
2015-12-06 21:54 GMT+01:00 Context NTG <contextntg@gmail.com>:
> I am trying to graph a cylinder. Is there a way to draw a more elliptic
> top/bottom. This one seems some flattened at the top and bottom. I would
> like to hatch the mid elliptic that is collored grey now. Is there a way to
> do this.
>
> Thanks
> Jeroen
>
>
>
> \placefigure
>
> [here,force]
>
> [fig:tubing]
>
> {Tubular Linear Volumetric Capacity}
>
> {\startMPcode
>
>
> draw (0,0){up} ... (1.25cm, 2mm) ... (2.5cm,0){down} ... (1.25cm, -2mm)
> ... cycle;
>
> draw (0,0) -- (0,-5cm) dashed evenly;
>
> draw (2.5cm,0) -- (2.5cm,-5cm) dashed evenly;
>
> draw (0,-5cm){up} ... (1.25cm, -4.8cm) ... (2.5cm,-5cm){down} ... (1.25cm,
> -5.2cm) ... cycle dashed evenly;
>
>
> draw (-.2cm,0){up} ... (1.25cm, 3.5mm) ... (2.7cm,0){down} ... (1.25cm,
> -3.5mm) ... cycle;
>
> draw (-.2cm,0) -- (-.2cm,-5cm);
>
> draw (2.7cm,0) -- (2.7cm,-5cm);
>
> draw (-.2cm,-5cm){up} ... (1.25cm, -4.7cm) ... (2.7cm,-5cm){down} dashed
> evenly;
>
> draw (-.2cm,-5cm){down} ... (1.25cm, -5.3cm) ... (2.7cm,-5cm){up};
>
>
> fill (0,-2.5cm){up} ... (1.25cm, -2.3cm) ... (2.5cm,-2.5cm){down} ...
> (1.25cm, -2.7cm) ... cycle withcolor (.6,.6,.6) dashed evenly;
>
> label.top("tubular",(1.26cm,-1.1cm));
>
> label.top("inside area",(1.28cm,-1.6cm));
>
> label.top("($in^2$)",(1.28cm,-2.2cm));
>
>
> draw (3.25cm,-5cm) -- (3.25cm,0);
>
> drawarrow (3.25cm,-5) -- (3.25cm,0);
>
> drawarrow (3.25cm,0) -- (3.25cm,-5cm);
>
> label.top("tubular length ($in$)",(5.2cm,-2.75cm));
>
>
> \stopMPcode}
>
[-- Attachment #1.2: Type: text/html, Size: 6548 bytes --]
[-- Attachment #2: Type: text/plain, Size: 485 bytes --]
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* metapost question
@ 2011-12-01 22:25 Hans van der Meer
2011-12-01 23:30 ` Peter Rolf
0 siblings, 1 reply; 55+ messages in thread
From: Hans van der Meer @ 2011-12-01 22:25 UTC (permalink / raw)
To: ConTeXt NTG
In MetaPost:
After putting something in a picture, one can draw its boundaries with "draw boundingbox thepicture". Is it possible to obtain at that point the dimensions of this boudingbox in order to do some calculations with them?
Hans van der Meer
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* metapost question
@ 2011-10-21 13:05 Hans van der Meer
2011-10-21 15:13 ` Peter Rolf
2011-10-21 18:02 ` Nicola
0 siblings, 2 replies; 55+ messages in thread
From: Hans van der Meer @ 2011-10-21 13:05 UTC (permalink / raw)
To: ConTeXt NTG
I cannot find the answer to the following question in Knuth's Metafont book.
The following definition with a trailing text argument:
def mydef (expr a, b, c) text modifier =
if <modifier = empty>:
else:
fi
enddef;
How can I do the switch on an empty or nonempty modifier argument? It is not a string because calling its length fails with an error.
I must do the switch, because "fill modifier" with an empty "modifier" gives horrible results.
Usage would be calls like:
mydef(1,2,3) withcolor green; % with modifier text
mydef(1,2,3); % without modifier text
Thanks in advance.
Hans van der Meer
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2011-10-21 13:05 Hans van der Meer
@ 2011-10-21 15:13 ` Peter Rolf
2011-10-21 15:34 ` Meer, H. van der
2011-10-21 18:13 ` Meer, H. van der
2011-10-21 18:02 ` Nicola
1 sibling, 2 replies; 55+ messages in thread
From: Peter Rolf @ 2011-10-21 15:13 UTC (permalink / raw)
To: ntg-context
Am 21.10.2011 15:05, schrieb Hans van der Meer:
> I cannot find the answer to the following question in Knuth's Metafont book.
> The following definition with a trailing text argument:
>
> def mydef (expr a, b, c) text modifier =
> if <modifier = empty>:
Have you already tried
if modifier = "" :
> else:
> fi
> enddef;
>
> How can I do the switch on an empty or nonempty modifier argument? It is not a string because calling its length fails with an error.
> I must do the switch, because "fill modifier" with an empty "modifier" gives horrible results.
>
> Usage would be calls like:
> mydef(1,2,3) withcolor green; % with modifier text
> mydef(1,2,3); % without modifier text
>
> Thanks in advance.
> Hans van der Meer
>
> ___________________________________________________________________________________
> 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 : 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://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2011-10-21 15:13 ` Peter Rolf
@ 2011-10-21 15:34 ` Meer, H. van der
2011-10-21 18:13 ` Meer, H. van der
1 sibling, 0 replies; 55+ messages in thread
From: Meer, H. van der @ 2011-10-21 15:34 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 21 okt. 2011, at 17:13, Peter Rolf wrote:
> Am 21.10.2011 15:05, schrieb Hans van der Meer:
>> I cannot find the answer to the following question in Knuth's Metafont book.
>> The following definition with a trailing text argument:
>>
>> def mydef (expr a, b, c) text modifier =
>> if <modifier = empty>:
>
> Have you already tried
>
> if modifier = "" :
>
>
>> else:
>> fi
>> enddef;
I tried it now, but it doesn't work. Something like
if(TEXT4)
="":;fi
in the error log. No, Metapost is not happy with this construct.
>>
>> How can I do the switch on an empty or nonempty modifier argument? It is not a string because calling its length fails with an error.
>> I must do the switch, because "fill modifier" with an empty "modifier" gives horrible results.
>>
>> Usage would be calls like:
>> mydef(1,2,3) withcolor green; % with modifier text
>> mydef(1,2,3); % without modifier text
Thanks in advance.
Hans van der Meer
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2011-10-21 15:13 ` Peter Rolf
2011-10-21 15:34 ` Meer, H. van der
@ 2011-10-21 18:13 ` Meer, H. van der
1 sibling, 0 replies; 55+ messages in thread
From: Meer, H. van der @ 2011-10-21 18:13 UTC (permalink / raw)
To: mailing list for ConTeXt users
Peter,
Thanks for trying to help. Because I solved the problem in another way you might be interested or even benefit from it.
The underlying problem was drawing a border around a picture of given dimensions. The border being either colored or left uncolored. The border color should come from a withcolor modifier, with the uncolored case done simply by leaving this out, for example:
borderinsideframe(u,v,2g);
and borderinsideframe(u,v,2g) withcolor red;
It turns out this can be done with an unfill. I learned that a bare unfill erases, but add a withcolor modifier and the effect is a coloring. Thus the trick is:
def bordercolorframe (expr w, h, off, clr) text modifier =
unfill (-off,-off)--(w+off,-off)--(w+off,h+off)--(-off,h+off)--cycle modifier;
fill (0,0)--(w,0)--(w,h)--(0,h)--cycle withcolor clr
enddef;
The omission of a semicolon after the last statement of the def allows one to add in a withcolor somecolor without triggering an error.
Hope this will be of use to someone.
Hans van der Meer
On 21 okt. 2011, at 17:13, Peter Rolf wrote:
> Am 21.10.2011 15:05, schrieb Hans van der Meer:
>> I cannot find the answer to the following question in Knuth's Metafont book.
>> The following definition with a trailing text argument:
>>
>> def mydef (expr a, b, c) text modifier =
>> if <modifier = empty>:
>
> Have you already tried
>
> if modifier = "" :
>
>> else:
>> fi
>> enddef;
>>
>> How can I do the switch on an empty or nonempty modifier argument? It is not a string because calling its length fails with an error.
>> I must do the switch, because "fill modifier" with an empty "modifier" gives horrible results.
>>
>> Usage would be calls like:
>> mydef(1,2,3) withcolor green; % with modifier text
>> mydef(1,2,3); % without modifier text
>>
>> Thanks in advance.
>> Hans van der Meer
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2011-10-21 13:05 Hans van der Meer
2011-10-21 15:13 ` Peter Rolf
@ 2011-10-21 18:02 ` Nicola
1 sibling, 0 replies; 55+ messages in thread
From: Nicola @ 2011-10-21 18:02 UTC (permalink / raw)
To: ntg-context
In article <0E2E620E-1148-41AD-9966-54A594FCCE94@xs4all.nl>,
Hans van der Meer <havdmeer@xs4all.nl> wrote:
> I cannot find the answer to the following question in Knuth's Metafont book.
> The following definition with a trailing text argument:
>
> def mydef (expr a, b, c) text modifier =
> if <modifier = empty>:
> else:
> fi
> enddef;
>
> How can I do the switch on an empty or nonempty modifier argument? It is not
> a string because calling its length fails with an error.
A text argument is a (more or less) arbitrary sequence of tokens—that is,
loosely speaking, any “chunk” of MetaPost code.
> I must do the switch, because "fill modifier" with an empty "modifier" gives
> horrible results.
>
> Usage would be calls like:
> mydef(1,2,3) withcolor green; % with modifier text
> mydef(1,2,3); % without modifier text
This is the best I could think of:
vardef emptytext?@# text t =
(str @# = "empty.sandwich")
enddef;
def mydef(expr a,b,c) text t =
if begingroup emptytext? empty t sandwich endgroup:
% t is empty
draw unitsquare scaled 1cm;
else:
% t is not empty
fill unitsquare scaled 1cm t ;
fi;
enddef;
The key is the 'emptytext? empty t sandwich;' line: if t is empty, @# matches
'empty.sandwich', otherwise it matches 'empty' possibly followed by something
else (depending on what t actually is). The undelimited text parameter of
emptytext? is needed to “swallow” whatever tokens are left (possibly none) after
matching the implicit suffix parameter. Note that begingroup and endgroup are
necessary in the if clause, otherwise emptytext?'s undelimited text parameter
will match beyond the colon.
In practice, you should rename 'sandwich' to some token that you are pretty sure
will never occur as the beginning of the text argument when you invoke mydef.
I'd be glad to hear about other solutions: this question has bugged me for some
time…
Regards,
Nicola
___________________________________________________________________________________
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 : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Metapost question
@ 2009-05-11 15:14 Jean Magnan de Bornier
2009-05-11 15:34 ` Peter Rolf
` (2 more replies)
0 siblings, 3 replies; 55+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-11 15:14 UTC (permalink / raw)
To: ntg-context
Hi all,
Trying to use mpost with (today's) minimals, I get this answer:
...................................
16:55 jean@boldair /home/jean/graph % mpost ecindf
Sorry, I can't find that mem file; will try PLAIN.
I can't find the PLAIN mem file!
...................................
Do I have to make formats or something for mpost to work?
tia,
--
Jean
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 15:14 Metapost question Jean Magnan de Bornier
@ 2009-05-11 15:34 ` Peter Rolf
2009-05-11 16:27 ` Jean Magnan de Bornier
2009-05-11 15:42 ` Mojca Miklavec
2009-05-11 15:47 ` Aditya Mahajan
2 siblings, 1 reply; 55+ messages in thread
From: Peter Rolf @ 2009-05-11 15:34 UTC (permalink / raw)
To: mailing list for ConTeXt users
Jean Magnan de Bornier schrieb:
> Hi all,
> Trying to use mpost with (today's) minimals, I get this answer:
> ...................................
> 16:55 jean@boldair /home/jean/graph % mpost ecindf
>
> Sorry, I can't find that mem file; will try PLAIN.
> I can't find the PLAIN mem file!
> ...................................
>
> Do I have to make formats or something for mpost to work?
>
>
you have to give mpost a mem(ory dump) file. something like
mpost -mem=metafun.mem <file>.mp
donno if there are more elegant ways to make it run.
hope that helps,
Peter
> tia,
>
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 15:34 ` Peter Rolf
@ 2009-05-11 16:27 ` Jean Magnan de Bornier
0 siblings, 0 replies; 55+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-11 16:27 UTC (permalink / raw)
To: ntg-context
Le 11 mai à 17:34:42 Peter Rolf <indiego@gmx.net> écrit notamment:
| Jean Magnan de Bornier schrieb:
| > Hi all,
| > Trying to use mpost with (today's) minimals, I get this answer:
| > ...................................
| > 16:55 jean@boldair /home/jean/graph % mpost ecindf
| >
| > Sorry, I can't find that mem file; will try PLAIN.
| > I can't find the PLAIN mem file!
| > ...................................
| >
| > Do I have to make formats or something for mpost to work?
| >
| >
| you have to give mpost a mem(ory dump) file. something like
>
| mpost -mem=metafun.mem <file>.mp
>
| donno if there are more elegant ways to make it run.
>
>
| hope that helps,
>
| Peter
>
| > tia,
| >
Thanks to all!
Peter and Aditya's solutions work, Mokja's doesn't..
Using Aditya's, when everything is fine, it ends up with a (seemingly
infinite) series of lines:
.......................
metafun 2009-5-11 18:20
.......................
Strange and hardly nice, I had to cut it out.
Maybe there is a problem here.
Anyway why can't we compile with just 'mpost' anymore?
Cu,
--
Jean
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 15:14 Metapost question Jean Magnan de Bornier
2009-05-11 15:34 ` Peter Rolf
@ 2009-05-11 15:42 ` Mojca Miklavec
2009-05-11 15:58 ` Mojca Miklavec
2009-05-11 17:01 ` Hans Hagen
2009-05-11 15:47 ` Aditya Mahajan
2 siblings, 2 replies; 55+ messages in thread
From: Mojca Miklavec @ 2009-05-11 15:42 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Mon, May 11, 2009 at 17:14, Jean Magnan de Bornier wrote:
> Hi all,
> Trying to use mpost with (today's) minimals, I get this answer:
> ...................................
> 16:55 jean@boldair /home/jean/graph % mpost ecindf
>
> Sorry, I can't find that mem file; will try PLAIN.
> I can't find the PLAIN mem file!
> ...................................
>
> Do I have to make formats or something for mpost to work?
texexec --make metafun
But I should probably check what goes wrong as this format should have
been generated automatically.
Hans, in the source code there is
states.set("formats.cont-en", true)
states.set("formats.cont-nl", true)
states.set("formats.metafun", true)
Maybe mpost should be added there as well (though I didn't test yet if
that indeed helps).
Mojca
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 15:42 ` Mojca Miklavec
@ 2009-05-11 15:58 ` Mojca Miklavec
2009-05-11 16:31 ` Jean Magnan de Bornier
2009-05-11 17:01 ` Hans Hagen
1 sibling, 1 reply; 55+ messages in thread
From: Mojca Miklavec @ 2009-05-11 15:58 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Mon, May 11, 2009 at 17:42, Mojca Miklavec wrote:
> On Mon, May 11, 2009 at 17:14, Jean Magnan de Bornier wrote:
>> Hi all,
>> Trying to use mpost with (today's) minimals, I get this answer:
>> ...................................
>> 16:55 jean@boldair /home/jean/graph % mpost ecindf
>>
>> Sorry, I can't find that mem file; will try PLAIN.
>> I can't find the PLAIN mem file!
>> ...................................
>>
>> Do I have to make formats or something for mpost to work?
>
> texexec --make metafun
Sorry, I meant
texexec --make mpost
Though it's indeed true that you can use
mpost --mem=metafun ecindf
or the ConTeXt interface
\x7f
But these formats should be made by default.
Mojca
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 15:58 ` Mojca Miklavec
@ 2009-05-11 16:31 ` Jean Magnan de Bornier
2009-05-11 16:52 ` Mojca Miklavec
0 siblings, 1 reply; 55+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-11 16:31 UTC (permalink / raw)
To: ntg-context
Le 11 mai à 17:58:32 Mojca Miklavec <mojca.miklavec.lists@gmail.com> écrit notamment:
| On Mon, May 11, 2009 at 17:42, Mojca Miklavec wrote:
| > On Mon, May 11, 2009 at 17:14, Jean Magnan de Bornier wrote:
| >> Hi all,
| >> Trying to use mpost with (today's) minimals, I get this answer:
| >> ...................................
| >> 16:55 jean@boldair /home/jean/graph % mpost ecindf
| >>
| >> Sorry, I can't find that mem file; will try PLAIN.
| >> I can't find the PLAIN mem file!
| >> ...................................
| >>
| >> Do I have to make formats or something for mpost to work?
| >
| > texexec --make metafun
>
| Sorry, I meant
| texexec --make mpost
>
| Though it's indeed true that you can use
| mpost --mem=metafun ecindf
| or the ConTeXt interface
| \x7f
| But these formats should be made by default.
>
| Mojca
Ah yes, much better!
But then I still have unending the
...................
metafun 2009-5-11 18:30
metafun 2009-5-11 18:30
metafun 2009-5-11 18:30
metafun 2009-5-11 18:30
metafun 2009-5-11 18:30
metafun 2009-5-11 18:30
metafun 2009-5-11 18:30
metafun 2009-5-11 18:30
..................
??
--
Jean
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 16:31 ` Jean Magnan de Bornier
@ 2009-05-11 16:52 ` Mojca Miklavec
2009-05-11 17:33 ` Jean Magnan de Bornier
0 siblings, 1 reply; 55+ messages in thread
From: Mojca Miklavec @ 2009-05-11 16:52 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Mon, May 11, 2009 at 18:31, Jean Magnan de Bornier wrote:
> Le 11 mai à 17:58:32 Mojca Miklavec écrit notamment:
>
> | Sorry, I meant
> | texexec --make mpost
>>
> | Though it's indeed true that you can use
> | mpost --mem=metafun ecindf
> | or the ConTeXt interface
> |
> | But these formats should be made by default.
>>
> | Mojca
>
> Ah yes, much better!
>
> But then I still have unending the
> ...................
> metafun 2009-5-11 18:30
> metafun 2009-5-11 18:30
> metafun 2009-5-11 18:30
> metafun 2009-5-11 18:30
> metafun 2009-5-11 18:30
> metafun 2009-5-11 18:30
> metafun 2009-5-11 18:30
> metafun 2009-5-11 18:30
> ..................
Which command does that evil? They both seem to work here ...
Mojca
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 16:52 ` Mojca Miklavec
@ 2009-05-11 17:33 ` Jean Magnan de Bornier
2009-05-11 18:02 ` Mojca Miklavec
2009-05-11 18:16 ` Jean Magnan de Bornier
0 siblings, 2 replies; 55+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-11 17:33 UTC (permalink / raw)
To: ntg-context
Le 11 mai à 18:52:08 Mojca Miklavec <mojca.miklavec.lists@gmail.com> écrit notamment:
| > But then I still have unending the
| > ...................
| > metafun 2009-5-11 18:30
| > metafun 2009-5-11 18:30
| > metafun 2009-5-11 18:30
| > metafun 2009-5-11 18:30
| > metafun 2009-5-11 18:30
| > metafun 2009-5-11 18:30
| > metafun 2009-5-11 18:30
| > metafun 2009-5-11 18:30
| > ..................
>
| Which command does that evil? They both seem to work here ...
mpost, texexec --mpgraphic, mpost -mem=metafun.mem, all three of them!
--
Jean
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 17:33 ` Jean Magnan de Bornier
@ 2009-05-11 18:02 ` Mojca Miklavec
2009-05-12 4:33 ` Jean Magnan de Bornier
2009-05-11 18:16 ` Jean Magnan de Bornier
1 sibling, 1 reply; 55+ messages in thread
From: Mojca Miklavec @ 2009-05-11 18:02 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Mon, May 11, 2009 at 19:33, Jean Magnan de Bornier wrote:
> Le 11 mai à 18:52:08 Mojca Miklavec écrit notamment:
>
> | > But then I still have unending the
> | > ...................
> | > metafun 2009-5-11 18:30
> | > metafun 2009-5-11 18:30
> | > metafun 2009-5-11 18:30
> | > metafun 2009-5-11 18:30
> | > metafun 2009-5-11 18:30
> | > metafun 2009-5-11 18:30
> | > metafun 2009-5-11 18:30
> | > metafun 2009-5-11 18:30
> | > ..................
>>
> | Which command does that evil? They both seem to work here ...
>
> mpost, texexec --mpgraphic, mpost -mem=metafun.mem, all three of them!
I don't understand. Can you please post the whole log. You cannot get
metafun warnings when running just "mpost" unless something is set up
in some really weird way. I could imagine that there could be some
infinite loop in some metafun macro, but I cannot imagine why mpost
would fall into infinite loop.
Mojca
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 18:02 ` Mojca Miklavec
@ 2009-05-12 4:33 ` Jean Magnan de Bornier
2009-05-12 7:42 ` Taco Hoekwater
0 siblings, 1 reply; 55+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-12 4:33 UTC (permalink / raw)
To: ntg-context
Le 11 mai à 20:02:36 Mojca Miklavec <mojca.miklavec.lists@gmail.com> écrit notamment:
| > | Which command does that evil? They both seem to work here ...
| >
| > mpost, texexec --mpgraphic, mpost -mem=metafun.mem, all three of them!
>
| I don't understand. Can you please post the whole log. You cannot get
| metafun warnings when running just "mpost" unless something is set up
| in some really weird way. I could imagine that there could be some
| infinite loop in some metafun macro, but I cannot imagine why mpost
| would fall into infinite loop.
I have stopped compilation after no more than 30 seconds, the log is 14MB
large with many lines:
............................
06:25 jean@boldair /home/jean/graph % wc -l ecindf.log
644385 ecindf.log
............................
After eliminating duplicates, here it is:
..................................
This is MetaPost, version 1.200 (kpathsea version 3.5.7dev) (mem=metafun 2009.05.11) 11 MAY 2009 19:56
**cindf
(/home/jean/context/tex/texmf-context/metapost/context/base/metafun.mp (/home/jean/context/tex/texmf-context/metapost/context/base/mp-tool.mp) (/home/jean/context/tex/texmf-context/metapost/context/base/mp-spec.mp)
(/home/jean/context/tex/texmf-context/metapost/context/base/mp-core.mp) (/home/jean/context/tex/texmf-context/metapost/context/base/mp-page.mp) (/home/jean/context/tex/texmf-context/metapost/context/base/mp-text.mp)
(/home/jean/context/tex/texmf-context/metapost/context/base/mp-txts.mp) (/home/jean/context/tex/texmf-context/metapost/context/base/mp-shap.mp) (/home/jean/context/tex/texmf-context/metapost/context/base/mp-butt.mp)
(/home/jean/context/tex/texmf-context/metapost/context/base/mp-char.mp) (/home/jean/context/tex/texmf-context/metapost/context/base/mp-step.mp) (/home/jean/context/tex/texmf-context/metapost/context/base/mp-grph.mp)
(/home/jean/context/tex/texmf-context/metapost/context/base/mp-figs.mp) (/home/jean/context/tex/texmf-context/metapost/context/base/mp-mlib.mp) (/home/jean/context/tex/texmf-context/metapost/context/base/mp-grid.mp)
(/home/jean/context/tex/texmf-context/metapost/context/base/mp-func.mp)) (/home/jean/context/tex/texmf/metapost/base/graph.mp) [1
Warning: cannot open font map file psfonts.map
] [2] [3
Warning: cannot open font map file psfonts.map
] [4] [5] [6] [7
Warning: cannot open font map file psfonts.map
] [8] [9] [10
Warning: cannot open font map file psfonts.map
] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25]
metafun 2009-5-11 19:56
metafun 2009-
................................
I had noticed the warning but have no idea what it leads to...
tia
--
Jean
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-12 4:33 ` Jean Magnan de Bornier
@ 2009-05-12 7:42 ` Taco Hoekwater
2009-05-12 14:15 ` Jean Magnan de Bornier
0 siblings, 1 reply; 55+ messages in thread
From: Taco Hoekwater @ 2009-05-12 7:42 UTC (permalink / raw)
To: mailing list for ConTeXt users
Jean Magnan de Bornier wrote:
> Le 11 mai à 20:02:36 Mojca Miklavec <mojca.miklavec.lists@gmail.com> écrit notamment:
>
> | > | Which command does that evil? They both seem to work here ...
> | >
> | > mpost, texexec --mpgraphic, mpost -mem=metafun.mem, all three of them!
> | I don't understand. Can you please post the whole log. You cannot get
> | metafun warnings when running just "mpost" unless something is set up
> | in some really weird way. I could imagine that there could be some
> | infinite loop in some metafun macro, but I cannot imagine why mpost
> | would fall into infinite loop.
>
> I have stopped compilation after no more than 30 seconds, the log is 14MB
> large with many lines:
It looks like you should also post ecindf.mp so we can try for
ourselves (or did I miss that?).
Best wishes,
Taco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-12 7:42 ` Taco Hoekwater
@ 2009-05-12 14:15 ` Jean Magnan de Bornier
2009-05-12 14:32 ` Aditya Mahajan
0 siblings, 1 reply; 55+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-12 14:15 UTC (permalink / raw)
To: ntg-context
Le 12 mai à 09:42:29 Taco Hoekwater <taco@elvenkind.com> écrit notamment:
| Jean Magnan de Bornier wrote:
| > Le 11 mai à 20:02:36 Mojca Miklavec <mojca.miklavec.lists@gmail.com> écrit notamment:
| >
| > | > | Which command does that evil? They both seem to work here ...
| > | >
| > | > mpost, texexec --mpgraphic, mpost -mem=metafun.mem, all three of them!
| > | I don't understand. Can you please post the whole log. You cannot get
| > | metafun warnings when running just "mpost" unless something is set up
| > | in some really weird way. I could imagine that there could be some
| > | infinite loop in some metafun macro, but I cannot imagine why mpost
| > | would fall into infinite loop.
| >
| > I have stopped compilation after no more than 30 seconds, the log is 14MB
| > large with many lines:
>
| It looks like you should also post ecindf.mp so we can try for
| ourselves (or did I miss that?).
OK, here's a test file that works as expected:
...........................
numeric u; u=.5cm;
path AX; AX = drawdblarrow (10u,0) -- (0,0) -- (0,10u);
beginfig(1);
draw AX;
label.lft(btex Coûts, prix etex rotated 90, (-.2u,8u));
label.bot(btex Quantités etex, (8u,0));
for i=0 step u until 9u:
draw (i,u/20)--(i,0);
draw (u/20,i)--(0,i);
endfor;
picture ax; ax := currentpicture;
endfig;
............................
No need for metafun here, but for other pictures I use it; and if I add
« input metafun;» at the top I get the unending message!
--
Jean
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-12 14:15 ` Jean Magnan de Bornier
@ 2009-05-12 14:32 ` Aditya Mahajan
2009-05-12 15:11 ` Jean Magnan de Bornier
0 siblings, 1 reply; 55+ messages in thread
From: Aditya Mahajan @ 2009-05-12 14:32 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1131 bytes --]
On Tue, 12 May 2009, Jean Magnan de Bornier wrote:
> Le 12 mai à 09:42:29 Taco Hoekwater <taco@elvenkind.com> écrit notamment:
>
> | Jean Magnan de Bornier wrote:
> | > Le 11 mai à 20:02:36 Mojca Miklavec <mojca.miklavec.lists@gmail.com> écrit notamment:
> | >
> | > | > | Which command does that evil? They both seem to work here ...
> | > | >
> | > | > mpost, texexec --mpgraphic, mpost -mem=metafun.mem, all three of them!
> | > | I don't understand. Can you please post the whole log. You cannot get
> | > | metafun warnings when running just "mpost" unless something is set up
> | > | in some really weird way. I could imagine that there could be some
> | > | infinite loop in some metafun macro, but I cannot imagine why mpost
> | > | would fall into infinite loop.
> | >
> | > I have stopped compilation after no more than 30 seconds, the log is 14MB
> | > large with many lines:
>>
> | It looks like you should also post ecindf.mp so we can try for
> | ourselves (or did I miss that?).
>
> OK, here's a test file that works as expected:
>
Can you post a file that fails at your end?
Aditya
[-- Attachment #2: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-12 14:32 ` Aditya Mahajan
@ 2009-05-12 15:11 ` Jean Magnan de Bornier
2009-05-12 15:53 ` Taco Hoekwater
0 siblings, 1 reply; 55+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-12 15:11 UTC (permalink / raw)
To: ntg-context
Le 12 mai à 16:32:26 Aditya Mahajan <adityam@umich.edu> écrit notamment:
| Can you post a file that fails at your end?
here, but it doesn't *fail*, it produces ecindf.1 ok but then shows
infinitely this message.
...................
input metafun;
numeric u; u=.5cm;
path AX; AX = drawdblarrow (10u,0) -- (0,0) -- (0,10u);
beginfig(1);
draw AX;
label.lft(btex Coûts, prix etex rotated 90, (-.2u,8u));
label.bot(btex Quantités etex, (8u,0));
for i=0 step u until 9u:
draw (i,u/20)--(i,0);
draw (u/20,i)--(0,i);
endfor;
picture ax; ax := currentpicture;
endfig;
end
...........................
--
Jean
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 17:33 ` Jean Magnan de Bornier
2009-05-11 18:02 ` Mojca Miklavec
@ 2009-05-11 18:16 ` Jean Magnan de Bornier
1 sibling, 0 replies; 55+ messages in thread
From: Jean Magnan de Bornier @ 2009-05-11 18:16 UTC (permalink / raw)
To: ntg-context
Le 11 mai à 19:33:01 Jean Magnan de Bornier <jm.bornier@free.fr> écrit notamment:
| Le 11 mai à 18:52:08 Mojca Miklavec <mojca.miklavec.lists@gmail.com> écrit notamment:
>
| | > But then I still have unending the
| | > ...................
| | > metafun 2009-5-11 18:30
| | > metafun 2009-5-11 18:30
| | > metafun 2009-5-11 18:30
| | > metafun 2009-5-11 18:30
| | > metafun 2009-5-11 18:30
| | > metafun 2009-5-11 18:30
| | > metafun 2009-5-11 18:30
| | > metafun 2009-5-11 18:30
| | > ..................
| >
| | Which command does that evil? They both seem to work here ...
>
| mpost, texexec --mpgraphic, mpost -mem=metafun.mem, all three of them!
I had to make the format for mptopdf too, and it doesn't work: same
endless message, but before success :-(
--
Jean
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 15:42 ` Mojca Miklavec
2009-05-11 15:58 ` Mojca Miklavec
@ 2009-05-11 17:01 ` Hans Hagen
2009-05-11 18:08 ` Mojca Miklavec
1 sibling, 1 reply; 55+ messages in thread
From: Hans Hagen @ 2009-05-11 17:01 UTC (permalink / raw)
To: mailing list for ConTeXt users
Mojca Miklavec wrote:
> On Mon, May 11, 2009 at 17:14, Jean Magnan de Bornier wrote:
>> Hi all,
>> Trying to use mpost with (today's) minimals, I get this answer:
>> ...................................
>> 16:55 jean@boldair /home/jean/graph % mpost ecindf
>>
>> Sorry, I can't find that mem file; will try PLAIN.
>> I can't find the PLAIN mem file!
>> ...................................
>>
>> Do I have to make formats or something for mpost to work?
>
> texexec --make metafun
>
> But I should probably check what goes wrong as this format should have
> been generated automatically.
>
> Hans, in the source code there is
> states.set("formats.cont-en", true)
> states.set("formats.cont-nl", true)
> states.set("formats.metafun", true)
> Maybe mpost should be added there as well (though I didn't test yet if
> that indeed helps).
maybe ... if someone is using mp directly in context -)
in luatex/mkiv formats are generated on the fly
-----------------------------------------------------------------
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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2009-05-11 15:14 Metapost question Jean Magnan de Bornier
2009-05-11 15:34 ` Peter Rolf
2009-05-11 15:42 ` Mojca Miklavec
@ 2009-05-11 15:47 ` Aditya Mahajan
2 siblings, 0 replies; 55+ messages in thread
From: Aditya Mahajan @ 2009-05-11 15:47 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Mon, 11 May 2009, Jean Magnan de Bornier wrote:
> Hi all,
> Trying to use mpost with (today's) minimals, I get this answer:
> ...................................
> 16:55 jean@boldair /home/jean/graph % mpost ecindf
>
> Sorry, I can't find that mem file; will try PLAIN.
> I can't find the PLAIN mem file!
> ...................................
>
> Do I have to make formats or something for mpost to work?
You can also use the texexec interface (which uses metafun format)
texexec --mpgraphic file.mp
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* metapost question
@ 2007-10-08 13:47 Thomas A. Schmitz
2007-10-08 16:49 ` Otared Kavian
0 siblings, 1 reply; 55+ messages in thread
From: Thomas A. Schmitz @ 2007-10-08 13:47 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1: Type: text/plain, Size: 184 bytes --]
Just because I hope that someone may have done this already: does
anyone have metapost code to draw the "Platonic solids" (I hope the
attachment comes through).
All best
Thomas
[-- Attachment #2: platonic.png --]
[-- Type: image/png, Size: 21993 bytes --]
[-- Attachment #3: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2007-10-08 13:47 metapost question Thomas A. Schmitz
@ 2007-10-08 16:49 ` Otared Kavian
2007-10-08 17:34 ` Thomas A. Schmitz
2007-10-08 18:10 ` Jesse Alama
0 siblings, 2 replies; 55+ messages in thread
From: Otared Kavian @ 2007-10-08 16:49 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi Thomas,
I think you can find what you are looking for at:
http://melusine.eu.org/syracuse/poulecl/albums/espace3/
Best regards: OK
On 8 oct. 2007, at 15:47, Thomas A. Schmitz wrote:
> Just because I hope that someone may have done this already: does
> anyone have metapost code to draw the "Platonic solids" (I hope the
> attachment comes through).
>
> All best
>
> Thomas
>
> <platonic.png>
> ______________________________________________________________________
> _____________
> 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
> ______________________________________________________________________
> _____________
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2007-10-08 16:49 ` Otared Kavian
@ 2007-10-08 17:34 ` Thomas A. Schmitz
2007-10-08 18:10 ` Jesse Alama
1 sibling, 0 replies; 55+ messages in thread
From: Thomas A. Schmitz @ 2007-10-08 17:34 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Oct 8, 2007, at 6:49 PM, Otared Kavian wrote:
> Hi Thomas,
>
> I think you can find what you are looking for at:
>
> http://melusine.eu.org/syracuse/poulecl/albums/espace3/
>
> Best regards: OK
>
Thanks, Otared! It took me a while to find out how to navigate the
site, but this really looks like it has exactly what I need! Thanks
so much! French matheux simply are the best...
All best
Thomas
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2007-10-08 16:49 ` Otared Kavian
2007-10-08 17:34 ` Thomas A. Schmitz
@ 2007-10-08 18:10 ` Jesse Alama
2007-10-23 12:17 ` Thomas A. Schmitz
1 sibling, 1 reply; 55+ messages in thread
From: Jesse Alama @ 2007-10-08 18:10 UTC (permalink / raw)
To: ntg-context
And here's a page dedicated to the MetaPost package that's used for
those polyhedra:
http://melusine.eu.org/syracuse/poulecl/geometriesyr16/
Download:
http://melusine.eu.org/syracuse/poulecl/geometriesyr16/distrib/geometriesyr16.tgz
Jesse
Otared Kavian <otared@gmail.com> writes:
> Hi Thomas,
>
> I think you can find what you are looking for at:
>
> http://melusine.eu.org/syracuse/poulecl/albums/espace3/
>
> Best regards: OK
>
> On 8 oct. 2007, at 15:47, Thomas A. Schmitz wrote:
>
>> Just because I hope that someone may have done this already: does
>> anyone have metapost code to draw the "Platonic solids" (I hope the
>> attachment comes through).
>>
>> All best
>>
>> Thomas
>>
>> <platonic.png>
>> ______________________________________________________________________
>> _____________
>> 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
>> ______________________________________________________________________
>> _____________
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>
--
Jesse Alama (alama@stanford.edu)
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: metapost question
2007-10-08 18:10 ` Jesse Alama
@ 2007-10-23 12:17 ` Thomas A. Schmitz
2007-10-23 12:26 ` Hans Hagen
0 siblings, 1 reply; 55+ messages in thread
From: Thomas A. Schmitz @ 2007-10-23 12:17 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1.1: Type: text/plain, Size: 1232 bytes --]
Just wanted to renew my thanks. I used the code from these pages to
produce the slides for my lecture, and I really liked the way the
polyhedra came out. I always got an error about a "redundant
equation" when compiling, but the pdf looks fine. So here's the link
(the image with the Platonic solids is on p. 35):
http://www.uni-bonn.de/www/Philologie/Personal/Schmitz/Dateien/bilder/
07_10_23.pdf
Thanks
Thomas
On Oct 8, 2007, at 8:10 PM, Jesse Alama wrote:
> And here's a page dedicated to the MetaPost package that's used for
> those polyhedra:
>
> http://melusine.eu.org/syracuse/poulecl/geometriesyr16/
>
> Download:
>
> http://melusine.eu.org/syracuse/poulecl/geometriesyr16/distrib/
> geometriesyr16.tgz
>
> Jesse
>
> Otared Kavian <otared@gmail.com> writes:
>
>> Hi Thomas,
>>
>> I think you can find what you are looking for at:
>>
>> http://melusine.eu.org/syracuse/poulecl/albums/espace3/
>>
>> Best regards: OK
>>
>> On 8 oct. 2007, at 15:47, Thomas A. Schmitz wrote:
>>
>>> Just because I hope that someone may have done this already: does
>>> anyone have metapost code to draw the "Platonic solids" (I hope the
>>> attachment comes through).
>>>
>>> All best
>>>
>>> Thomas
>>>
>>> <platonic.png>
[-- Attachment #1.2: Type: text/html, Size: 5786 bytes --]
[-- Attachment #2: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* MetaPost question
@ 2007-06-28 17:27 Tobias Burnus
2007-06-28 17:48 ` Taco Hoekwater
0 siblings, 1 reply; 55+ messages in thread
From: Tobias Burnus @ 2007-06-28 17:27 UTC (permalink / raw)
To: mailing list for ConTeXt users
[-- Attachment #1: Type: text/plain, Size: 294 bytes --]
Hello,
I try to print a periodic table in MP+TeX, but I get the following error
if I uncomment the "%" lines; I fail to see my error. Is there any trick
to debug this?
The error is:
! mpx file ended unexpectedly.
l.3186 <- line number depends on which line is outcommented
Thanks,
Tobias
[-- Attachment #2: periodaux.tex --]
[-- Type: application/x-tex, Size: 279 bytes --]
[-- Attachment #3: periodic.mp --]
[-- Type: text/plain, Size: 23993 bytes --]
% Run as: TEX='texmfstart texexec --dvi --batch --once' mpost
input mp-tool ; % some initializations and auxiliary macros
input mp-spec ;
verbatimtex \enableregime[utf] etex;
verbatimtex \input periodaux etex;
def element(expr y, x, Sym, Z, M, name, altname, conf) =
draw thelabel.rt (Z, (x-1mm,-y+15mm));
draw thelabel.lft (Sym, (x+14.9mm,-y+15.3mm));
draw thelabel.bot (name, (x+6.75mm,-y+13mm));
draw thelabel.bot (altname, (x+6.75mm,-y+10.9mm));
draw thelabel.bot (M, (x+6.75mm,-y+8.8mm));
draw thelabel.bot (conf, (x+6.75mm,-y+6.7mm));
draw (x+0,-y+0)--(x+15mm,-y+0mm)--(x+15mm,-y+18mm)--(x+0mm,-y+18mm)--cycle;
enddef;
dx=15mm;
dy=18mm;
beginfig(1)
draw thelabel.bot (btex \tfa Periodic Table etex, (8.5*dx,0*dy));
element(1*dy, 1*dx, (btex \pSym{H} etex), (btex \pZ{1} etex),
(btex \pM{1.00794} etex), (btex \pName{Hydrogen} etex),
(btex \pAltName{Wasserstoff} etex), (btex \pConf{$1s$} etex));
element(1*dy, 18*dx, (btex \pSym{He} etex), (btex \pZ{2} etex),
(btex \pM{4.002602} etex), (btex \pName{Helium} etex),
(btex \pAltName{Helium} etex), (btex \pConf{$1s^2$} etex));
element(2*dy, 1*dx, (btex \pSym{Li} etex), (btex \pZ{3} etex),
(btex \pM{5.3917} etex), (btex \pName{Lithium} etex),
(btex \pAltName{Lithium} etex), (btex \pConf{$1s^22s$} etex));
element(2*dy, 2*dx, (btex \pSym{Be} etex), (btex \pZ{4} etex),
(btex \pM{9.3227} etex), (btex \pName{Beryllium} etex),
(btex \pAltName{Beryllium} etex), (btex \pConf{$1s^22s^2$} etex));
element(2*dy, 13*dx, (btex \pSym{B} etex), (btex \pZ{5} etex),
(btex \pM{10.811} etex), (btex \pName{Boron} etex),
(btex \pAltName{Bor} etex), (btex \pConf{$1s^22s^22p$} etex));
element(2*dy, 14*dx, (btex \pSym{C} etex), (btex \pZ{6} etex),
(btex \pM{12.0107} etex), (btex \pName{Carbon} etex),
(btex \pAltName{Kohlenstoff} etex), (btex \pConf{$1s^22s^22p^2$} etex));
element(2*dy, 15*dx, (btex \pSym{N} etex), (btex \pZ{7} etex),
(btex \pM{14.0067} etex), (btex \pName{Nitrogen} etex),
(btex \pAltName{Stickstoff} etex), (btex \pConf{$1s^22s^22p^3$} etex));
element(2*dy, 16*dx, (btex \pSym{O} etex), (btex \pZ{8} etex),
(btex \pM{15.9994} etex), (btex \pName{Oxygen} etex),
(btex \pAltName{Sauerstoff} etex), (btex \pConf{$1s^22s^22p^4$} etex));
element(2*dy, 17*dx, (btex \pSym{F} etex), (btex \pZ{9} etex),
(btex \pM{18.9984032} etex), (btex \pName{Fluorine} etex),
(btex \pAltName{Fluor} etex), (btex \pConf{$1s^22s^22p^5$} etex));
element(2*dy, 18*dx, (btex \pSym{Ne} etex), (btex \pZ{10} etex),
(btex \pM{20.1797} etex), (btex \pName{Neon} etex),
(btex \pAltName{Neon} etex), (btex \pConf{$1s^22s^22p^6$} etex));
element(3*dy, 1*dx, (btex \pSym{Na} etex), (btex \pZ{11} etex),
(btex \pM{22.989770} etex), (btex \pName{Sodium} etex),
(btex \pAltName{Natrium} etex), (btex \pConf{[Ne]$3s$} etex));
element(3*dy, 2*dx, (btex \pSym{Mg} etex), (btex \pZ{12} etex),
(btex \pM{24.3050} etex), (btex \pName{Magnesium} etex),
(btex \pAltName{Magnesium} etex), (btex \pConf{[Ne]$3s^2$} etex));
element(3*dy, 13*dx, (btex \pSym{Al} etex), (btex \pZ{13} etex),
(btex \pM{26.981538} etex), (btex \pName{Aluminium} etex),
(btex \pAltName{Aluminium} etex), (btex \pConf{[Ne]$3s^23p$} etex));
element(3*dy, 14*dx, (btex \pSym{Si} etex), (btex \pZ{14} etex),
(btex \pM{28.0855} etex), (btex \pName{Silicon} etex),
(btex \pAltName{Silizium} etex), (btex \pConf{[Ne]$3s^23p^2$} etex));
element(3*dy, 15*dx, (btex \pSym{P} etex), (btex \pZ{15} etex),
(btex \pM{30.973761} etex), (btex \pName{Phosphorus} etex),
(btex \pAltName{Phosphor} etex), (btex \pConf{[Ne]$3s^23p^3$} etex));
element(3*dy, 16*dx, (btex \pSym{S} etex), (btex \pZ{16} etex),
(btex \pM{32.065} etex), (btex \pName{Sulfur} etex),
(btex \pAltName{Schwefel} etex), (btex \pConf{[Ne]$3s^23p^4$} etex));
element(3*dy, 17*dx, (btex \pSym{Cl} etex), (btex \pZ{17} etex),
(btex \pM{35.453} etex), (btex \pName{Chlorine} etex),
(btex \pAltName{Chlor} etex), (btex \pConf{[Ne]$3s^23p^5$} etex));
element(3*dy, 18*dx, (btex \pSym{Ar} etex), (btex \pZ{18} etex),
(btex \pM{39.948} etex), (btex \pName{Argon} etex),
(btex \pAltName{Argon} etex), (btex \pConf{[Ne]$3s^23p^6$} etex));
element(4*dy, 1*dx, (btex \pSym{K} etex), (btex \pZ{19} etex),
(btex \pM{} etex), (btex \pName{Potassium} etex),
(btex \pAltName{Kalium} etex), (btex \pConf{[Ar]$4s$} etex));
element(4*dy, 2*dx, (btex \pSym{Ca} etex), (btex \pZ{20} etex),
(btex \pM{} etex), (btex \pName{Calcium} etex),
(btex \pAltName{} etex), (btex \pConf{Calcium} etex));
element(4*dy, 3*dx, (btex \pSym{Sc} etex), (btex \pZ{21} etex),
(btex \pM{} etex), (btex \pName{Scandium} etex),
(btex \pAltName{Scandium} etex), (btex \pConf{[Ar]$3d4s^2$} etex));
element(4*dy, 4*dx, (btex \pSym{Ti} etex), (btex \pZ{22} etex),
(btex \pM{} etex), (btex \pName{Titanium} etex),
(btex \pAltName{Titan} etex), (btex \pConf{[Ar]$3d^24s^2$} etex));
element(4*dy, 5*dx, (btex \pSym{V} etex), (btex \pZ{23} etex),
(btex \pM{} etex), (btex \pName{Vanadium} etex),
(btex \pAltName{Vanadium} etex), (btex \pConf{[Ar]$3d^34s^2$} etex));
element(4*dy, 6*dx, (btex \pSym{Cr} etex), (btex \pZ{24} etex),
(btex \pM{} etex), (btex \pName{Chromium} etex),
(btex \pAltName{Chrom} etex), (btex \pConf{[Ar]$3d^54s$} etex));
element(4*dy, 7*dx, (btex \pSym{Mn} etex), (btex \pZ{25} etex),
(btex \pM{} etex), (btex \pName{Manganese} etex),
(btex \pAltName{Mangan} etex), (btex \pConf{[Ar]$3d^54s^2$} etex));
element(4*dy, 8*dx, (btex \pSym{Fe} etex), (btex \pZ{26} etex),
(btex \pM{} etex), (btex \pName{Iron} etex),
(btex \pAltName{Eisen} etex), (btex \pConf{[Ar]$3d^64s^2$} etex));
element(4*dy, 9*dx, (btex \pSym{Co} etex), (btex \pZ{27} etex),
(btex \pM{} etex), (btex \pName{Cobalt} etex),
(btex \pAltName{Kobalt} etex), (btex \pConf{[Ar]$3d^74s^2$} etex));
element(4*dy, 10*dx, (btex \pSym{Ni} etex), (btex \pZ{28} etex),
(btex \pM{} etex), (btex \pName{Nickel} etex),
(btex \pAltName{Nickel} etex), (btex \pConf{[Ar]$3d^84s^2$} etex));
element(4*dy, 11*dx, (btex \pSym{Cu} etex), (btex \pZ{29} etex),
(btex \pM{} etex), (btex \pName{Copper} etex),
(btex \pAltName{Kupfer} etex), (btex \pConf{[Ar]$3d^{10}4s$} etex));
element(4*dy, 12*dx, (btex \pSym{Zn} etex), (btex \pZ{30} etex),
(btex \pM{} etex), (btex \pName{Zinc} etex),
(btex \pAltName{Zink} etex), (btex \pConf{[Ar]$3d^{10}4s^2$} etex));
element(4*dy, 13*dx, (btex \pSym{Ga} etex), (btex \pZ{31} etex),
(btex \pM{} etex), (btex \pName{Gallium} etex),
(btex \pAltName{Gallium} etex), (btex \pConf{[Ar]$3d^{10}4s^24p$} etex));
element(4*dy, 14*dx, (btex \pSym{Ge} etex), (btex \pZ{32} etex),
(btex \pM{} etex), (btex \pName{Germanium} etex),
(btex \pAltName{Germanium} etex), (btex \pConf{[Ar]$3d^{10}4s^24p^2$} etex));
element(4*dy, 15*dx, (btex \pSym{As} etex), (btex \pZ{33} etex),
(btex \pM{} etex), (btex \pName{Arsenic} etex),
(btex \pAltName{Arsen} etex), (btex \pConf{[Ar]$3d^{10}4s^24p^3$} etex));
element(4*dy, 16*dx, (btex \pSym{Se} etex), (btex \pZ{34} etex),
(btex \pM{} etex), (btex \pName{Selenium} etex),
(btex \pAltName{Selen} etex), (btex \pConf{[Ar]$3d^{10}4s^24p^4$} etex));
element(4*dy, 17*dx, (btex \pSym{Br} etex), (btex \pZ{35} etex),
(btex \pM{} etex), (btex \pName{Bromine} etex),
(btex \pAltName{Brom} etex), (btex \pConf{[Ar]$3d^{10}4s^24p^5$} etex));
element(4*dy, 18*dx, (btex \pSym{Kr} etex), (btex \pZ{36} etex),
(btex \pM{} etex), (btex \pName{Krypton} etex),
(btex \pAltName{Krypton} etex), (btex \pConf{[Ar]$3d^{10}4s^24p^6$} etex));
%element(5*dy, 1*dx, (btex \pSym{Rb} etex), (btex \pZ{37} etex),
% (btex \pM{} etex), (btex \pName{Rubidium} etex),
% (btex \pAltName{Rubidium} etex), (btex \pConf{[Kr}$5s$} etex));
element(5*dy, 2*dx, (btex \pSym{Sr} etex), (btex \pZ{38} etex),
(btex \pM{} etex), (btex \pName{Strontium} etex),
(btex \pAltName{Strontium} etex), (btex \pConf{[Kr]$5s^2$} etex));
element(5*dy, 3*dx, (btex \pSym{Y} etex), (btex \pZ{39} etex),
(btex \pM{} etex), (btex \pName{Yttrium} etex),
(btex \pAltName{Yttrium} etex), (btex \pConf{[Kr]$4d5s^2$} etex));
element(5*dy, 4*dx, (btex \pSym{Zr} etex), (btex \pZ{40} etex),
(btex \pM{} etex), (btex \pName{Zirconium} etex),
(btex \pAltName{Zirkonium} etex), (btex \pConf{[Kr]$4d^25s^2$} etex));
element(5*dy, 5*dx, (btex \pSym{Nb} etex), (btex \pZ{41} etex),
(btex \pM{} etex), (btex \pName{Niobium} etex),
(btex \pAltName{Niob} etex), (btex \pConf{[Kr]$4d^45s$} etex));
element(5*dy, 6*dx, (btex \pSym{Mo} etex), (btex \pZ{42} etex),
(btex \pM{} etex), (btex \pName{Molybenum} etex),
(btex \pAltName{Molybd\"an [Kr]$4d^55s$} etex), (btex \pConf{s} etex));
element(5*dy, 7*dx, (btex \pSym{Tc} etex), (btex \pZ{43} etex),
(btex \pM{} etex), (btex \pName{Technetium} etex),
(btex \pAltName{Technetium} etex), (btex \pConf{[Kr]$4d^55s^2$} etex));
element(5*dy, 8*dx, (btex \pSym{Ru} etex), (btex \pZ{44} etex),
(btex \pM{} etex), (btex \pName{Ruthenium} etex),
(btex \pAltName{Ruthenium} etex), (btex \pConf{[Kr]$4d^75s$} etex));
element(5*dy, 9*dx, (btex \pSym{Rh} etex), (btex \pZ{45} etex),
(btex \pM{} etex), (btex \pName{Rhodium} etex),
(btex \pAltName{Rhodium} etex), (btex \pConf{[Kr]$4d^85s$} etex));
element(5*dy, 10*dx, (btex \pSym{Pd} etex), (btex \pZ{46} etex),
(btex \pM{} etex), (btex \pName{Palladium} etex),
(btex \pAltName{Palladium} etex), (btex \pConf{[Kr]$4d^{10}$} etex));
element(5*dy, 11*dx, (btex \pSym{Ag} etex), (btex \pZ{47} etex),
(btex \pM{} etex), (btex \pName{Silver} etex),
(btex \pAltName{Silber} etex), (btex \pConf{[Kr]$4d^{10}5s$} etex));
element(5*dy, 12*dx, (btex \pSym{Cd} etex), (btex \pZ{48} etex),
(btex \pM{} etex), (btex \pName{Cadmium} etex),
(btex \pAltName{Cadmium} etex), (btex \pConf{[Kr]$4d^{10}5s^2$} etex));
element(5*dy, 13*dx, (btex \pSym{In} etex), (btex \pZ{49} etex),
(btex \pM{} etex), (btex \pName{Indium} etex),
(btex \pAltName{Indium} etex), (btex \pConf{[Kr]$4d^{10}5s^25p$} etex));
%element(5*dy, 14*dx, (btex \pSym{Sn} etex), (btex \pZ{50} etex),
% (btex \pM{} etex), (btex \pName{Tin} etex),
% (btex \pAltName{Zinn} etex), (btex \pConf{[Kr}$4d^{10}5s^25p^2$} etex));
%element(5*dy, 15*dx, (btex \pSym{Sb} etex), (btex \pZ{51} etex),
% (btex \pM{} etex), (btex \pName{Antimony} etex),
% (btex \pAltName{Antimon} etex), (btex \pConf{[Kr}$4d^{10}5s^25p^3$} etex));
%element(5*dy, 16*dx, (btex \pSym{Te} etex), (btex \pZ{52} etex),
% (btex \pM{} etex), (btex \pName{Tellurium} etex),
% (btex \pAltName{Tellur} etex), (btex \pConf{[Kr}$4d^{10}5s^25p^4$} etex));
%element(5*dy, 17*dx, (btex \pSym{I} etex), (btex \pZ{53} etex),
% (btex \pM{} etex), (btex \pName{Iodine} etex),
% (btex \pAltName{Iod} etex), (btex \pConf{[Kr}$4d^{10}5s^25p^5$} etex));
%element(5*dy, 18*dx, (btex \pSym{Xe} etex), (btex \pZ{54} etex),
% (btex \pM{} etex), (btex \pName{Xenon} etex),
% (btex \pAltName{Xenon} etex), (btex \pConf{[Kr}$4d^{10}5s^25p^6$} etex));
element(6*dy, 1*dx, (btex \pSym{Cs} etex), (btex \pZ{55} etex),
(btex \pM{132.90545} etex), (btex \pName{Cesium} etex),
(btex \pAltName{Cesium} etex), (btex \pConf{[Xe]$6s$} etex));
element(6*dy, 2*dx, (btex \pSym{Ba} etex), (btex \pZ{56} etex),
(btex \pM{137.327} etex), (btex \pName{Barium} etex),
(btex \pAltName{Barium} etex), (btex \pConf{[Xe]$6s^2$} etex));
element(8.3*dy, 3*dx, (btex \pSym{La} etex), (btex \pZ{57} etex),
(btex \pM{138.9055} etex), (btex \pName{Lanthanum} etex),
(btex \pAltName{Lanthan} etex), (btex \pConf{[Xe]$5d6s^2$} etex));
element(6*dy, 4*dx, (btex \pSym{Hf} etex), (btex \pZ{72} etex),
(btex \pM{178.49} etex), (btex \pName{Hafnium} etex),
(btex \pAltName{Hafnium} etex), (btex \pConf{[Xe]$4f^{14}5d^26s^2$} etex));
element(6*dy, 5*dx, (btex \pSym{Ta} etex), (btex \pZ{73} etex),
(btex \pM{180.9479} etex), (btex \pName{Tantalum} etex),
(btex \pAltName{Tantal} etex), (btex \pConf{[Xe]$4f^{14}5d^36s^2$} etex));
element(6*dy, 6*dx, (btex \pSym{W } etex), (btex \pZ{74} etex),
(btex \pM{183.84} etex), (btex \pName{Tungsten} etex),
(btex \pAltName{Wolfram} etex), (btex \pConf{[Xe]$4f^{14}5d^46s^2$} etex));
element(6*dy, 7*dx, (btex \pSym{Re} etex), (btex \pZ{75} etex),
(btex \pM{186.207} etex), (btex \pName{Rhenium} etex),
(btex \pAltName{Rhenium} etex), (btex \pConf{[Xe]$4f^{14}5d^56s^2$} etex));
element(6*dy, 8*dx, (btex \pSym{Os} etex), (btex \pZ{76} etex),
(btex \pM{190.23} etex), (btex \pName{Osmium} etex),
(btex \pAltName{Osmium} etex), (btex \pConf{[Xe]$4f^{14}5d^66s^2$} etex));
element(6*dy, 9*dx, (btex \pSym{Ir} etex), (btex \pZ{77} etex),
(btex \pM{192.217} etex), (btex \pName{Iridium} etex),
(btex \pAltName{Iridium} etex), (btex \pConf{[Xe]$4f^{14}5d^76s^2$} etex));
element(6*dy, 10*dx, (btex \pSym{Pt} etex), (btex \pZ{78} etex),
(btex \pM{195.078} etex), (btex \pName{Platinum} etex),
(btex \pAltName{Platin} etex), (btex \pConf{[Xe]$4f^{14}5d^96s$} etex));
element(6*dy, 11*dx, (btex \pSym{Au} etex), (btex \pZ{79} etex),
(btex \pM{196.96655} etex), (btex \pName{Gold} etex),
(btex \pAltName{Gold} etex), (btex \pConf{[Xe]$4f^{14}5d^{10}6s$} etex));
element(6*dy, 12*dx, (btex \pSym{Hg} etex), (btex \pZ{80} etex),
(btex \pM{200.59} etex), (btex \pName{Mercury} etex),
(btex \pAltName{Quecksilber} etex), (btex \pConf{[Xe]$4f^{14}5d^{10}6s^2$} etex));
element(6*dy, 13*dx, (btex \pSym{Tl} etex), (btex \pZ{81} etex),
(btex \pM{204.3833} etex), (btex \pName{Thallium} etex),
(btex \pAltName{Thallium} etex), (btex \pConf{[Hg]$6p$} etex));
element(6*dy, 14*dx, (btex \pSym{Pb} etex), (btex \pZ{82} etex),
(btex \pM{207.2} etex), (btex \pName{Lead} etex),
(btex \pAltName{Blei} etex), (btex \pConf{[Hg]$6p^2$} etex));
element(6*dy, 15*dx, (btex \pSym{Bi} etex), (btex \pZ{83} etex),
(btex \pM{208.98038} etex), (btex \pName{Bismuth} etex),
(btex \pAltName{Bismut} etex), (btex \pConf{[Hg]$6p^3$} etex));
element(6*dy, 16*dx, (btex \pSym{Po} etex), (btex \pZ{84} etex),
(btex \pM{(209)} etex), (btex \pName{Polonium} etex),
(btex \pAltName{Polonium} etex), (btex \pConf{[Hg]$6p^4$} etex));
element(6*dy, 17*dx, (btex \pSym{At} etex), (btex \pZ{85} etex),
(btex \pM{(210)} etex), (btex \pName{Astatine} etex),
(btex \pAltName{Astat} etex), (btex \pConf{[Hg]$6p^5$} etex));
element(6*dy, 18*dx, (btex \pSym{Rn} etex), (btex \pZ{86} etex),
(btex \pM{(222)} etex), (btex \pName{Radon} etex),
(btex \pAltName{Radon} etex), (btex \pConf{[Hg]$6p^6$} etex));
element(7*dy, 1*dx, (btex \pSym{Fr} etex), (btex \pZ{87} etex),
(btex \pM{(223)} etex), (btex \pName{Francium} etex),
(btex \pAltName{Francium} etex), (btex \pConf{[Rn]$7s$} etex));
element(7*dy, 2*dx, (btex \pSym{Ra} etex), (btex \pZ{87} etex),
(btex \pM{(226)} etex), (btex \pName{Radium} etex),
(btex \pAltName{Radium} etex), (btex \pConf{[Rn]$6p^2$} etex));
element(9.3*dy, 3*dx, (btex \pSym{Ac} etex), (btex \pZ{89} etex),
(btex \pM{(227)} etex), (btex \pName{Actinium} etex),
(btex \pAltName{Actinium} etex), (btex \pConf{[Rn]$6s7s^2$} etex));
element(7*dy, 4*dx, (btex \pSym{Rf} etex), (btex \pZ{104} etex),
(btex \pM{(261)} etex), (btex \pName{Rutherfordium} etex),
(btex \pAltName{Rutherfordium} etex), (btex \pConf{[Rn]$5f^{14}6d^27s^2?$} etex));
element(7*dy, 5*dx, (btex \pSym{Db} etex), (btex \pZ{105} etex),
(btex \pM{(262)} etex), (btex \pName{Dubnium} etex),
(btex \pAltName{} etex), (btex \pConf{Dubnium} etex));
element(7*dy, 6*dx, (btex \pSym{Sg} etex), (btex \pZ{106} etex),
(btex \pM{(266)} etex), (btex \pName{Seaborgium} etex),
(btex \pAltName{Seaborgium} etex), (btex \pConf{} etex));
element(7*dy, 7*dx, (btex \pSym{Bh} etex), (btex \pZ{107} etex),
(btex \pM{(264)} etex), (btex \pName{Bohrium} etex),
(btex \pAltName{Bohrium} etex), (btex \pConf{} etex));
element(7*dy, 8*dx, (btex \pSym{Hs} etex), (btex \pZ{108} etex),
(btex \pM{(277)} etex), (btex \pName{Hassium} etex),
(btex \pAltName{Hassium} etex), (btex \pConf{} etex));
element(7*dy, 9*dx, (btex \pSym{Mt} etex), (btex \pZ{109} etex),
(btex \pM{(268)} etex), (btex \pName{Meitnerium} etex),
(btex \pAltName{Meitnerium} etex), (btex \pConf{} etex));
element(7*dy, 10*dx, (btex \pSym{Uun} etex), (btex \pZ{110} etex),
(btex \pM{(281)} etex), (btex \pName{Ununnilium} etex),
(btex \pAltName{Ununnilium} etex), (btex \pConf{} etex));
element(7*dy, 11*dx, (btex \pSym{Uuu} etex), (btex \pZ{111} etex),
(btex \pM{(272)} etex), (btex \pName{Unununium} etex),
(btex \pAltName{Unununium} etex), (btex \pConf{} etex));
element(7*dy, 12*dx, (btex \pSym{Uub} etex), (btex \pZ{112} etex),
(btex \pM{(285)} etex), (btex \pName{Ununbium} etex),
(btex \pAltName{Ununbium} etex), (btex \pConf{} etex));
element(7*dy, 14*dx, (btex \pSym{Uuq} etex), (btex \pZ{114} etex),
(btex \pM{(289)} etex), (btex \pName{Ununquadium} etex),
(btex \pAltName{Ununquadium} etex), (btex \pConf{} etex));
element(7*dy, 16*dx, (btex \pSym{Uuh} etex), (btex \pZ{116} etex),
(btex \pM{(292)} etex), (btex \pName{Ununhexium} etex),
(btex \pAltName{Ununhexium} etex), (btex \pConf{} etex));
element(8.3*dy, 4*dx, (btex \pSym{Ce} etex), (btex \pZ{58} etex),
(btex \pM{140.116} etex), (btex \pName{Cerium} etex),
(btex \pAltName{[Xe]$4f5d6s^2$} etex), (btex \pConf{s} etex));
element(8.3*dy, 5*dx, (btex \pSym{Pr} etex), (btex \pZ{59} etex),
(btex \pM{140.90765} etex), (btex \pName{Praseodymium} etex),
(btex \pAltName{Praseodym} etex), (btex \pConf{[Xe]$4f^36s^2$} etex));
element(8.3*dy, 6*dx, (btex \pSym{Nd} etex), (btex \pZ{60} etex),
(btex \pM{144.24} etex), (btex \pName{Neodymium} etex),
(btex \pAltName{Neodym} etex), (btex \pConf{[Xe]$4f^46s^2$} etex));
element(8.3*dy, 7*dx, (btex \pSym{Pm} etex), (btex \pZ{61} etex),
(btex \pM{(145)} etex), (btex \pName{Promethium} etex),
(btex \pAltName{Promethium} etex), (btex \pConf{[Xe]$4f^56s^2$} etex));
element(8.3*dy, 8*dx, (btex \pSym{Sm} etex), (btex \pZ{62} etex),
(btex \pM{150.36} etex), (btex \pName{Samarium} etex),
(btex \pAltName{Samarium} etex), (btex \pConf{[Xe]$4f^66s^2$} etex));
element(8.3*dy, 9*dx, (btex \pSym{Eu} etex), (btex \pZ{63} etex),
(btex \pM{151.964} etex), (btex \pName{Europium} etex),
(btex \pAltName{Europium} etex), (btex \pConf{[Xe]$4f^76s^2$} etex));
element(8.3*dy, 10*dx, (btex \pSym{Gd} etex), (btex \pZ{64} etex),
(btex \pM{157.25} etex), (btex \pName{Gadolinium} etex),
(btex \pAltName{Gadolinium} etex), (btex \pConf{[Xe]$4f^75d6s^2$} etex));
element(8.3*dy, 11*dx, (btex \pSym{Tb} etex), (btex \pZ{65} etex),
(btex \pM{158.92534} etex), (btex \pName{Terbium} etex),
(btex \pAltName{Terbium} etex), (btex \pConf{[Xe]$4f^96s^2$} etex));
element(8.3*dy, 12*dx, (btex \pSym{Dy} etex), (btex \pZ{66} etex),
(btex \pM{162.500} etex), (btex \pName{Dysprosium} etex),
(btex \pAltName{Dysprosium} etex), (btex \pConf{[Xe]$4f^{10}6s^2$} etex));
element(8.3*dy, 13*dx, (btex \pSym{Ho} etex), (btex \pZ{67} etex),
(btex \pM{164.93032} etex), (btex \pName{Holmium} etex),
(btex \pAltName{Holmium} etex), (btex \pConf{[Xe]$4f^{11}6s^2$} etex));
element(8.3*dy, 14*dx, (btex \pSym{Er} etex), (btex \pZ{68} etex),
(btex \pM{167.259} etex), (btex \pName{Erbium} etex),
(btex \pAltName{Erbium} etex), (btex \pConf{[Xe]$4f^{12}6s^2$} etex));
element(8.3*dy, 15*dx, (btex \pSym{Tm} etex), (btex \pZ{69} etex),
(btex \pM{168.93421} etex), (btex \pName{Thulium} etex),
(btex \pAltName{Thulium} etex), (btex \pConf{[Xe]$4f^{13}6s^2$} etex));
element(8.3*dy, 16*dx, (btex \pSym{Yb} etex), (btex \pZ{70} etex),
(btex \pM{173.04} etex), (btex \pName{Ytterbium} etex),
(btex \pAltName{Ytterbium} etex), (btex \pConf{[Xe]$4f^{14}6s^2$} etex));
element(8.3*dy, 17*dx, (btex \pSym{Lu} etex), (btex \pZ{71} etex),
(btex \pM{174.967} etex), (btex \pName{Lutetium} etex),
(btex \pAltName{Lutetium} etex), (btex \pConf{[Xe]$4f^{14}5d6s^2$} etex));
element(9.3*dy, 4*dx, (btex \pSym{Th} etex), (btex \pZ{90} etex),
(btex \pM{232.0391} etex), (btex \pName{Thorium} etex),
(btex \pAltName{Thorium} etex), (btex \pConf{[Rn]$6d^27s^2$} etex));
element(9.3*dy, 5*dx, (btex \pSym{Pa} etex), (btex \pZ{91} etex),
(btex \pM{231.03588} etex), (btex \pName{Proactinium} etex),
(btex \pAltName{Proactinium} etex), (btex \pConf{[Rn]$5f^26d7s^2$} etex));
element(9.3*dy, 6*dx, (btex \pSym{U} etex), (btex \pZ{92} etex),
(btex \pM{238.02891} etex), (btex \pName{Uranium} etex),
(btex \pAltName{Uranium} etex), (btex \pConf{[Rn]$5f^36d7s^2$} etex));
element(9.3*dy, 7*dx, (btex \pSym{Np} etex), (btex \pZ{93} etex),
(btex \pM{(237)} etex), (btex \pName{Neptunium} etex),
(btex \pAltName{Neptunium} etex), (btex \pConf{[Rn]$5f^46d7s^2$} etex));
element(9.3*dy, 8*dx, (btex \pSym{Pu} etex), (btex \pZ{94} etex),
(btex \pM{(244)} etex), (btex \pName{Plutonium} etex),
(btex \pAltName{Plutonium} etex), (btex \pConf{[Rn]$5f^67s^2$} etex));
element(9.3*dy, 9*dx, (btex \pSym{Am} etex), (btex \pZ{95} etex),
(btex \pM{(243)} etex), (btex \pName{Americium} etex),
(btex \pAltName{Americium} etex), (btex \pConf{[Rn]$5f^77s^2$} etex));
element(9.3*dy, 10*dx, (btex \pSym{Cm} etex), (btex \pZ{96} etex),
(btex \pM{(247)} etex), (btex \pName{Curium} etex),
(btex \pAltName{Curium} etex), (btex \pConf{[Rn]$5f^76d7s^2$} etex));
element(9.3*dy, 11*dx, (btex \pSym{Bk} etex), (btex \pZ{97} etex),
(btex \pM{(247)} etex), (btex \pName{Berkelium} etex),
(btex \pAltName{Berkelium} etex), (btex \pConf{[Rn]$5f^97s^2$} etex));
element(9.3*dy, 12*dx, (btex \pSym{Cf} etex), (btex \pZ{98} etex),
(btex \pM{(251)} etex), (btex \pName{Californium} etex),
(btex \pAltName{Californium} etex), (btex \pConf{[Rn]$5f^{10}7s^2$} etex));
element(9.3*dy, 13*dx, (btex \pSym{Es} etex), (btex \pZ{99} etex),
(btex \pM{(252)} etex), (btex \pName{Einsteinium} etex),
(btex \pAltName{Einsteinium} etex), (btex \pConf{[Rn]$5f^{11}7s^2$} etex));
element(9.3*dy, 14*dx, (btex \pSym{Fm} etex), (btex \pZ{100} etex),
(btex \pM{(257)} etex), (btex \pName{Fermium} etex),
(btex \pAltName{Fermium} etex), (btex \pConf{[Rn]$5f^{12}7s^2$} etex));
element(9.3*dy, 15*dx, (btex \pSym{Md} etex), (btex \pZ{101} etex),
(btex \pM{(258)} etex), (btex \pName{Mendelevium} etex),
(btex \pAltName{Mendelevium} etex), (btex \pConf{[Rn]$5f^{13}7s^2$} etex));
element(9.3*dy, 16*dx, (btex \pSym{No} etex), (btex \pZ{102} etex),
(btex \pM{(259)} etex), (btex \pName{Nobelium} etex),
(btex \pAltName{Nobelium} etex), (btex \pConf{[Rn]$5f^{14}7s^2$} etex));
element(9.3*dy, 17*dx, (btex \pSym{Lr} etex), (btex \pZ{103} etex),
(btex \pM{(262)} etex), (btex \pName{Lawrencium} etex),
(btex \pAltName{Lawrencium} etex), (btex \pConf{[Rn]$5f^{14}7s^27p?$} etex));
verbatimtex \bye etex;
endfig;
end.
[-- Attachment #4: Type: text/plain, Size: 487 bytes --]
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: MetaPost question
2007-06-28 17:27 MetaPost question Tobias Burnus
@ 2007-06-28 17:48 ` Taco Hoekwater
0 siblings, 0 replies; 55+ messages in thread
From: Taco Hoekwater @ 2007-06-28 17:48 UTC (permalink / raw)
To: mailing list for ConTeXt users
Tobias Burnus wrote:
> Hello,
>
> I try to print a periodic table in MP+TeX, but I get the following error
> if I uncomment the "%" lines; I fail to see my error. Is there any trick
> to debug this?
It is not easy do debug that (in general), but it normally helps to
run a standalone label in TeX if you have mtx trouble. In this case,
they are all the same typo:
> %element(5*dy, 1*dx, (btex \pSym{Rb} etex), (btex \pZ{37} etex),
> % (btex \pM{} etex), (btex \pName{Rubidium} etex),
> % (btex \pAltName{Rubidium} etex), (btex \pConf{[Kr}$5s$} etex));
That last label should probably be
\pConf{[Kr]$5s$}
not
\pConf{[Kr}$5s$}
Best,
Taco
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* MetaPost question
@ 2007-05-02 20:38 Tobias Burnus
2007-05-02 20:46 ` Aditya Mahajan
0 siblings, 1 reply; 55+ messages in thread
From: Tobias Burnus @ 2007-05-02 20:38 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
I want to define a macro in MetaPost which does:
def myfunc (expr x,y)(text t) =
draw thelabel.rt (btex You passed \quotation{t} etex, (x,y));
where t in btex ... text is replaced by the argument. How to do so?
Tobias
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: MetaPost question
2007-05-02 20:38 Tobias Burnus
@ 2007-05-02 20:46 ` Aditya Mahajan
2007-05-04 21:18 ` Aditya Mahajan
0 siblings, 1 reply; 55+ messages in thread
From: Aditya Mahajan @ 2007-05-02 20:46 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Wed, 2 May 2007, Tobias Burnus wrote:
> Hi,
>
> I want to define a macro in MetaPost which does:
>
> def myfunc (expr x,y)(text t) =
> draw thelabel.rt (btex You passed \quotation{t} etex, (x,y));
>
> where t in btex ... text is replaced by the argument. How to do so?
You can do that using TEX.mp. I remember that it is also possible to use
textext to do something like this. I need to check my files to see if I
have an example.
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: MetaPost question
2007-05-02 20:46 ` Aditya Mahajan
@ 2007-05-04 21:18 ` Aditya Mahajan
0 siblings, 0 replies; 55+ messages in thread
From: Aditya Mahajan @ 2007-05-04 21:18 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Wed, 2 May 2007, Aditya Mahajan wrote:
> On Wed, 2 May 2007, Tobias Burnus wrote:
>
>> Hi,
>>
>> I want to define a macro in MetaPost which does:
>>
>> def myfunc (expr x,y)(text t) =
>> draw thelabel.rt (btex You passed \quotation{t} etex, (x,y));
>>
>> where t in btex ... text is replaced by the argument. How to do so?
>
> You can do that using TEX.mp. I remember that it is also possible to use
> textext to do something like this. I need to check my files to see if I
> have an example.
Here is a working solution.
\starttext
\forceMPTEXcheck{myfunc}
\startMPinclusions
def myfunc (expr x,y) (text t) =
label.rt (textext("You passed \quotation{" & t & "}"), (x,y))
enddef;
\stopMPinclusions
\startMPpage
myfunc (0,0) ("Hello") ;
myfunc (2cm,1cm) ("World") ;
\stopMPpage
\stoptext
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 55+ messages in thread
* Metapost question
@ 2005-06-14 6:54 Tobias Burnus
2005-06-14 7:42 ` Taco Hoekwater
2005-06-14 7:56 ` Albrecht Kauffmann
0 siblings, 2 replies; 55+ messages in thread
From: Tobias Burnus @ 2005-06-14 6:54 UTC (permalink / raw)
Hello,
does someone know how, if at all, one can printout some variable? Like
Emean:=(2*Eone+Ezero+2*Etwo)/5.;
label.urt(btex $A = x$ ....
where x is the value of Emean? I frequently create some diagrams, modify
them and then forget to change the label. (If one could set the number
of digits, it would be even nicer.)
Tobias
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2005-06-14 6:54 Metapost question Tobias Burnus
@ 2005-06-14 7:42 ` Taco Hoekwater
2005-06-14 10:51 ` h h extern
2005-06-14 7:56 ` Albrecht Kauffmann
1 sibling, 1 reply; 55+ messages in thread
From: Taco Hoekwater @ 2005-06-14 7:42 UTC (permalink / raw)
Tobias Burnus wrote:
> Hello,
>
> does someone know how, if at all, one can printout some variable? Like
> Emean:=(2*Eone+Ezero+2*Etwo)/5.;
> label.urt(btex $A = x$ ....
this should work:
input TEX;
label.urt(TEX("$A = "&decimal x&"$)"), ....
Taco
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2005-06-14 7:42 ` Taco Hoekwater
@ 2005-06-14 10:51 ` h h extern
0 siblings, 0 replies; 55+ messages in thread
From: h h extern @ 2005-06-14 10:51 UTC (permalink / raw)
Taco Hoekwater wrote:
>
>
> Tobias Burnus wrote:
>
>> Hello,
>>
>> does someone know how, if at all, one can printout some variable? Like
>> Emean:=(2*Eone+Ezero+2*Etwo)/5.;
>> label.urt(btex $A = x$ ....
>
>
> this should work:
>
> input TEX;
> label.urt(TEX("$A = "&decimal x&"$)"), ....
in context you can use the more efficient 'textext' mechanism instead of 'TEX'
(actually, it was only after writing textext that i noticed the existence of the
TEX macro -)
Hans
-----------------------------------------------------------------
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
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: Metapost question
2005-06-14 6:54 Metapost question Tobias Burnus
2005-06-14 7:42 ` Taco Hoekwater
@ 2005-06-14 7:56 ` Albrecht Kauffmann
1 sibling, 0 replies; 55+ messages in thread
From: Albrecht Kauffmann @ 2005-06-14 7:56 UTC (permalink / raw)
Hallo Tobias,
you can use char<numeric primary> in the following manner:
Emean:=5;% A quite simple example
label.lft(btex $A=$ etex,pair exression);
label.rt(char(48+Emean),the same pair expression);
Clearly, if Emean is an expression like xxx.xxxx, you must convert it in a
sequence of single chars (not quite simple).
Greetings
Albrecht
On Tue, 14 Jun 2005, Tobias Burnus wrote:
> Hello,
>
> does someone know how, if at all, one can printout some variable? Like
> Emean:=(2*Eone+Ezero+2*Etwo)/5.;
> label.urt(btex $A = x$ ....
> where x is the value of Emean? I frequently create some diagrams, modify
> them and then forget to change the label. (If one could set the number
> of digits, it would be even nicer.)
>
> Tobias
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
^ permalink raw reply [flat|nested] 55+ messages in thread
* MetaPost question
@ 2001-11-17 19:54 Jose Luis Diaz
2001-11-18 6:18 ` Johannes H?sing
2001-11-18 11:57 ` Denis B. Roegel
0 siblings, 2 replies; 55+ messages in thread
From: Jose Luis Diaz @ 2001-11-17 19:54 UTC (permalink / raw)
Hello ConTeXt users,
Sorry for posing a question not about ConTeXt, but I realize that in
this list there also are people very fluent in Metapost. My question
is:
How can I convert a number in a string, concatenate this string with
other strings and have TeX to typeset the whole result?
I.e., suppose that I have an array of numbers:
pair t[];
t[1]=3; t[2]=20; t[3]=25;
For example, these numbers are some points along an abcise axis. Then
I want to put a big dot at each of these points. Not difficult:
for i=1 upto 3: draw (0u, t[i]*u) withpen circlepen scaled 4mm;
endfor;
But then suppose that I also want a label below each dot, typeset
with TeX, which reads: $t_1=3$, $t_2=20$, $t_3=25$. I can't use
btex/etex because I want to construct the text $t_1=3$ from the loop
variable, something like:
for i=1 upto 3:
sprintf(string,"$f_%d=%d$",i,t[i]); %This is not Metapost, obviusly
label.bot(TEX(string), (0u, t[i]*u)); % This is
endfor;
How can be done?
Thanks.
--
Jose Luis Diaz
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: MetaPost question
2001-11-17 19:54 MetaPost question Jose Luis Diaz
@ 2001-11-18 6:18 ` Johannes H?sing
2001-11-18 11:57 ` Denis B. Roegel
1 sibling, 0 replies; 55+ messages in thread
From: Johannes H?sing @ 2001-11-18 6:18 UTC (permalink / raw)
On Sat, Nov 17, 2001 at 08:54:42PM +0100, Jose Luis Diaz wrote:
> How can be done?
Can't be done within MetaPost.
Saludos
Johannes
--
Johannes Hüsing | "Die einzige deutsche Stadt, die an zwei
hannes@ruhrau.de| Flüssen liegt." Ole v. Beust über Hamburg
^ permalink raw reply [flat|nested] 55+ messages in thread
* Re: MetaPost question
2001-11-17 19:54 MetaPost question Jose Luis Diaz
2001-11-18 6:18 ` Johannes H?sing
@ 2001-11-18 11:57 ` Denis B. Roegel
1 sibling, 0 replies; 55+ messages in thread
From: Denis B. Roegel @ 2001-11-18 11:57 UTC (permalink / raw)
Cc: ConTeXt Mailing List
On Sat, Nov 17, 2001 at 08:54:42PM +0100, Jose Luis Diaz wrote:
> But then suppose that I also want a label below each dot, typeset
> with TeX, which reads: $t_1=3$, $t_2=20$, $t_3=25$. I can't use
> btex/etex because I want to construct the text $t_1=3$ from the loop
> variable, something like:
>
> for i=1 upto 3:
> sprintf(string,"$f_%d=%d$",i,t[i]); %This is not Metapost, obviusly
> label.bot(TEX(string), (0u, t[i]*u)); % This is
> endfor;
>
>
> How can be done?
Build your string s with something like
s="$t_" & decimal(i) & "=" & decimal(t[i]) & "$";
and then write
label.bot(TEX s,(0,t[i]*u))
and don't forget input TEX at the beginning of your file.
Denis
^ permalink raw reply [flat|nested] 55+ messages in thread
end of thread, other threads:[~2015-12-07 15:58 UTC | newest]
Thread overview: 55+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-18 11:14 metapost question Thomas A. Schmitz
2008-06-18 11:43 ` Wolfgang Schuster
2008-06-18 11:58 ` Peter Rolf
2008-06-18 12:11 ` Thomas A. Schmitz
-- strict thread matches above, loose matches on Subject: below --
2015-12-06 20:54 MetaPost Question Context NTG
2015-12-06 21:49 ` Alan BRASLAU
2015-12-07 15:58 ` Context NTG
2011-12-01 22:25 metapost question Hans van der Meer
2011-12-01 23:30 ` Peter Rolf
2011-10-21 13:05 Hans van der Meer
2011-10-21 15:13 ` Peter Rolf
2011-10-21 15:34 ` Meer, H. van der
2011-10-21 18:13 ` Meer, H. van der
2011-10-21 18:02 ` Nicola
2009-05-11 15:14 Metapost question Jean Magnan de Bornier
2009-05-11 15:34 ` Peter Rolf
2009-05-11 16:27 ` Jean Magnan de Bornier
2009-05-11 15:42 ` Mojca Miklavec
2009-05-11 15:58 ` Mojca Miklavec
2009-05-11 16:31 ` Jean Magnan de Bornier
2009-05-11 16:52 ` Mojca Miklavec
2009-05-11 17:33 ` Jean Magnan de Bornier
2009-05-11 18:02 ` Mojca Miklavec
2009-05-12 4:33 ` Jean Magnan de Bornier
2009-05-12 7:42 ` Taco Hoekwater
2009-05-12 14:15 ` Jean Magnan de Bornier
2009-05-12 14:32 ` Aditya Mahajan
2009-05-12 15:11 ` Jean Magnan de Bornier
2009-05-12 15:53 ` Taco Hoekwater
2009-05-12 16:37 ` Jean Magnan de Bornier
2009-05-13 6:45 ` Taco Hoekwater
2009-05-13 8:19 ` Jean Magnan de Bornier
2009-05-11 18:16 ` Jean Magnan de Bornier
2009-05-11 17:01 ` Hans Hagen
2009-05-11 18:08 ` Mojca Miklavec
2009-05-11 15:47 ` Aditya Mahajan
2007-10-08 13:47 metapost question Thomas A. Schmitz
2007-10-08 16:49 ` Otared Kavian
2007-10-08 17:34 ` Thomas A. Schmitz
2007-10-08 18:10 ` Jesse Alama
2007-10-23 12:17 ` Thomas A. Schmitz
2007-10-23 12:26 ` Hans Hagen
2007-10-23 20:58 ` Thomas A. Schmitz
2007-06-28 17:27 MetaPost question Tobias Burnus
2007-06-28 17:48 ` Taco Hoekwater
2007-05-02 20:38 Tobias Burnus
2007-05-02 20:46 ` Aditya Mahajan
2007-05-04 21:18 ` Aditya Mahajan
2005-06-14 6:54 Metapost question Tobias Burnus
2005-06-14 7:42 ` Taco Hoekwater
2005-06-14 10:51 ` h h extern
2005-06-14 7:56 ` Albrecht Kauffmann
2001-11-17 19:54 MetaPost question Jose Luis Diaz
2001-11-18 6:18 ` Johannes H?sing
2001-11-18 11:57 ` Denis B. Roegel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).