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

WikiBooks TeX – basic – on the bottom of the page there are several links to documentation of TeX:

TeX Users Group
Michael Doob's guide to TeX and Czech version
TeX for the Impatient
TeX Primitive Control Sequences – TeX Reference Manual
TeX by Topic – Book by Victor Eijkhout that has been made freely available

WikiBooks LaTeX/Plain_TeX – a bit too advanced

(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
    \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. ( On Linux you can put the logo under a directory images/ and do: “export TEXINPUTS=.:`pwd`//:” )

Example of modification of header of map (Martin Budaj)

  code tex-map

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


  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

    \hsize=\legendwidth  %% or directly e.g. \hsize=5 cm

\hsize default is the width of map without margins.

To separate out legend, scale bar and north arrow (Andrey Kozhenkov)

This Tex code separates out legend, north arrow and scale bar and can place them in specified position. Please note that invoking custom legend will cause map-image to fail. Instead of that \loadpicture command with full path to image can be used as shown below.

 code tex-map
\legendbox{85}{95}{NW}{              % set legend position
	\legendwidth 25 cm           % set width of the legend
	\legendtextsize={\size[18]}  % set font size
	\input th_legend
\legendbox{15}{95}{NW}{\northarrow}      % set north arrow position
\legendbox{50}{5}{NW}{\scalebar} 	 % set scale bar position
      \legendbox{5}{95}{NW} {\loadpicture{/full/path/to/image.png}}  % insert image. default map image command will not work.

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

  code tex-map
    \ifnortharrow\vbox to 0pt{\line{\hfil\northarrow}\vss}\fi
    \edef\tmp{\the\cavename} \ifx\tmp\empty \else
      {\size[26]\the\cavename} \vskip1cm
    {\rightskip=0pt plus 3em\parskip=3bp
      \edef\tmp{\the\comment} \ifx\tmp\empty \else
        {\size[12]\the\comment} \par\medskip
      \edef\tmp{\the\cavelength} \ifx\tmp\empty \else
        {\size[12]\si\the\cavelengthtitle: \ss\the\cavelength\par}
      \edef\tmp{\the\cavedepth} \ifx\tmp\empty \else
        {\size[12]\si\the\cavedepthtitle: \ss\the\cavedepth\par}
      \edef\tmp{\the\exploteam} \ifx\tmp\empty \else
  \edef\tmp{\the\topoteam} \ifx\tmp\empty \else
    {\size[12]\si\the\topotitle: \ss\the\topoteam\quad\si\the\topodate\par}
  \edef\tmp{\the\cartoteam} \ifx\tmp\empty \else
      \edef\tmp{\the\copyrights} \ifx\tmp\empty \else

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}}{}}

On my system this produces…

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.

layout LayoutMapBorder
code tex-map
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}

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

  code tex-map
      \topoteam{Your team.}

… 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

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

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

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

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
    \vbox to \ht\navbox{
            \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}%
              \hbox to 0pt{\hss\showpointer\pointerS\hss}
    \vbox to \ht\navbox{
    \ifnortharrow\hbox to 0pt{\hss\northarrow\qquad}\fi
    \ifscalebar\hbox to 0pt{\hss\scalebar\qquad}\fi

endlayout LayoutAtlasNorthArrow

  • tex.txt
  • Last modified: 5 years ago
  • by akozhenkov