How do all the metapost parts fit together.

Martin Budaj m.b at speleo.sk
Mon Sep 8 12:06:18 CEST 2003


Michael Lake writes:

> I see that thPoint.mp contains...

...

> and that thdraw is defined in mpost/therion.mp which I think is generated from thmpost.h which is generated from your RCS system. I am trying to work out how this all fits together.


Actually, thmpost.h file is generated from all metapost sources by the script genmpost.pl in the mpost directory. The reason for this is that we had problems to set-up TeX and MetaPost searching paths for macro files indenpendent on used OS and TeX distribution. Now all macros are stored in the therion executable in a form of a string and are written to working directory just before running metapost and tex.

> I gather then that you have some scripts that will generate HTML from the file and that the HTML can document the available symbols. Am I guessing right? Like the ASF symbol for a fixed station.


This HTML-like markup is an artefact from 1999/2000 version. There is a perl script which generated HTML documentation, see
http://therion.speleo.sk/symlib/ for an example.
We plan to make such documentation easier, without HTML markup -- this will require to use standard names for all the symbols, based on symbol names in the Therion Book, e.g. p_sand_UIS for UIS point symbol for sand.

> What would be nice would be to generate automatically a PDF doc that has the name of the UIS symbol and it's picture i.e. run a script that processes the mp fragments, extracts the name and desription, creates the eps files and then runs pdflatex to make a table of all the UIS symbols listed alphabetically or by type of symbol.


This'll be no problem then. We want to support also automatical creation of a map legend which would contain only symbols used in particuler map &c.

> The reason why I am trying t fit it together is so I can do things like make my own symbols -- well even help you make the many other UIS symbols that arent in therion yet too. I dont know much metapost but can learn. It appears at present that to add new symbols one must add the mp code and then recompile.


It's possible to add/change metapost symbols without new therion compilation. The interface is rather experimental but should work.
You may include symbol re-definition in the layout command (after the undocumented `code metapost' command) in the last development version of therion:
layout my
  ...
# indicates that following lines are metapost code
  code metapost

# follows an example of an redefinition of a stalactite to empty symbol
#
# Stalactite is (at present; will be changed soon) internal therion's
# name for stalactite point symbol -- look at the first column in
# the file thTrans.mp (which maps internal names to names used
# in the metapost definitions)
#
# Parameters count and type is fixed; see the original definition
# of the stalactite symbol (p_stalactite_UIS) in the file thPoint.th

    def Stalactite(expr a,b,c,d) =
    enddef;
 endlayout

> Also I see you need help with writing some sections in the manual - like the section "New map symbols".


Yes, help is welcome ;) but we have probably to clean 4-years old metapost code first... Then I'll try to write at least some hints how to create new symbols.
Regards, Martin




More information about the Therion mailing list