Home
fmp. - TeXdoc.net
Contents
1. vspace 50 math A setBGColor white a transformPath scaled 30 fullcircle b transformPath scaled 30 amp shifted 0 30 fullcircle ab buildCycle a b References Hob89 Jonn D HOBBY A METAFONT like System with PostScript Output TUGboat vol 10 no 2 pp 505 512 1989 Hob92 Jonn D HOBBY A User s manual for METAPOST Computing Science Technical Report no 162 AT amp T Bell Laboratories Murray Hill New Jersey 1992 Kor98 JOACHIM KORITTKY functional METAPOST Eine Beschreibungsspra che fiir Grafiken Diplomarbeit an der Rheinischen Friedrich Wilhelms Universitat Bonn 1998 Ohl97 THORSTEN OHL EMP Encapsulated METAPOST for TAX Technis che Hochschule Darmstadt 1998 Car99 David CARLISLE Packages in the graphics bundle User documenta tion 1999 Change History v1 0a Reference to graphicx package General Initial release 1 user documentation 5 v1 0b Documentation Optional argu General Documentation Improve ments to fmpfigure are now ments as suggested by Peter passed to the graphicx pack Barthes oi cnet ee pee 2 ALCn aso Ps dle a Gah Sas 3 vl la General Added to bibliography
2. file formats The graphicx package is used to handle the inclusion of generated FMP figures If fmp is called from within pdflatex graphicx is loaded with the pdftex driver option In this case the fall back behaviour when encountering an fmpfigure command is to read the corresponding graphics file as mps METAPOST output it will then internally be converted to PDF by graphicx When called from within normal latex graphics files are handled as eps encapsulated PostScript You probably need to load a specific PostScript driver for graphicx in this case do so by supplying fmp with the same package option that you would use for graphicx see the graphicx user manual for further information on that Acknowledgements The help of Ralf Hinze and the suggestions of Peter Bartke and Ferenc Wagner are gratefully acknowledged Source code for the examples This is file fmp doc hs generated with the docstrip utility The original source files were fmp dtx with options examples Example source code for the FMP package module FMPDoc where import FMP import FMPTree example1 binom 5 where ce circle empty binom 0 node ce binom n node ce edge binom i i lt n 1 m 2 0 setAlign AlignRight example2 box math U ooalign toPicture cArea a 0 7 cArea b 0 7 cArea ab 0 4 bOverA where cArea ac toArea a setColor c bOverA column math B setBGColor white
3. Functional METAPOST for BTX Marco Kuhlmannt 2001 11 19 Abstract Functional METAPOST FMP is a powerful frontend to the METAPOST language This package adds basic FMP support to 4TfX enabling users to keep FMP source code within their documents and by a two run mechanism including automatically generated FMP figures 1 Introduction Functional METAPOST by Joachim Korittky Kor98 adds a high level interface to the METAPOST language Hob89 Hob92 enabling the user to program their graphics using the Haskell language Impressive examples of Functional META POST can be found in Korittky s diploma thesis some of them will be given below The system and the documentation can be downloaded from http www informatik uni bonn de ralf software html Using Functional METAPOST as my standard graphics developing tool I felt a need to write a YTRX package which smoothly integrates FMP into daily work similar to the emp package by Thorsten Ohl Oh197 this is how fmp came to being The earliest version supported only the possibility to automatically produce shell scripts for graphics generation Since then I have added the possibility to encapsulate FMP code though I still ask myself if this way of maintaining code is as natural for FMP as it is for pure METAPOST in emp In case you have any questions or comments on this package feel free to send me an email May fmp help FMP to spread around the world 1 1 Examples
4. ell source you feed it into hugs and issue the generate command provided by FMP This will translate your code into low level METAPOST commands and finally produce a ready to use PostScript file 1 2 How this package works Calling hugs and typing in the generation commands is a tedious job if you keep more than but a few illustrations around This package offers the fmpfigure B gt A Figure 2 A Venn diagram cf figure 22 in Hob92 fmpfigure fmp fmpsourcefilename fmpscriptfilename fmpfigurebasename command which generates a shell script at present this only works for n x which you then can execute to have all the graphics files generated at once At the next run of 4TpX these graphic files will appear at their proper positions Besides fmp enables you to store Haskell code within a IATRxX file in case you want to have all the code for one document at one place 2 Usage 2 1 Including graphics Using fmp to include graphics from some FMP source is straightforward Let us assume that you keep two FMP figures Haskell values example1 and example 2 in a file called fmp doc hs A minimal document using the package to include these two figures would then look like this documentclass article usepackage fmp fmpsourcefilename fmp doc begin document fmpfigure example1 fmpfigure example2 end document end verbatim You include a figure into your ATEX document by using the fmp
5. f the graphics files that will be generated by hugs An index number specifying their order in the document will be appended to this name You can modify all three file names by calling the respective macros each of which takes the new name as its argument 2 4 Preamble and postamble Before something is written to the source file or the shell script file the package will output a preamble to that file The source code preamble could contain everything from comments to Haskell module identifications and basic imports while the shell script preamble should probably contain the line that calls hugs and tells it to input the rest of the file as comment Have a sample run to see the default contents of the preamble If you wish to change the text you can set a new preamble by the fmpsourcepreamble command and you can append a new line to the current preamble calling fmpaddtosourcepreamble Similar commands are available for the shell script preamble There is also a postamble which is written as the very last thing to the source code or shell script METAPOST uses the environment variable TEX to determine which T X it has to call when generating labels etc On many systems this variable defaults to tex which is certainly not what you want in conjunction with fmp One common usage for the preamble therefore is to include a line like export TEX latex or something similar depending on your shell into the generation script 2 5 Graphics
6. figure macro It takes as its mandatory argument the string identifying the figure in the Haskell source and creates a shell script containing all the hugs calls needed for the actual generation After the shell script has been written you can execute it and run IATRX again if everything went right the graphics file will appear at the place where you issued the fmpfigure command Any optional arguments to fmpfigure will be passed to the graphicx package and interpreted as if they appeared together with a includegraphics command This allows you to change the visual appearance of the included figure e g the size to which the figure shall be scaled Refer to Car99 for more information about possible paramters 2 2 Including code You can also store your FMP code in the same file than your TX source included within the fmp environment During compilation the contents of this environment are written to an external file see below 2 3 Changing file names You can control the names of three different files e the Haskell source fmpsourcefilename defaults to jobname hs fmpsourcepreamble fmpaddtosourcepreamble fmpscriptpreamble fmpaddtoscriptpreamble fmpsourcepostamble fmpaddtosourcepostamble fmpscriptpostamble fmpaddtoscriptpostamble e the shell script fmpscriptfilename defaults to fmpgenerate sh and e the graphics file base name fmpfigurebasename defaults to fmpfigure which is the base file name o
7. of Functional METAPOST Before I start to present the fmp package let me first give you two mouth watering examples of FMP the Haskell code for them can be found at the end of this document figure 1 gives a binominal tree of rank 5 figure 2 shows a simple Venn diagram Among other things these examples exhibit two features in which FMP is superior to many other graphics drawing packages around This file has version number v1 la E Mail marco kuhlmann gmx net Figure 1 A binominal tree of rank 5 e By embedding METAPOST into the Haskell programming language FMP gives the user and especially users who have previous experience in func tional programming a great tool to program graphics on a very high level level of abstraction This not only helps you to focus on the logical structure rather than on layout questions but also is especially important if you want to scale and re use old material e FMP can be easily extended For example for figure 1 the core language has been augmented by tree drawing features using much better algorithms than those of any other tree drawing package around This is especially good news for computer scientists who need trees very often but did not yet have a package to draw them on such a level of abstraction To be able to use FMP you need a Haskell interpreter such as hugs and the METAPOST program which should be part of any somewhat complete distribution of TEX Having produced a Hask
Download Pdf Manuals
Related Search
Related Contents
ISAS-Tool Version 6 : User's manual Handleiding Téléchargement FDR - Ramsar Sites Information Service EVBAVR User Guide V-1.4 Copyright © All rights reserved.
Failed to retrieve file