ShapePatch README ================== This file describes how to install and use the shapepar output driver for the XWindow drawing program XFig. The current version is 3.2.4-shape-1.1. Don't use 3.2.4-shape-1, it has two bad bugs. The naming scheme is first the XFig/Transfig version, appended shape, then the version of the patch. What is ShapePatch ? ==================== ShapePatch is a patch against Transfig, which adds the capability to export XFig figures to shape definitions for shapepar. Shapepar itself is a TeX-Macro by Donald Arsenau that allows to form a paragraph into a given shape, where the size of the shape is automatically adjusted so that the given paragraph completely fills the shape. There are some predefined shapes, like e.g. a heart. So you can form any paragraph into the form of a heart by putting \heartpar{sometext...} inside your document. It is of course possible, to define such shapes by oneself, but it involves that you resolve your shape into a polygon and enter the coordinates into your TeX-Document. This is quite crucial, and this is the point where ShapePatch comes up: It allows you to simply draw the shape you want with XFig, and then convert it to such a shape definition either by calling fig2dev manually, or by choosing "Export/Shape" in XFig (if you install the additional XFig patch). How to install ============== ShapePatch is distributed as a patch against transfig and xfig. So first get the source code of transfig and xfig, and untar them. Then copy the transfig patch into the transfig source directory, and the xfig patch respectively into the xfig source tree. Then type cd transfig.3.2.4 patch -p1 =2.0) supports a feature to use a fixed size. The paragraph will only partly fill the shape. You can specify the dimension used by ShapePatch by drawing a ruler line, that will become exactly the length 10 in the final output. For example, if you draw a vertical line and give it the comment "height", then the height of this line will correspond to the length of 10 units. Analogously, specify "width" if you want the width of a horizontal line to become 10 units wide. You also use a rectangle for this choice of the dimension. These lines will not show up in the final paragraph, they are just for construction Construction objects Objects that have no comment are ignored by ShapePatch. Thus if you need some object helping you to construct the drawing (e.g. aligning objects on a circle), you can freely draw any object you want, as long as you don't set a comment. Objects with comments that do not comply to the requirements (starting with '+', '-' or one of the reserved words 'width', 'height', 'center') are rejected. It is possible to add comments, that are "real" comments, i.e. ignored by the driver. To do this, add your comment separated with at least one blank, newline or other non-alphanumeric character like # *after* the shape specification. So if you have an object in the shapegroup "moon" that has the comment "full moon", the whole string you enter looks like +moon full moon Only the first word "moon" counts for shapegroup. You could alse have used +moon#full moon or +moon{full moon so this is considered to be bad style, better use a blank. If your object you want to comment is no shape, so simply start the comment with a blank character. If you want to comment the whole drawing, then use a newline to separate the macroname from the comment. The first line of the drawing name is taken without further examining if it would be a valid LaTeX macro name. You would get a LaTeX error, however. You can use the commandline switch "-n" to override the name givan as the drawing comment. Independent segments -------------------- This feature is available only in shapepar version >=2.0 There can be separate segments of text, coupled only by the scaling factor, the text starts in one of the shapes, after filling it jumps to the second and so on. As an example, consider to squares situated besides each other: *** *** *** *** *** *** If you convert this figure with ShapePatch, giving both squares the comment '+', the text will start in the left box, jump over the gap, continue in the right box. The next line starts again in the left, and so on. If your text would be something like "a b c d ..." you would get: abc def ghi jkl mno pqr This works also with shapepar <2.0. But say, you want to have two columns, like e.g. in a newspaper: abc jkl def mno ghi pqr which is much more readible, if the gap is big. how to tell it to ShapePatch? The solution is to use identifiers. This works only with shapepar >=2.0: If you give the left square the comment "+1" and the right one "+2", you will get the above result. Lets say you want the right column to be filled first: jkl abc mno def pqr ghi Just give "+1" to the right box and "+2" to the left. These "1" and "2" are so called identifiers, that say in which group of shapes this object is to put in. It can be any alphanumeric value, and the order is determined by the alphanumeric sort order. So we could have used "+a" and "+b" instead. Be aware, that because of the alphanumeric sort "A" comes before "a" and "z", and numbers may be sorted weirdly: 1, 10, 11, 2, 3, 4, 5, 6, 7, 8, 9 ... Of course, if one of the shape is composed by severaly objects, all objects must have the corresponding identifier. For an example, look to the chessboard or the canadian flag. Example files ============= With ShapePatch there should come some example XFig drawings together wth their translation, so you can check if the program works. There are: moon.fig: A moon face.fig: A face like a smiley music.fig: A line of sheet music with one notehead canada.fig: The canadian flag - requires shapepar>=2.0 chessboard.fig: A chessboard - requires shapepar>=2.0 Author ====== Written by Christian Gollwitzer . License is X/MIT (cf. to source code)