[Therion] Therion Digest, Vol 126, Issue 5
Dirk Peinelt
dirk.peinelt at t-online.de
Sun Jun 5 15:12:12 CEST 2016
Hi Bruce,
what i mean is to use the values of the Therion Tex-variables in a MetaPost
symbol definition. To calculate some or to print it out. I don't no if there
is a special syntax to get them.
dirk
-----Ursprüngliche Nachricht-----
Von: therion-bounces at speleo.sk [mailto:therion-bounces at speleo.sk] Im Auftrag
von therion-request at speleo.sk
Gesendet: Sonntag, 5. Juni 2016 00:42
An: therion at speleo.sk
Betreff: Therion Digest, Vol 126, Issue 5
Send Therion mailing list submissions to
therion at speleo.sk
To subscribe or unsubscribe via the World Wide Web, visit
http://mailman.speleo.sk/mailman/listinfo/therion
or, via email, send a message with subject or body 'help' to
therion-request at speleo.sk
You can reach the person managing the list at
therion-owner at speleo.sk
When replying, please edit your Subject line so it is more specific than
"Re: Contents of Therion digest..."
Today's Topics:
1. MetaPost/Tex: variable \magdecl (Dirk Peinelt)
2. Re: MetaPost/Tex: variable \magdecl (Bruce)
----------------------------------------------------------------------
Message: 1
Date: Sat, 4 Jun 2016 13:05:12 +0200
From: "Dirk Peinelt" <dirk.peinelt at t-online.de>
Subject: [Therion] MetaPost/Tex: variable \magdecl
To: <therion at speleo.sk>
Message-ID: <003b01d1be50$f7c6b130$e7541390$@t-online.de>
Content-Type: text/plain; charset="us-ascii"
Is there a way to handle the content of the \magdecl TEX-variable in
METAPOST? (Therion V5.3.16)
In a string or numeric? - I think, i've an syntax problem.
1.) string handling:
string dec;
%dec:="3.022"; % FINE!
dec:=\magdecl; % ERROR
p_label.top(thTEX(dec),(0,0),0,8); % >> string output
2.) numeric handling:
numeric dec;
%dec:=3.022; % FINE!
dec:=\magdecl; % ERROR
p_label.top(thTEX(decimal dec),(0,0),0,8); % >> numeric to string output
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mailman.speleo.sk/pipermail/therion/attachments/20160604/5fc4d84b/at
tachment-0001.htm>
------------------------------
Message: 2
Date: Sun, 5 Jun 2016 10:41:34 +1200
From: Bruce <bruce at tomo.co.nz>
Subject: Re: [Therion] MetaPost/Tex: variable \magdecl
To: 'List for Therion users' <therion at speleo.sk>
Message-ID: <19C585BD8B504D7D880F382450A5181E at JUICEBRAIN>
Content-Type: text/plain; charset="us-ascii"
Dirk
I don't know much about this, but have managed to tweak the standard header
as below;
A bit long winded, and I have only copied the conventions in the standard
Therion code, but you may get some clues.
layout LayoutExperimentalHeader
#This code is experimental redefinition of map header
#Bruce Mutton Therion 5.3.15 make use of new variables
#this one affects maps only
code tex-map
% start bruces addition
\newtoks\thversiontitleA \thversiontitleA={Compiled}
\newtoks\thversiontitleB \thversiontitleB={Therion }
\newtoks\datetitle \datetitle={on }
\newtoks\depthrangetitle \depthrangetitle={Depth range from }
% end bruces addition
\legendcontent={%
\hsize=\legendwidth
\color[0 0 0]\the\legendtextcolor
\ifnortharrow\vbox to 0pt{\line{\hfil\northarrow}\vss}\fi
%print cave map name
\edef\tmp{\the\cavename} \ifx\tmp\empty \else
{\the\legendtextheadersize\the\cavename}\vskip1cm
\fi
%print scalebar
\ifscalebar\scalebar\vskip1cm\fi
% start bruces addition
# % CS
\edef\tmp{\the\outcsname} \ifx\tmp\empty \else
{\the\legendtextsize\ss\the\outcsname\par}
\fi
\edef\tmp{\the\northdir} \ifx\tmp\empty \else
{\the\legendtextsize\ss\the\northdir north }
\fi
\edef\tmp{\the\magdecl} \ifx\tmp\empty \else
{\the\legendtextsize\ss\the\magdecl deg \par}
\fi
% end bruces addition
%print comment
{\rightskip=0pt plus 3em\parskip=3bp
\edef\tmp{\the\comment} \ifx\tmp\empty \else
{\the\legendtextsize\the\comment} \par\medskip
\fi
%print cavelength and depth
\everypar{\hangindent=2em\hangafter=1}
\edef\tmp{\the\cavelength} \ifx\tmp\empty \else
{\the\legendtextsize\si\the\cavelengthtitle: \ss\the\cavelength\par}
\fi
\edef\tmp{\the\cavedepth} \ifx\tmp\empty \else
{\the\legendtextsize\si\the\cavedepthtitle: \ss\the\cavedepth\par}
\fi
# % start bruces addition
# % altitude
\edef\tmp{\the\cavemaxz} \ifx\tmp\empty \else
{\the\legendtextsize\si\the\depthrangetitle \ss\the\cavemaxz m to}
\fi
\edef\tmp{\the\caveminz} \ifx\tmp\empty \else
{\the\legendtextsize\ss\the\caveminz m \par} %above mean sea level
\fi
# % end bruces addition
%print explorers names
\edef\tmp{\the\exploteam} \ifx\tmp\empty \else
{\the\legendtextsize\si\the\explotitle:
\ss\the\exploteam\quad\si\the\explodate\par}
\fi
%print surveyors names
\edef\tmp{\the\topoteam} \ifx\tmp\empty \else
{\the\legendtextsize\si\the\topotitle:
\ss\the\topoteam\quad\si\the\topodate\par}
\fi
%print cartographers names
\edef\tmp{\the\cartoteam} \ifx\tmp\empty \else
{\the\legendtextsize\si\the\cartotitle:
\ss\the\cartoteam\quad\si\the\cartodate\par}
\fi
# % start bruces addition (compilation version and date modified to use
built-in 5.3.15 variables)
\edef\tmp{\the\thversion} \ifx\tmp\empty \else %only write version and
date if version is not emplty
{\the\legendtextsize\si\the\thversiontitleA: \ss\the\thversiontitleB
\ss\the\thversion}
% \fi
% \edef\tmp{\the\currentdate} \ifx\tmp\empty \else
{\the\legendtextsize\si\the\datetitle \ss\the\currentdate\par}
\fi
# % end bruces addition
%print copyrights
\edef\tmp{\the\copyrights} \ifx\tmp\empty \else
{\the\legendtextsize\ss\the\copyrights\par}
\fi
}
\formattedlegend
\color[0 0 0]
}
endcode
endlayout LayoutExperimentalHeader
Bruce
_____
From: therion-bounces at speleo.sk [mailto:therion-bounces at speleo.sk] On Behalf
Of Dirk Peinelt
Sent: Saturday, 4 June 2016 11:05 p.m.
To: therion at speleo.sk
Subject: [Therion] MetaPost/Tex: variable \magdecl
Is there a way to handle the content of the \magdecl TEX-variable in
METAPOST? (Therion V5.3.16)
In a string or numeric? - I think, i've an syntax problem.
1.) string handling:
string dec;
%dec:="3.022"; % FINE!
dec:=\magdecl; % ERROR
p_label.top(thTEX(dec),(0,0),0,8); % >> string output
2.) numeric handling:
numeric dec;
%dec:=3.022; % FINE!
dec:=\magdecl; % ERROR
p_label.top(thTEX(decimal dec),(0,0),0,8); % >> numeric to string output
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mailman.speleo.sk/pipermail/therion/attachments/20160605/8211a9c1/at
tachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 7915 bytes
Desc: image003.jpg
URL:
<http://mailman.speleo.sk/pipermail/therion/attachments/20160605/8211a9c1/at
tachment.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.jpg
Type: image/jpeg
Size: 4484 bytes
Desc: image004.jpg
URL:
<http://mailman.speleo.sk/pipermail/therion/attachments/20160605/8211a9c1/at
tachment-0001.jpg>
------------------------------
_______________________________________________
Therion mailing list
Therion at speleo.sk
http://mailman.speleo.sk/mailman/listinfo/therion
End of Therion Digest, Vol 126, Issue 5
***************************************
More information about the Therion
mailing list