<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-NZ link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi all<o:p></o:p></p><p class=MsoNormal>I was just trying to make a new header definition that could report appropriately, dependant on presence of a coordinate system, plan, extended or projected elevation. It was mostly progressing OK until I realised I was pinning my hopes on using the metapost ATTR__elevation variable in a block of tex code. That and my very poor grasp of tex Boolean testing ( \if ATTR__elevation is probably the wrong syntax) mean that I am probably doomed to fail. Since I have got this far, I may as well ask a few questions….<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>In the code below…<o:p></o:p></p><p class=MsoNormal>Is there a tex variable equivalent to the ATTR__elevation metapost variable?<o:p></o:p></p><p class=MsoNormal>Is it possible to differentiate extended elevations from projected elevations (and plans) with tex?<o:p></o:p></p><p class=MsoNormal>For example, can we determine the projection angle of a projected elevation?<o:p></o:p></p><p class=MsoNormal>How to format the magdecl output to just 1 decimal place? <o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Bruce<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal># % print coordinate system and projection related information<o:p></o:p></p><p class=MsoNormal> <span style='background:yellow;mso-highlight:yellow'>\if ATTR__elevation</span> % print elevation specific text %<span style='background:yellow;mso-highlight:yellow'>THIS TEST ALWAYS FALSE??</span><o:p></o:p></p><p class=MsoNormal># % extended elevation<o:p></o:p></p><p class=MsoNormal> {\the\legendtextsize\ss {Idealised elevation} \par} %' looking generally East' %this whole line probably redundant<o:p></o:p></p><p class=MsoNormal># % projected elevation<o:p></o:p></p><p class=MsoNormal> \edef\tmp{\the\outcsname} \ifx\tmp\empty %ie if no cs<o:p></o:p></p><p class=MsoNormal> {\the\legendtextsize\ss {Elevation looking <span style='background:yellow;mso-highlight:yellow'>xxx</span> deg magnetic}\par} <span style='background:yellow;mso-highlight:yellow'>%NEED TO SEE IF PROJECTION ANGLE AVAILABLE TO TEX</span><o:p></o:p></p><p class=MsoNormal> \else %there is a cs<o:p></o:p></p><p class=MsoNormal> {\the\legendtextsize\ss\the\outcsname { elevation looking <span style='background:yellow;mso-highlight:yellow'>xxx</span> deg}\par} <span style='background:yellow;mso-highlight:yellow'>%NEED TO SEE IF PROJECTION ANGLE AVAILABLE TO TEX</span><o:p></o:p></p><p class=MsoNormal> \fi<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal> \else % not ATTR__elevation % print plan specific text<o:p></o:p></p><p class=MsoNormal># % plan <o:p></o:p></p><p class=MsoNormal> \edef\tmp{\the\outcsname} \ifx\tmp\empty %ie if no cs <o:p></o:p></p><p class=MsoNormal> %{\the\legendtextsize\ss {Plan projection (not georeferenced)}\par} %remove preceding % for redundant long form<o:p></o:p></p><p class=MsoNormal> {\the\legendtextsize\ss Arrow points to magnetic north} <o:p></o:p></p><p class=MsoNormal> \else %there is a cs<o:p></o:p></p><p class=MsoNormal> \the\legendtextsize\ss\the\outcsname %{ plan projection}\par %remove preceding % for redundant long form<o:p></o:p></p><p class=MsoNormal> \edef\tmp{\the\northdir} \ifx\tmp\empty \else<o:p></o:p></p><p class=MsoNormal> {\the\legendtextsize\ss { arrow points \the\northdir { north}}} % grid or true north<o:p></o:p></p><p class=MsoNormal> \fi <o:p></o:p></p><p class=MsoNormal># % Could report declination here <o:p></o:p></p><p class=MsoNormal> \edef\tmp{\the\magdecl} \ifx\tmp\empty \else<o:p></o:p></p><p class=MsoNormal> <span style='background:yellow;mso-highlight:yellow'>{\the\legendtextsize\ss\the\magdecl</span> { deg magnetic declination}\par} <span style='background:yellow;mso-highlight:yellow'>%HOW TO LIMIT TO ONE DECIMAL PLACE?</span><o:p></o:p></p><p class=MsoNormal> \fi <o:p></o:p></p><p class=MsoNormal> \fi <o:p></o:p></p><p class=MsoNormal> \par\par <o:p></o:p></p><p class=MsoNormal> \fi % ATTR__elevation % end plan<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Above code produces the top couple of lines of this header snapshot. It should be different depending whether it is a plan or elevation, but at present is always this way. However the coordinate system test does work properly.<o:p></o:p></p><p class=MsoNormal><img width=358 height=255 style='width:3.7291in;height:2.6562in' id="Picture_x0020_1" src="cid:image001.png@01D40CD1.AC4C3280"><o:p></o:p></p></div></body></html>