[Therion] Embedded image does not appear in some layouts
Bill Gee
bgee at campercaver.net
Wed Feb 12 16:48:47 CET 2025
Here is a puzzle ... I have set up a thconfig file to create a profiles
map, then used the "map-image" layout directive to include it in the
output files. It works ... SOMETIMES!
Take a look at the thconfig file embedded below. The profiles image
appears on the files produced from the MainMap and MainMapNoColor
layouts. It does not appear on MainMapPrint.
Why? Does it have something to do with the TeX code in MainMapPrint?
Thanks!
--
===============
Bill Gee
encoding utf-8
# Bring in the main configuration file
source GeronimoSpringsCave.th
# Used for most of the maps
select GeronimoSpringsCave
# Load the Metapost code for custom symbols
input ../TherionMasterFiles/CustomSymbolsCode.txt
# Bring in the code for custom scale bar
input ../TherionMasterFiles/ScaleBarCode.txt
# This layout is for the main 2D map, all on one page
layout basics
language en_US
units imperial
scale-bar 50 feet
page-numbers on
scale 1 200
north true
symbol-color area water [0 0 100]
map-comment "A DistoX survey of Geronimo Springs Cave (CAM-086), Missouri"
statistics explo all
legend on
map-header 3 60 w
symbol-set UIS
# Set point height symbols to be enclosed in boxes
code metapost
p_label_mode_height:=6;
endcode
# Section for PDF properties
doc-author "Bill Gee"
doc-title "Map of Geronimo Springs Cave (CAM-086)"
doc-subject "Plan map of Geronimo Springs Cave (CAM-086)"
# Section for map photos
# Add in the elevations maps
# Bring in the custom symbols
copy CustomSymbols
# Bring in the custom scale bar
copy CustomScaleBar
# Reassign names
symbol-assign point gradient AMER
symbol-assign point stalagmite AMER
symbol-assign point stalactite AMER
symbol-assign point pillar AMER
symbol-assign point popcorn AMER
endlayout
# This layout is for profile maps. It turns off the legend and other stuff
layout profiles
legend off
map-header 0 0 off
symbol-hide group centerline
color map-fg [100 86 66]
endlayout
layout MainMapPrint
copy basics
scale 1 200
debug off
symbol-hide group centerline
color map-fg [100 86 66]
# Entrance passage profile
map-image 0 0 sw GeronimoSpringsCave-Profiles.pdf
# Change the size of the legend
code metapost
tmpscale=1.3;
def draw_legend_box =
% Next line controls size of symbol in each symbol table box
currentpicture := currentpicture scaled tmpscale;
% Next line controls size of symbol table box background
clip currentpicture to unitsquare inscale xscaled tmpscale
yscaled tmpscale;
drawoptions();
pickup PenB;
% I think the next line controls the size of each symbol table box
draw unitsquare inscale xscaled tmpscale yscaled tmpscale;
enddef;
%clear the background of the larger legend boxes
def clean_legend_box =
unfill unitsquare inscale xscaled tmpscale yscaled tmpscale;
enddef;
%change the value of inscale to fill the legend boxes
def inscale =
xscaled (legend_scale*tmpscale) yscaled
(0.618*legend_scale*tmpscale)
enddef;
endcode
code tex-map
\def\maplayout{
\legendbox{3}{85}{W}{
\def\txtsize{16} % Define the default text size
\legendwidth=20 cm
\legendtextsectionsize={\size[\txtsize]}
\legendtextsize={\size[\txtsize]}
\legendtextheadersize={\size[40]}
\hsize=\legendwidth
\the\legendcontent={\size[\txtsize]}
\the\legendtextsize\ Map generated at \the\time
\the\currentdate\medskip
\the\legendtextsize\ Therion version \the\thversion
}
}
endcode
#end of TeX code to change legend size
endlayout
# Layouts to specify colors
layout MainMapNoColor
copy basics
color map-fg [100 86 66]
# Entrance passage profile
map-image 0 0 sw GeronimoSpringsCave-Profiles.pdf
endlayout
layout MainMapColorized
copy basics
color map-fg altitude
# Entrance passage profile
map-image 0 0 sw GeronimoSpringsCave-Profiles.pdf
endlayout
# Change the legend callouts
input ../TherionMasterFiles/LegendCallouts.txt
# Profiles map
export map -proj elevation -layout profiles -o
GeronimoSpringsCave-Profiles.pdf
# Basic plan map, normal colors
export map -proj plan -layout MainMapNoColor -o GeronimoSpringsCave.pdf
# Map with no centerline
export map -proj plan -layout MainMapPrint -o GeronimoSpringsCave-Print.pdf
# Basic plan map, colorized for elevations
export map -proj plan -layout MainMapColorized -o
GeronimoSpringsCaveColored.pdf
# 3D map for use with Loch
export model -fmt loch -o GeronimoSpringsCave.lox
# 3D map for use with Aven
export model -fmt 3d -o GeronimoSpringsCave.3d
# 3D map for use with ArcGIS
export model -fmt esri -o ./GeronimoSpringsCave-ESRI
# KML file for overlay in Google Earth - Requires lat-long specified in
the survey data file
export map -proj plan -fmt kml -o GeronimoSpringsCave.kml
# Produce the debug maps
system "/usr/local/bin/therion -l therion-Debug.log thconfig-Debug"
More information about the Therion
mailing list