--- orig-www.tmac 2003-07-17 20:55:06.000000000 +0200
+++ www.tmac 2003-07-18 12:23:20.000000000 +0200
@@ -465,13 +465,14 @@
.nr www-right-ll-trap 0
.
.de www-finish-left-po
-. po -\\n[www-left-indent]u
+. po -(\\n[www-left-indent]u + \\n[www-image-gap]u)
. wh \\n[www-left-po-trap]u
. nr www-left-indent 0
..
.
+.\" called when the -R picture is finished
.de www-finish-right-ll
-. ll +\\n[www-right-indent]u
+. ll +(\\n[www-right-indent]u + \\n[www-image-gap]u)
. \" now see whether we need to inline www-finish-left-ll
. if (\\n[www-left-ll-trap]u > 0) \
. if ((\\n[www-right-ll-trap]u + 1v) >= \\n[www-left-ll-trap]u) \{\
@@ -502,51 +503,79 @@
. mk www-left-po-trap
. nr www-left-po-trap +1v
. wh \\n[www-left-po-trap]u www-finish-left-po
-. ll +\\n[www-left-indent]u
+. ll +(\\n[www-left-indent]u + \\n[www-image-gap]u)
. wh \\n[www-left-ll-trap]u
. nr www-left-ll-trap 0
..
.\" --------------------------------------------------------------------
-.\" MPIMG [-R|-L] filename [width] [height]
+.\" MPIMG [-R|-L] [-G gap] filename [width [height]]
.\"
.\" Include a png image and wrap text around it. It will work for
.\" -Tps and -Thtml. The default value for WIDTH is 1i; default value
.\" for HEIGHT is WIDTH; the default alignment is left (-L).
+.\" -G is used to layout a gap between the text and the image.
.\"
.\" Note: This macro can only be used with the `-U' option of groff,
.\" activating unsafe mode, if not used with -Thtml; the PNG image
.\" is then converted to the EPS format using netpbm utilities.
.\"
+
.de MPIMG
+. nr www-image-just 1
+. nr www-image-gap 0
+. while \\n[.$]>0 \{\
+. tm \\$1
+. if '-L'\\$1' \{\
+. nr www-image-just 1
+. shift
+. continue
+. \}
+. if '-R'\\$1' \{\
+. nr www-image-just 0
+. shift
+. continue
+. \}
+. if '-G'\\$1' \{\
+. nr www-image-gap \\$2
+. nr www-htmlimage-gap 20 \" don't know how convert to pixel
+. shift 2
+. continue
+. \}
+. break
+. \}
. nr www-width 1i
-. if !'\\$3'' \
-. nr www-width \\$3
+. if !'\\$2'' \
+. nr www-width \\$2
. nr www-height \\n[www-width]
-. if !'\\$4'' \
-. nr www-height \\$4
+. if !'\\$3'' \
+. nr www-height \\$3
. nr www-width (\\n[www-width] * 100 / 240)
. nr www-height (\\n[www-height] * 100 / 240)
+.\" -------------------------------------------------------------
. ie \\n[www-html] \{\
-. ie '\\$1'-R' \
-. HTML
+. ie !\\n[www-image-just] \
+. HTML
. el \
-. HTML
+. HTML
. \}
. el \{\
. if !r ps4html \{\
. www-make-unique-name
-. sy pngtopnm \\$2 | pnmcrop -white | pnmtops -nosetpage -noturn > \\*[www-unique-name].eps
-. ie '\\$1'-R' \{\
+. sy pngtopnm \\$1 | pnmcrop -white | pnmtops -nosetpage -noturn > \\*[www-unique-name].eps
+. ie !\\n[www-image-just] \{\
. \" we must now disable a possible left image trap
. sp -1
. if (\\n[www-left-ll-trap] > 0) \
. wh \\n[www-left-ll-trap]u
. if (\\n[www-left-po-trap] > 0) \
. wh \\n[www-left-po-trap]u
-. PSPIC -R \\*[www-unique-name].eps \\$3 \\$4
+. PSPIC -R \\*[www-unique-name].eps \\$2 \\$3
. sp -\\n[ps-desht]u
. nr www-right-indent \\n[ps-deswid]u
-. ll -\\n[www-right-indent]u
+. \" we want to have some space between text and image ll must be shorter
+. ll -(\\n[www-right-indent]u + \\n[www-image-gap]u)
. mk www-right-ll-trap
. nr www-right-ll-trap +(\\n[ps-desht]u - 1v)
. wh \\n[www-right-ll-trap]u www-finish-right-ll
@@ -560,11 +589,13 @@
. \" we must now disable a possible right image trap
. if (\\n[www-right-ll-trap] > 0) \
. wh \\n[www-right-ll-trap]u
-. PSPIC -L \\*[www-unique-name].eps \\$3 \\$4
+. PSPIC -L \\*[www-unique-name].eps \\$2 \\$3
. sp -\\n[ps-desht]u
. nr www-left-indent \\n[ps-deswid]u
-. po +\\n[www-left-indent]u
-. ll -\\n[www-left-indent]u
+. \" increase offset by gap
+. po +(\\n[www-left-indent]u + \\n[www-image-gap]u)
+. \" decrease line length by gap
+. ll -(\\n[www-left-indent]u + \\n[www-image-gap]u)
. mk www-left-ll-trap
. nr www-left-ll-trap +(\\n[ps-desht]u - 1v)
. wh \\n[www-left-ll-trap]u www-finish-left-ll