groff before CVS: release 1.07
[s-roff.git] / PROBLEMS
blob3bbe2bbc17d30555d8eddf5bffa23f5da770397a
1 This file describes various problems that have been encountered in
2 compiling, installing and running groff.  Suggestions for additions or
3 other improvements to this file are welcome.
5 * On a DECstation or other machine using a MIPS cpu, gcc/g++ 2.2.2
6 gets a fatal signal while compiling tbl/main.c and tbl/table.c.
8 Upgrade to gcc 2.3 or compile those files without -O.
10 * I get lots of `numeric overflow' error messages whenever I run
11 groff; I compiled groff with AT&T C++ 2.0 with an ANSI C compiler.
13 Make sure -DCFRONT_ANSI_BUG is included in DEFINES in the top-level
14 Makefile.  If that doesn't solve the problem, define INT_MIN as
15 -INT_MAX in libgroff/lib.h.
17 * I get errors when I try to compile groff with Sun C++.
19 Groff requires header files that are moderately compatible with AT&T
20 C++ and ANSI C.  With some versions of Sun C++, the supplied header
21 files need some of the following changes to meet this requirement:
22 <string.h> must declare the mem* functions, (just add `#include
23 <memory.h>' to <string.h>); the first argument to fopen and freopen
24 should be declared as `const char *'; the first argument to fread
25 should be declared as `void *'; the first argument to fwrite should be
26 declared as `const void *'; malloc should be declared to return `void
27 *'; in <alloca.h>, the declaration `extern "C" { void
28 *__builtin_alloca(int); }' should be added; declarations of getopt(),
29 optarg, optind and opterr should be added to <stdlib.h>; in
30 <sys/signal.h> the return type and the second argument type of
31 signal() should be changed to be `void (*)(int)'.
33 You can either change them in place, or copy them to some other
34 directory and include that directory with a -I option.
36 * I get errors when I try to compile groff with DEC C++.
38 Rebuild the bison-generated parsers (pic/pic.cc, eqn/eqn.cc,
39 refer/label.cc) using DEC yacc.  Fix the declaration of write() in
40 <unistd.h> so that the second argument is a const char *.  Fix the
41 declaration of open() in <sys/file.h> so that the first argument is a
42 const char *.
44 * I get errors compiling the files eqn/eqn.cc, pic/pic.cc,
45 refer/label.cc.  I'm not using gcc or g++ as my C++ compiler.
47 These files are generated by bison.  One possible problem is that
48 they're not including <alloca.h> when they need to.  Try adding
49 #include <alloca.h>.  Alternatively you could try regenerating the
50 parsers using your system's version of yacc.  To do this, rename these
51 files to something, change the definition of YACC in the top-level
52 Makefile and rebuild.
54 * On Ultrix, the make stops with the message
56   *** Error code 1
58   Stop.
60 for no apparent reason.
62 Use GNU make.
64 * Groff can't handle my troff document. It works fine with AT&T troff.
66 Read the section on incompatibilities in gtroff(1).  Try using the -C
67 option.  Alternatively there's the sed script in tmac/fixmacros.sed
68 which will attempt to edit a file of macros so that it can be used
69 with groff without the -C flag.
71 * groff -Tdvi produces dvi files that use fonts at weird magnifications.
73 Yes, it does.  You may need to compile fonts with Metafont at these
74 magnifications. The CompileFonts script in the devdvi/generate
75 directory may help you to do this. (It will take a *long* time.)
77 * pic output is not centered horizontally; pictures sometimes run off
78 the bottom of the page.
80 The macro package you are using is not supplying appropriate definitions
81 of PS and PE.  Give groff a -mpic option.
83 * I'm having problems including PostScript illustrations using the PSPIC
84 macro.
86 A PostScript document must meet three requirements in order to be
87 included with the PSPIC macro: it must comply with the Adobe Document
88 Structuring Conventions; it must contain a BoundingBox line; it must
89 be ``well-behaved''.  The BoundingBox line should be of the form:
91   %%BoundingBox: llx lly urx ury
93 where llx, lly, urx, ury are the coordinates of the lower left x,
94 lower left y, upper right x, upper right y of the bounding box of
95 marks on the page expressed as integers in the default PostScript
96 coordinate system (72 units per inch, origin at bottom left corner).
97 A useful tactic is to print out the illustration by itself (you may
98 need to add a `showpage' at the end), and physically measure the
99 bounding box.  For more detail on these requirements, read the
100 specification of Encapsulated PostScript format.  (This is available
101 from the Adobe file server; send a message with a body of `help' to
102 ps-file-server@adobe.com.)
104 * I've configured groff for A4 paper, but gtroff still seems to think
105 that the length of a page (as returned by \n(.p) is 11 inches.
107 This is intentional.  The PAGE option is used only by grops.  For
108 compatibility with ditroff, the default page length in gtroff is
109 always 11 inches.  The page length can be changed with the `pl'
110 request.
112 * Groff doesn't use the font names I'm used to.
114 Use the `ftr' request.  See gtroff(1).
116 * I get errors using the Unix -ms macros with groff -e -C.
118 Apply this change:
120 *** /usr/lib/ms/ms.eqn  Tue Apr 25 02:14:28 1989
121 --- ms.eqn      Sun Nov 11 10:33:59 1990
122 ***************
123 *** 22,29 ****
124   ..
125   .     \" EN - end of a displayed equation
126   .de EN
127 ! .if !\a\\*(10\a\a .br
128   .di
129   .rm EZ
130   .nr ZN \\n(dn
131   .if \\n(ZN>0 .if \\n(YE=0 .LP
132 --- 22,30 ----
133   ..
134   .     \" EN - end of a displayed equation
135   .de EN
136 ! .if \\n(.k>0 .br
137   .di
138 + .ds 10 \\*(EZ\\
139   .rm EZ
140   .nr ZN \\n(dn
141   .if \\n(ZN>0 .if \\n(YE=0 .LP
144 * gpic doesn't accept the syntax `chop N M' for chopping both ends of a
145 line.
147 The correct syntax is `chop N chop M'.
149 * With gpic -t, when I print `line ->; box' using a dvi to ps
150 program, the arrow head sticks through into the inside of the box.
152 The dvi to ps program should be modified to set the line cap and
153 line join parameters to 1 while printing tpic specials.
155 * When I print the output groff -Tps, the output is always shifted up
156 by about 0.7 inches; I'm using 8.5x11 inch paper.
158 Make sure that PAGE is defined to be `letter' in the top-level
159 Makefile.
161 * When I try to print the output of groff -Tps, I get no output at all
162 from the printer, and the log file shows the error
163 %%[ error: undefined; offendingcommand: BP ]%%
164 I using TranScript spooling software.
166 This is a bug in the page reversal filter in early versions of
167 TranScript.  Change the `broken' parameter in
168 /usr/local/lib/groff/font/devps/DESC to 7.
170 * When I preview groff -Tps output using the Sun OpenWindows 2.0 pageview
171 program, all the pages are displayed on top of each other.
173 This is a defect in pageview.  Change the `broken' parameter in
174 /usr/local/lib/groff/font/devps/DESC to 2.
176 * With groff -TX75, -TX100or -X, I can only view the first page.
178 The left mouse button brings up a menu that allows you to view other
179 pages.
181 * When I print the output of groff -Tdvi, I just get a black dot in
182 upper left corner.
184 Some dvi drivers (notably early versions of xtex) do not correctly
185 handle dvi files that use a resolution different from that used by dvi
186 files produced by TeX.  Try getting a more up to date driver.
188 * I get lots of errors when I use groff with the AT&T -mm macros.
190 The AT&T -mm macros need a few changes to work with groff; `make
191 install.dwbmm' will copy your -mm macros to groff's macro directory
192 and make the necessary changes.  You may need to edit the commands for
193 the install.mm target in the Makefile.  Alternatively use the groff
194 -mm macros.
196 * gtroff doesn't understand lines like `.ce99' with no space between
197 the name of the request or macro and the arguments.
199 Gtroff requires a space between macro or request and its arguments
200 because it allows the use of long names for macros and requests.  You
201 can use the -C option or the `cp' request to put gtroff into a
202 compatibility mode in which it is not possible to use long names for
203 macros but in which no space is required between macros and their
204 arguments.  The use of compatibility mode is strongly discouraged.
206 * gtroff gives warnings about lines like
207   .ev   \" a comment
208 (with a tab after the .ev).
210 A tab character cannot be used as a substitute for a space character
211 (except in one case: between a control character at the beginning of a
212 line and the name of a macro or request).  For example, in Unix troff
213   .ps   \" restore the previous point size
214 (with a tab after the .ps) will NOT restore the previous point-size;
215 instead it will be silently ignored.  Since this is very likely to be
216 an error, gtroff can give a warning about it.  If you want to align
217 comments, you can do it like this:
218   .ev\"                         \" a comment
220 * I don't like the page headers and footers produced by groff -man.
222 There seem to be many different styles of page header and footer
223 produced by different versions of the -man macros.  You will need to
224 modify macros/tmac.an to suit your personal taste.  For example, if
225 you want the center of the page header to say
226   UNIX Programmer's Manual
227 you will need to change the line
228   .el .ds an-extra3 \"UNIX Programmer's Manual
230   .el .ds an-extra3 UNIX Programmer's Manual
232 * While formatting a manual page, groff complains about not being able to
233 break lines.  The problem seems to be caused by a line like:
234   .TP \w'label'+2
236 The -man documentation says that the default scale indicator for TP
237 macro is `n'.  The groff -man macros implement this correctly, so that
238 the argument will be evaluated as if it were
239   \w'label'n+2n
240 The Unix -man macros don't implement this correctly (probably because
241 it's hard to do in Unix troff); they just append `n' to the entire
242 argument, so that it will be evaluated as if it were
243   \w'label'u+2n
244 The solution is to fix the manual page:
245   .TP \w'label'u+2
247 * I'm having problems formatting Ultrix man pages with groff -man.
249 The Ultrix man pages use a number of non-standard extensions to the
250 Unix man macros.  One solution is to use the Ultrix -man macros with
251 groff.  Rename /usr/local/lib/groff/tmac/tmac.an to
252 /usr/local/lib/groff/tmac/tmac.an.gnu, copy /usr/lib/tmac/tmac.an to
253 /usr/local/lib/groff/tmac/tmac.an and apply the following patch (from
254 Frank Wortner):
256 *** /usr/local/lib/groff/tmac/tmac.an     Wed Sep  9 12:29:28 1992
257 --- /usr/lib/tmac/tmac.an       Fri Jul 24 19:58:19 1992
258 ***************
259 *** 489,495 ****
260   .     \" make special case of shift out of italic
261   .de }S
262   .ds ]F
263 ! .if \\$12 .if !\\$5 .ds ]F \^
264   .ie !\\$4 .}S \\$2 \\$1 "\\$3\f\\$1\\$4\\*(]F" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
265   .el \\$3
266   .}f
267 --- 489,495 ----
268   .     \" make special case of shift out of italic
269   .de }S
270   .ds ]F
271 ! .if \\$12 .if !\\$5 .ds ]F\^
272   .ie !\\$4 .}S \\$2 \\$1 "\\$3\f\\$1\\$4\\*(]F" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
273   .el \\$3
274   .}f
276 Another possible solution is to install tmac/man.ultrix as
277 /usr/local/lib/groff/tmac/man.local.
279 * When I preview documents using -TX75 or -TX100, the layout is not the same
280 as when I print the document with -Tps: the line and page breaks come
281 in different places.
283 Use groff -X -Tps.
285 * When I try to run gxditview, I get the error:
286 Error: Widget viewport has zero width and/or height
288 This error means you haven't correctly installed the application
289 defaults file, GXditview.ad; ``make install'' does this for you
290 automatically, so either you didn't do ``make install'', or you don't
291 have imake configured correctly.
293 * groff uses up an enormous amount of memory processing large files.
294 I'm using 386BSD 0.1.
296 386BSD includes an old version of g++, 1.39, which has a bug that
297 causes a major memory leak in gtroff.  Apply the following fix to g++
298 and recompile groff:
300 *** cplus-decl.c.~1~    Mon Aug  6 05:28:59 1990
301 --- cplus-decl.c        Wed Jun  5 08:55:04 1991
302 ***************
303 *** 7951,7961 ****
304   
305         /* At the end, call delete if that's what's requested.  */
306         if (TREE_GETS_DELETE (current_class_type))
307         exprstmt = build_method_call (build1 (NOP_EXPR, TYPE_POINTER_TO (current_class_type), error_mark_node),
308                                       get_identifier (OPERATOR_DELETE_FORMAT),
309 !                                     build_tree_list (NULL_TREE, integer_zero_node),
310                                       NULL_TREE, LOOKUP_NORMAL);
311         else if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
312         exprstmt = build_x_delete (ptr_type_node, current_class_decl, 0);
313         else
314         exprstmt = 0;
315 --- 7951,7961 ----
316   
317         /* At the end, call delete if that's what's requested.  */
318         if (TREE_GETS_DELETE (current_class_type))
319         exprstmt = build_method_call (build1 (NOP_EXPR, TYPE_POINTER_TO (current_class_type), error_mark_node),
320                                       get_identifier (OPERATOR_DELETE_FORMAT),
321 !                                     build_tree_list (NULL_TREE, current_class_decl),
322                                       NULL_TREE, LOOKUP_NORMAL);
323         else if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
324         exprstmt = build_x_delete (ptr_type_node, current_class_decl, 0);
325         else
326         exprstmt = 0;
328 * I'm having problems compiling groff on 386BSD 0.1.
330 If you're using ash as /bin/sh, you'll need the following patch.
332 *** gendef.sh.org       Sun Jun 30 13:30:36 1991
333 --- gendef.sh   Sun Feb 28 10:23:49 1993
334 ***************
335 *** 3,9 ****
336   file=$1
337   shift
338   
339 ! defs="#define $1"
340   shift
341   for def
342   do
343 --- 3,10 ----
344   file=$1
345   shift
346   
347 ! x=$1
348 ! defs="#define $x"
349   shift
350   for def
351   do
353 You'll also need to change dirnamemax.c so that it doesn't use
354 pathconf().