tex

This is an old revision of the document!


…is all about typesetting for pdf and svg outputs. It takes metapost symbols and cave data supplied by Therion and puts it all together on the 'page'.

(include some generic tex links here)

All macros and predefined boxes (like \scalebar) are described in the `Page layout in the map mode' chapter of the recent thbook

(Can we link directly to the chapter directly in the on-line thbook?

How can I insert the logo of my speleo club in map? (Martin Budaj)

Currently it's possible using the following in the layout:

  code tex-map
  
  \def\loadpicture#1{\pdfximage{#1}\pdfrefximage\pdflastximage} 
  \def\maplayout{
    \legendbox{0}{100}{NE}{\the\legendcontent}
    \legendbox{100}{100}{NW}{\loadpicture{/absolute/path/to/file.png}}        %%% pdf, png, jpg supported
  }

The first three arguments of \legendbox macro are the same as of map-header command.

Note: If you use an absolute path then your therion file may not be portable to other users. Instead of the absolute path in your therion file you can use just the 'file.png“ and set the absolute path in the TEXINPUTS env variable.

export TEXINPUTS=.:/absolute/path/to/folder//:

The first dot means the current directory will be searched first. At the end the // means that TeX programs will search recursively in that folder. The final trailing colon means “append the standard value of TEXINPUTS”. At least now you can tell another user to set the TEXINPUTS and not edit your therion file.


Example of modification of header of map (Martin Budaj)

  code tex-map
    \def\maplayout{
      \legendbox{0}{100}{NW}{\northarrow\scalebar}
      \legendbox{100}{100}{NW}{\scalebar}
    }

it produces two headers for one map (one in the upper-left, second in the upper-right corner) – one arrow and two scale-bars – just for an illustration. You may use any number of \legendbox'es inside of \maplayout definition.


Width of Header (Andrew Atkinson from email by Martin Budaj)

The standard Header can be controlled by

  legend-width 20 cm
  

or

  code tex-map
    \legendwith=20 cm

The value of \legendwith is evaluated only in the predefined macro \legendcontent which prints the complete legend. With \legendbox customisation you need to set the width of the \legendbox with \hsize

  \legendbox{60}{10}{nw}{
    \hsize=\legendwidth  %% or directly e.g. \hsize=5 cm
    \northarrow
    \bigskip
    \scalebar
    \bigskip
    \bigskip
    \the\comment
  }
  

\hsize default is the width of map without margins.


To change the size of font for name of cave (Martin Budaj)

  code tex-map
  \legendcontent={%
    \hsize=\legendwidth
    \ifnortharrow\vbox to 0pt{\line{\hfil\northarrow}\vss}\fi
    \edef\tmp{\the\cavename} \ifx\tmp\empty \else
      {\size[26]\the\cavename} \vskip1cm
    \fi
    \ifscalebar\scalebar\vskip1cm\fi
    {\rightskip=0pt plus 3em\parskip=3bp
      \edef\tmp{\the\comment} \ifx\tmp\empty \else
        {\size[12]\the\comment} \par\medskip
      \fi
      \everypar{\hangindent=2em\hangafter=1}
      \edef\tmp{\the\cavelength} \ifx\tmp\empty \else
        {\size[12]\si\the\cavelengthtitle: \ss\the\cavelength\par}
      \fi
      \edef\tmp{\the\cavedepth} \ifx\tmp\empty \else
        {\size[12]\si\the\cavedepthtitle: \ss\the\cavedepth\par}
      \fi
      \edef\tmp{\the\exploteam} \ifx\tmp\empty \else
        {\size[12]\si\the\explotitle:
  \ss\the\exploteam\quad\si\the\explodate\par}
      \fi
  \edef\tmp{\the\topoteam} \ifx\tmp\empty \else
    {\size[12]\si\the\topotitle: \ss\the\topoteam\quad\si\the\topodate\par}
  \fi
  \edef\tmp{\the\cartoteam} \ifx\tmp\empty \else
    {\size[12]\si\the\cartotitle:
  \ss\the\cartoteam\quad\si\the\cartodate\par}
      \fi
      \edef\tmp{\the\copyrights} \ifx\tmp\empty \else
        {\size[12]\ss\the\copyrights\par}
      \fi
    }
    \formattedlegend
  }

where default *\size[26]* before *\the\cavename* change to another size.


Add thedegree symbol (°) to the map-comment (Stacho Mudrak)

  code tex-map
      \comment={\vbox{\halign{#\hfil\cr\thfa Coordinates: $30\,^{\circ}$ \cr  
      Line 2 of map comment.\cr}}{}}
  endcode

Stacho
On my system this produces…

цООРДИНАТЕС 30 ◦
Line 2 of map comment.

So I'm guessing that the tex code is supposed to make some kind of box on the top line, then maybe a change of language?, then $30\,^{\circ}$ produces 30 ◦, then a new line.

Seems there is more to explain here wrt the language… Bruce


Map Border (Bruce Mutton) Feb 2010 versions 5.2 to 5.3…

The description in the Therion Book was too abbreviated for me for the first two years!

Here is how to add the map border tex code to your layout.

#CODE TO PUT BORDER AROUND MAP
#-----------------------------
layout LayoutMapBorder
code tex-map
  \framethickness=0.5mm
endlayout LayoutMapBorder


Modifications of header on map (Stacho Mudrak)

  code tex-map
  
    \cavename={Terikan River Cave}
    \topotitle={Surveyed by}
    \cartotitle={Drawn by}
    \explotitle={Explored by}
  
  endcode

Changing the value for \cavelength or \cavedepth (Stacho Mudrak)

  code tex-map
      \topoteam{Your team.}
      \cavelength{1000\thinspace{}ft}
      \cavedepth{300\thinspace{}m}
  endcode

… and if you want to use the value calculated by therion but modify it somehow, (Bruce Mutton Feb 2010 versions 5.2.14 to 5.3…)

code tex-map
  \edef\histlength{\the\cavelength}   %save existing calculated cavelength to variable
  \cavelength={Here it is... \histlength\ from historic surveys \histlength\ you get the idea} %redefine cavelength value
endcode 

This produces…

“Here it is… 1728m from historic surveys 1728m you get the idea”

after the Length: title in the map header box.

Suppress the display of cave length and cave depth in the map header (Bruce Mutton May2012)
Theron's layout statements allow you to suppress the printing of north arrow, scale bar, explorers, surveyors, cartographers and copyright, but not cave length and depth. The following code in your layout will suppress length and depth.

   code tex-map
    \cavelength={} %empty
    \cavedepth={}  %empty
   endcode

Output Map Title Override (Bruce Mutton) Feb 2010 versions 5.3

    code tex-map
   % Output map title as determined by Therion 5.3 is stored in cavename. 
   % It will be empty if there are multiple maps selected for any one projection
   % AND there are multiple source surveys identified in the thconfig file 
   % ie Therion can not infer a unique title from the input data given.
   % This code allows you to define an output map title {cavename} if it happens to be empty
   
  \edef\temp{\the\cavename}        % cavename from Therion   
  \edef\nostring{}                 % empty string 
  \ifx\temp\nostring             % test if cavename is empty
        % if empty reassign cavename to describe selected maps as a group

		\cavename={Caves of the Entire Flora Region} 
		
  \else % if not empty keep the value set by therion, or assign an override cavename here
  \fi
  endcode         

You can achieve a similar effect (but better, and with less effort) by using Therion's built in -map-level feature, assuming, as above, that you have a hierarchy of maps defined.

In your thconfig file include…

select MiddleEarthPlanMap  -map-level 1 # or 2, 3, basic etc

In your layout you might also include…

colour-legend on   # display of legend that identifies <altitude>, <scrap>, <map> etc
colour map-fg map  # Shading in cave passage, <colour>, <altitude>, <scrap>, <map>

The -map-level results in pdf outputs with a unique layer for each sub-map.
The 'map-fg map' results in an output that gives each map a unique colour



Atlas with North Arrow and Scalebar (Bruce Mutton) August 2009 versions 5.2.9-ish

#CODE TO CUSTOMISE ATLAS OUTPUT
#------------------------------
layout LayoutAtlasNorthArrow
#This code is a redefinition of the default atlas definition
#that includes both north arrow & scale bar beside the navigation pane

code tex-atlas
\def\dopage{%
 \vbox{\centerline{\framed{\mapbox}}
  \bigskip
  \line{%
    \vbox to \ht\navbox{
      \hbox{\size[20]\the\pagelabel
        \ifpagenumbering\space(\the\pagenum)\fi
        \space\size[16]\the\pagename}
      \ifpagenumbering
        \medskip
        \hbox{\qquad\qquad
          \vtop{%
            \hbox to 0pt{\hss\showpointer\pointerN\hss}
            \hbox to 0pt{\llap{\showpointer\pointerW\hskip0.7em}%
              \raise1pt\hbox to 0pt{\hss$\updownarrow$\hss}%
              \raise1pt\hbox to 0pt{\hss$\leftrightarrow$\hss}%
              \rlap{\hskip0.7em\showpointer\pointerE}}
              \hbox to 0pt{\hss\showpointer\pointerS\hss}
          }\qquad\qquad
          \vtop{
            \def\arr{$\uparrow$}
            \showpointerlist\pointerU
            \def\arr{$\downarrow$}
            \showpointerlist\pointerD
          }
        }
      \fi
      \vss
    }
    \hss
    \vbox to \ht\navbox{
    \ifnortharrow\hbox to 0pt{\hss\northarrow\qquad}\fi
    \vss
    \ifscalebar\hbox to 0pt{\hss\scalebar\qquad}\fi
    }
    \box\navbox
  }
 }
}

endlayout LayoutAtlasNorthArrow


  • tex.1421320705.txt.gz
  • Last modified: 9 years ago
  • by speleolinux