FW: 2D output header title when therion can't decide which one to use
Am working towards answering this question of mine, but not quite there yet.
If there are multiple 'selected' maps and 'source' surveys for a particular projection, then a blank output map 'title' is produced.
Is it possible to do something along the lines of the following pseudo-code?
code tex-map
If \cavename IS EMPTY OR ZERO LENGTH STRING THEN \cavename={Terikan River Cave} ELSE \cavename = \cavename
endcode
I suspect that \cavename is never empty, but rather is set to an empty string by Therion in the above scenario I have got as far as. code tex-map \edef\therioninferedmaptitle{\the\cavename} %save existing calculated cavename to variable \ifx\therioninferedmaptitle\empty %test if therioninferedmaptitle is empty (undefined?) \cavename={Caves of the Flora Area} %if therioninferedmaptitle is empty set a title that describes all the caves selected as a group \else %if it's not empty, do nothing, ie keep the map title value set by therion \fi endcode This works, except that the line \cavename={Caves of the Flora Area} is never run, even when \cavename appears empty. I have tried using \ifx\therioninferedmaptitle\"" as an alternative test to no avail. (All the above run without syntax errors, so I am making some progress at least) What I need is a bit of guidance on the correct test for an empty \cavename Any ideas? Bruce
I have figured out by trial and error that if Therion cannot determine a unique map output title, it assigns a value of 'sort of empty but not quite empty' to \cavename. What ever that value is, it looks like a space character, ie blank but with a height that equals a typical text line height. It's not one space, not two spaces, not an empty string, and I can see I could end up testing a lot of non printing characters before I find it. Maybe the programmer can remember what the magic value is, or someone with better tex skills (than my almost non-existent tex skills) can offer some code to identify the contents of a string variable, ie it's length or much better a list of ascii codes? code tex-map \edef\therioninferedmaptitle{\the\cavename} %save existing calculated cavename to variable %could put some code here to output the ascii codes contained in \cavename \edef\nostring{ } %save 'empty string' to variable \ifx\therioninferedmaptitle\nostring %test if therioninferedmaptitle matches empty string \cavename={Caves of the Flora Area} %if therioninferedmaptitle is empty do this \else %if it's not empty, do nothing, ie keep the value set by therion \fi endcode ;- ) Bruce
Hi Bruce, if you run therion in debug mode (command line -d option) you will get thTMPDIR/th_texts.tex file where \cavename is defined. I suspect that it would be really empty in your case. If I remember correctly, the reason why you can't redefine an empty \cavename is that macro \legendcontent (which is responsible for displaying the texts in the map header) tests if \cavename is empty before you assign some text into \cavename and is set up to display nothing, regardless of whether \cavename is later empty or not. I think it would be sufficient to change these lines in \legendcontent definition \edef\tmp{\the\cavename} \ifx\tmp\empty \else {\the\legendtextheadersize\the\cavename}\vskip1cm \fi to \edef\tmp{\the\cavename} \ifx\tmp\empty{\the\legendtextheadersize Your cave name}\vskip1cm\else {\the\legendtextheadersize\the\cavename}\vskip1cm \fi Please test if it would work. Martin On Sun, Feb 14, 2010 at 12:57 AM, Bruce <dangle@tomo.co.nz> wrote:
I have figured out by trial and error that if Therion cannot determine a unique map output title, it assigns a value of ‘sort of empty but not quite empty’ to \cavename.
What ever that value is, it looks like a space character, ie blank but with a height that equals a typical text line height.
It’s not one space, not two spaces, not an empty string, and I can see I could end up testing a lot of non printing characters before I find it.
Maybe the programmer can remember what the magic value is, or someone with better tex skills (than my almost non-existent tex skills) can offer some code to identify the contents of a string variable, ie it’s length or much better a list of ascii codes?
code tex-map
\edef\therioninferedmaptitle{\the\cavename} %save existing calculated cavename to variable
%could put some code here to output the ascii codes contained in \cavename
\edef\nostring{ } %save ‘empty string’ to variable
\ifx\therioninferedmaptitle\nostring %test if therioninferedmaptitle matches empty string
\cavename={Caves of the Flora Area} %if therioninferedmaptitle is empty do this
\else
%if it's not empty, do nothing, ie keep the value set by therion
\fi
endcode
;- )
Bruce
_______________________________________________ Therion mailing list Therion@speleo.sk http://mailman.speleo.sk/mailman/listinfo/therion
participants (2)
-
Bruce -
Martin Budaj