[Therion] Tex variables to report according to cs, projection type and angle

Bruce Mutton bruce at tomo.co.nz
Mon Jun 25 12:30:44 CEST 2018


Hi all

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..

 

In the code below.

Is there a tex variable equivalent to the  ATTR__elevation metapost
variable?

Is it possible to differentiate extended elevations from projected
elevations (and plans) with tex?

For example, can we determine the projection angle of a projected elevation?

How to format the magdecl output to just 1 decimal place? 

 

Bruce

 

# % print coordinate system and projection related information

  \if ATTR__elevation  % print elevation specific text %THIS TEST ALWAYS
FALSE??

# % extended elevation

                {\the\legendtextsize\ss {Idealised elevation} \par} %'
looking generally East' %this whole line probably redundant

# % projected elevation

    \edef\tmp{\the\outcsname} \ifx\tmp\empty %ie if no cs

                  {\the\legendtextsize\ss {Elevation looking xxx deg
magnetic}\par} %NEED TO SEE IF PROJECTION ANGLE AVAILABLE TO TEX

                \else                                    %there is a cs

      {\the\legendtextsize\ss\the\outcsname { elevation looking xxx
deg}\par} %NEED TO SEE IF PROJECTION ANGLE AVAILABLE TO TEX

    \fi

 

  \else % not ATTR__elevation % print plan specific text

# % plan               

    \edef\tmp{\the\outcsname} \ifx\tmp\empty %ie if no cs 

                   %{\the\legendtextsize\ss {Plan projection (not
georeferenced)}\par}  %remove preceding % for redundant long form

                                {\the\legendtextsize\ss Arrow points to
magnetic north} 

                \else                                    %there is a cs

                                \the\legendtextsize\ss\the\outcsname %{ plan
projection}\par %remove preceding % for redundant long form

                                \edef\tmp{\the\northdir} \ifx\tmp\empty
\else

                                                {\the\legendtextsize\ss {
arrow points \the\northdir { north}}} % grid or true north

                                \fi           

# % Could report declination here             

        \edef\tmp{\the\magdecl} \ifx\tmp\empty \else

          {\the\legendtextsize\ss\the\magdecl { deg magnetic
declination}\par} %HOW TO LIMIT TO ONE DECIMAL PLACE?

        \fi  

                \fi                           

  \par\par              

  \fi % ATTR__elevation % end plan

 

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.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20180625/89cb9ba0/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 31500 bytes
Desc: not available
URL: <http://mailman.speleo.sk/pipermail/therion/attachments/20180625/89cb9ba0/attachment.png>


More information about the Therion mailing list