* Makefile.in (EXTRADIRS): Fix typos.
[s-roff.git] / PROBLEMS
blob36685b565336d83c7dbe0df638c85d7015127ac3
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 ----------------------------------------------------------------------
7 * My document says that the current year is 19100, not 2000.
9 In groff, as in traditional troff, the yr number register yields the
10 year minus 1900.  Unfortunately, there is a longstanding bug in the
11 Troff User's Manual <http://cm.bell-labs.com/cm/cs/cstr/54.ps.gz>,
12 which incorrectly claims that yr is the last two digits of the year.
13 This claim was never true of either Unix troff or of groff.
15 If your text looks like this:
17         .\" Wrong:
18         This document was formatted in 19\n(yr.
20 you can correct it as follows:
22         This document was formatted in \n[year].
24 or, if you want to be portable to older troff versions, as follows:
26         .nr y4 1900+\n(yr
27         This document was formatted in \n(y4.
29 ----------------------------------------------------------------------
31 * I get lots of `numeric overflow' error messages whenever I run
32   groff; I compiled groff with AT&T C++ 2.0 with an ANSI C compiler.
34 Make sure -DCFRONT_ANSI_BUG is included in DEFINES in the top-level
35 Makefile.  If that doesn't solve the problem, define INT_MIN as
36 -INT_MAX in libgroff/lib.h.
38 ----------------------------------------------------------------------
40 * I get errors when I try to compile groff with Sun C++ version 5.0
41   or 5.1.
43 This is a known problem; see Sun bug #4301919.  As of this writing, no
44 patch is available.  Use GCC 2.95.2 or later instead.
46 ----------------------------------------------------------------------
48 * I get errors when I try to compile groff with Sun C++ version 3 or
49   earlier.
51 Groff requires header files that are moderately compatible with AT&T
52 C++ and ANSI C.  With some versions of Sun C++, the supplied header
53 files need some of the following changes to meet this requirement:
54 <string.h> must declare the mem* functions, (just add `#include
55 <memory.h>' to <string.h>); the first argument to fopen and freopen
56 should be declared as `const char *'; the first argument to fread
57 should be declared as `void *'; the first argument to fwrite should be
58 declared as `const void *'; malloc should be declared to return
59 `void *'; in <alloca.h>, the declaration `extern "C" { void
60 *__builtin_alloca(int); }' should be added; in <sys/signal.h> the
61 return type and the second argument type of signal() should be changed
62 to be `void (*)(int)'.
64 You can either change them in place, or copy them to some other
65 directory and include that directory with a -I option.
67 ----------------------------------------------------------------------
69 * The configure script fails on OS/390 Unix.
71 There is a bug in the Language Environment (LE) whereby the test
72 program for static destructors fails.  You will see the message
73 'configure: error: a working C++ compiler is required'
75 Applying PTF UQ42006 is supposed to fix this, but the test program is
76 still returning the wrong value (1).  To work around this problem, you
77 can comment out the following in the configure script (near line 956).
78 This will effectively bypass the test (static constructors and
79 destructors do actually work properly):
81 #if { (eval echo configure:957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
82 #then
83   echo "$ac_t""yes" 1>&6
84 #else
85 #  echo "configure: failed program was:" >&5
86 #  cat conftest.$ac_ext >&5
87 #  rm -fr conftest*
88 #  echo "$ac_t""no" 1>&6;{ echo "configure: error: a working C++ compiler is required" 1>&2; exit 1; }
89 #fi
91 ----------------------------------------------------------------------
93 * I get errors when I try to compile groff with DEC C++.
95 Fix the declaration of write() in <unistd.h> so that the second
96 argument is a const char *.  Fix the declaration of open() in
97 <sys/file.h> so that the first argument is a const char *.
99 ----------------------------------------------------------------------
101 * On Ultrix, the make stops with the message
103   *** Error code 1
105   Stop.
107 for no apparent reason.
109 Use GNU make.
111 ----------------------------------------------------------------------
113 * I'm having problems compiling groff on 386BSD 0.1.
115 If you're using ash as /bin/sh, you'll need the following patch.
117 *** gendef.sh.org       Sun Jun 30 13:30:36 1991
118 --- gendef.sh   Sun Feb 28 10:23:49 1993
119 ***************
120 *** 3,9 ****
121   file=$1
122   shift
123   
124 ! defs="#define $1"
125   shift
126   for def
127   do
128 --- 3,10 ----
129   file=$1
130   shift
131   
132 ! x=$1
133 ! defs="#define $x"
134   shift
135   for def
136   do
138 You'll also need to change dirnamemax.c so that it doesn't use
139 pathconf().
141 ----------------------------------------------------------------------
143 * While compiling on Xenix, ranlib libgroff.a fails.
145 The system ranlib can't handle externals longer than 40 characters.
146 Use the ranlib included in demon.co.uk:/pub/xenix/g++-1.40.3a.v1
147 instead.
149 ----------------------------------------------------------------------
151 * Groff can't handle my troff document. It works fine with AT&T troff.
153 Read the section on incompatibilities in gtroff(1).  Try using the -C
154 option.  Alternatively there's the sed script in tmac/fixmacros.sed
155 which will attempt to edit a file of macros so that it can be used
156 with groff without the -C flag.
158 ----------------------------------------------------------------------
160 * groff -Tdvi produces dvi files that use fonts at weird
161   magnifications.
163 Yes, it does.  You may need to compile fonts with Metafont at these
164 magnifications.  The CompileFonts script in the devdvi/generate
165 directory may help you to do this.  (It will take a *long* time.)
167 ----------------------------------------------------------------------
169 * pic output is not centered horizontally; pictures sometimes run off
170   the bottom of the page.
172 The macro package you are using is not supplying appropriate
173 definitions of PS and PE.  Give groff a -mpic option.
175 ----------------------------------------------------------------------
177 * I'm having problems including PostScript illustrations using the
178   PSPIC macro.
180 A PostScript document must meet three requirements in order to be
181 included with the PSPIC macro: it must comply with the Adobe Document
182 Structuring Conventions; it must contain a BoundingBox line; it must
183 be ``well-behaved''.  The BoundingBox line should be of the form:
185   %%BoundingBox: llx lly urx ury
187 where llx, lly, urx, ury are the coordinates of the lower left x,
188 lower left y, upper right x, upper right y of the bounding box of
189 marks on the page expressed as integers in the default PostScript
190 coordinate system (72 units per inch, origin at bottom left corner).
191 A useful tactic is to print out the illustration by itself (you may
192 need to add a `showpage' at the end), and physically measure the
193 bounding box.  For more detail on these requirements, read the
194 specification of Encapsulated PostScript format.  (This is available
195 from the Adobe file server; send a message with a body of `help' to
196 ps-file-server@adobe.com.)
198 ----------------------------------------------------------------------
200 * I've configured groff for A4 paper, but gtroff still seems to think
201   that the length of a page (as returned by \n(.p) is 11 inches.
203 This is intentional.  The PAGE option is used only by grops.  For
204 compatibility with ditroff, the default page length in gtroff is
205 always 11 inches.  The page length can be changed with the `pl'
206 request.
208 ----------------------------------------------------------------------
210 * Groff doesn't use the font names I'm used to.
212 Use the `ftr' request.  See gtroff(1).
214 ----------------------------------------------------------------------
216 * I get errors using the Unix -ms macros with groff -e -C.
218 Apply this change:
220 *** /usr/lib/ms/ms.eqn  Tue Apr 25 02:14:28 1989
221 --- ms.eqn      Sun Nov 11 10:33:59 1990
222 ***************
223 *** 22,29 ****
224   ..
225   .     \" EN - end of a displayed equation
226   .de EN
227 ! .if !\a\\*(10\a\a .br
228   .di
229   .rm EZ
230   .nr ZN \\n(dn
231   .if \\n(ZN>0 .if \\n(YE=0 .LP
232 --- 22,30 ----
233   ..
234   .     \" EN - end of a displayed equation
235   .de EN
236 ! .if \\n(.k>0 .br
237   .di
238 + .ds 10 \\*(EZ\\
239   .rm EZ
240   .nr ZN \\n(dn
241   .if \\n(ZN>0 .if \\n(YE=0 .LP
243 ----------------------------------------------------------------------
245 * gpic doesn't accept the syntax `chop N M' for chopping both ends of
246   a line.
248 The correct syntax is `chop N chop M'.
250 ----------------------------------------------------------------------
252 * With gpic -t, when I print `line ->; box' using a dvi to ps program,
253   the arrow head sticks through into the inside of the box.
255 The dvi to ps program should be modified to set the line cap and line
256 join parameters to 1 while printing tpic specials.
258 ----------------------------------------------------------------------
260 * When I print the output groff -Tps, the output is always shifted up
261   by about 0.7 inches; I'm using 8.5x11 inch paper.
263 Make sure that PAGE is defined to be `letter' in the top-level
264 Makefile.
266 ----------------------------------------------------------------------
268 * When I try to print the output of groff -Tps, I get no output at all
269   from the printer, and the log file shows the error
270   %%[ error: undefined; offendingcommand: BP ]%%
271   I'm using TranScript spooling software.
273 This is a bug in the page reversal filter in early versions of
274 TranScript.  Change the `broken' parameter in
275 /usr/local/lib/groff/font/devps/DESC to 7.
277 ----------------------------------------------------------------------
279 * When I preview groff -Tps output using the Sun OpenWindows 2.0
280   pageview program, all the pages are displayed on top of each other.
282 This is a defect in pageview.  Change the `broken' parameter in
283 /usr/local/lib/groff/font/devps/DESC to 2.
285 ----------------------------------------------------------------------
287 * With groff -TX75, -TX100 or -X, I can only view the first page.
289 The left mouse button brings up a menu that allows you to view other
290 pages.
292 ----------------------------------------------------------------------
294 * When I print the output of groff -Tdvi, I just get a black dot in
295   upper left corner.
297 Some dvi drivers (notably early versions of xtex) do not correctly
298 handle dvi files that use a resolution different from that used by dvi
299 files produced by TeX.  Try getting a more up to date driver.
301 ----------------------------------------------------------------------
303 * I get lots of errors when I use groff with the AT&T -mm macros.
305 The AT&T -mm macros need a few changes to work with groff; `make
306 install.dwbmm' will copy your -mm macros to groff's macro directory
307 and make the necessary changes.  You may need to edit the commands for
308 the install.mm target in the Makefile.  Alternatively use the groff
309 -mm macros.
311 ----------------------------------------------------------------------
313 * gtroff doesn't understand lines like `.ce99' with no space between
314   the name of the request or macro and the arguments.
316 gtroff requires a space between macro or request and its arguments
317 because it allows the use of long names for macros and requests.  You
318 can use the -C option or the `cp' request to put gtroff into a
319 compatibility mode in which it is not possible to use long names for
320 macros but in which no space is required between macros and their
321 arguments.  The use of compatibility mode is strongly discouraged.
323 ----------------------------------------------------------------------
325 * gtroff gives warnings about lines like
326   .ev   \" a comment
327   (with a tab after the .ev).
329 A tab character cannot be used as a substitute for a space character
330 (except in one case: between a control character at the beginning of a
331 line and the name of a macro or request).  For example, in Unix troff
333   .ps   \" restore the previous point size
335 (with a tab after the .ps) will NOT restore the previous point-size;
336 instead it will be silently ignored.  Since this is very likely to be
337 an error, gtroff can give a warning about it.  If you want to align
338 comments, you can do it like this:
340   .ev\"                         \" a comment
342 ----------------------------------------------------------------------
344 * I don't like the page headers and footers produced by groff -man.
346 There seem to be many different styles of page header and footer
347 produced by different versions of the -man macros.  You will need to
348 modify macros/tmac.an to suit your personal taste.  For example, if
349 you want the center of the page header to say
351   System Programmer's Manual
353 you will need to change the line
355   .el .ds an-extra3 \"System Programmer's Manual
359   .el .ds an-extra3 System Programmer's Manual
361 ----------------------------------------------------------------------
363 * While formatting a manual page, groff complains about not being able
364   to break lines.  The problem seems to be caused by a line like:
365   .TP \w'label'+2
367 The -man documentation says that the default scale indicator for TP
368 macro is `n'.  The groff -man macros implement this correctly, so that
369 the argument will be evaluated as if it were
371   \w'label'n+2n
373 The Unix -man macros don't implement this correctly (probably because
374 it's hard to do in Unix troff); they just append `n' to the entire
375 argument, so that it will be evaluated as if it were
377   \w'label'u+2n
379 The solution is to fix the manual page:
381   .TP \w'label'u+2
383 ----------------------------------------------------------------------
385 * I'm having problems formatting Ultrix man pages with groff -man.
387 The Ultrix man pages use a number of non-standard extensions to the
388 Unix man macros.  One solution is to use the Ultrix -man macros with
389 groff.  Rename /usr/local/lib/groff/tmac/tmac.an to
390 /usr/local/lib/groff/tmac/tmac.an.gnu, copy /usr/lib/tmac/tmac.an to
391 /usr/local/lib/groff/tmac/tmac.an and apply the following patch (from
392 Frank Wortner):
394 *** /usr/local/lib/groff/tmac/tmac.an     Wed Sep  9 12:29:28 1992
395 --- /usr/lib/tmac/tmac.an       Fri Jul 24 19:58:19 1992
396 ***************
397 *** 489,495 ****
398   .     \" make special case of shift out of italic
399   .de }S
400   .ds ]F
401 ! .if \\$12 .if !\\$5 .ds ]F \^
402   .ie !\\$4 .}S \\$2 \\$1 "\\$3\f\\$1\\$4\\*(]F" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
403   .el \\$3
404   .}f
405 --- 489,495 ----
406   .     \" make special case of shift out of italic
407   .de }S
408   .ds ]F
409 ! .if \\$12 .if !\\$5 .ds ]F\^
410   .ie !\\$4 .}S \\$2 \\$1 "\\$3\f\\$1\\$4\\*(]F" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
411   .el \\$3
412   .}f
414 Another possible solution is to install tmac/man.ultrix as
415 /usr/local/lib/groff/tmac/man.local.
417 ----------------------------------------------------------------------
419 * I'm having problems formatting HP-UX 9.0 man pages with groff -man.
421 Rename /usr/local/lib/groff/tmac/tmac.an to (for example)
422 /usr/local/lib/groff/tmac/tmac.gan, copy HP's tmac.an into
423 /usr/local/lib/groff/tmac/tmac.an, and either put `.cp 1' at the
424 beginning or filter it (and any files it .so's) through
425 tmac/fixmacros.sed.
427 ----------------------------------------------------------------------
429 * I'm having problems formatting man pages produced by the perl
430   wrapman script.
432 Some versions of wrapman have a superfluous blank line before the .TH
433 line.  This must be deleted.  Then either use groff -C, or apply the
434 following patch:
436 *** wrapman.~2~ Sun Jan 19 12:10:24 1992
437 --- wrapman     Tue Aug 10 02:06:41 1993
438 ***************
439 *** 35,41 ****
440       $line1 .= <IN> if $line1 =~ /eval/;
441       $line1 .= <IN> if $line1 =~ /argv/;
442       $line2 = <IN>;
443 !     next if $line2 eq "'di';\n";
444   
445       # Pull the old switcheroo.
446   
447 --- 35,41 ----
448       $line1 .= <IN> if $line1 =~ /eval/;
449       $line1 .= <IN> if $line1 =~ /argv/;
450       $line2 = <IN>;
451 !     next if $line2 eq "'di ';\n" || $line2 eq "'di';\n";
452   
453       # Pull the old switcheroo.
454   
455 ***************
456 *** 49,56 ****
457   
458       print OUT $line1;
459       print OUT <<EOF;
460 ! 'di';
461 ! 'ig00';
462   #
463   # $header
464   #
465 --- 49,58 ----
466   
467       print OUT $line1;
468       print OUT <<EOF;
469 ! 'di ';
470 ! 'ds 00 \\"';
471 ! 'eo ';
472 ! 'ig 00 ';
473   #
474   # $header
475   #
476 ***************
477 *** 72,85 ****
478   
479       # These next few lines are legal in both Perl and nroff.
480   
481 ! $null.00;                       # finish .ig
482    
483   'di           \\" finish diversion--previous line must be blank
484   .nr nl 0-1    \\" fake up transition to first page again
485   .nr % 0         \\" start at page 1
486 ! '; __END__ ##### From here on it's a standard manual page #####
487   .TH $PROG 1 "$month $mday, 19$year"
488 - .AT 3
489   .SH NAME
490   $prog \\- whatever
491   .SH SYNOPSIS
492 --- 74,87 ----
493   
494       # These next few lines are legal in both Perl and nroff.
495   
496 ! $null.00 ;                      # finish .ig
497 ! 'ec \\';
498    
499   'di           \\" finish diversion--previous line must be blank
500   .nr nl 0-1    \\" fake up transition to first page again
501   .nr % 0         \\" start at page 1
502 ! .\\"'; __END__ ##### From here on it's a standard manual page #####
503   .TH $PROG 1 "$month $mday, 19$year"
504   .SH NAME
505   $prog \\- whatever
506   .SH SYNOPSIS
509 ----------------------------------------------------------------------
511 * When I preview documents using -TX75 or -TX100, the layout is not
512   the same as when I print the document with -Tps: the line and page
513   breaks come in different places.
515 Use groff -X -Tps.
517 ----------------------------------------------------------------------
519 * When I try to run gxditview, I get the error:
520   Error: Widget viewport has zero width and/or height
522 This error means you haven't correctly installed the application
523 defaults file, GXditview.ad; ``make install'' does this for you
524 automatically, so either you didn't do ``make install'', or you don't
525 have imake configured correctly.
527 ----------------------------------------------------------------------
529 * groff uses up an enormous amount of memory processing large files.
530   I'm using 386BSD 0.1.
532 386BSD includes an old version of g++, 1.39, which has a bug that
533 causes a major memory leak in gtroff.  Apply the following fix to g++
534 and recompile groff:
536 *** cplus-decl.c.~1~    Mon Aug  6 05:28:59 1990
537 --- cplus-decl.c        Wed Jun  5 08:55:04 1991
538 ***************
539 *** 7951,7961 ****
540   
541         /* At the end, call delete if that's what's requested.  */
542         if (TREE_GETS_DELETE (current_class_type))
543         exprstmt = build_method_call (build1 (NOP_EXPR, TYPE_POINTER_TO (current_class_type), error_mark_node),
544                                       get_identifier (OPERATOR_DELETE_FORMAT),
545 !                                     build_tree_list (NULL_TREE, integer_zero_node),
546                                       NULL_TREE, LOOKUP_NORMAL);
547         else if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
548         exprstmt = build_x_delete (ptr_type_node, current_class_decl, 0);
549         else
550         exprstmt = 0;
551 --- 7951,7961 ----
552   
553         /* At the end, call delete if that's what's requested.  */
554         if (TREE_GETS_DELETE (current_class_type))
555         exprstmt = build_method_call (build1 (NOP_EXPR, TYPE_POINTER_TO (current_class_type), error_mark_node),
556                                       get_identifier (OPERATOR_DELETE_FORMAT),
557 !                                     build_tree_list (NULL_TREE, current_class_decl),
558                                       NULL_TREE, LOOKUP_NORMAL);
559         else if (TYPE_USES_VIRTUAL_BASECLASSES (current_class_type))
560         exprstmt = build_x_delete (ptr_type_node, current_class_decl, 0);
561         else
562         exprstmt = 0;
564 ----------------------------------------------------------------------
566 * Where can I get grap?
568 Ted Faber <faber@lunabase.org> has written a freely available grap:
570   http://www.lunabase.org/~faber/Vault/software/grap/
572 ----------------------------------------------------------------------
574 * How can I use groff with an old LaserJet printer that doesn't work
575   with groff -Tlj4?
577 You have at least 3 options:
579 - use groff -Tps with GNU Ghostscript;
581 - use groff -Tdvi with a TeX .dvi to Laserjet driver;
583 - use groff with the LaserJet driver in Chris Lewis' psroff package
584   (available for ftp from:
585   ftp.uunet.ca:/distrib/chris_lewis/psroff3.0pl17).
587 ----------------------------------------------------------------------
589 * Groff seems to generate level 3 Postscript, but my printer is only a
590   level 1 or 2 PostScript printer.
592 In fact groff generates only level 1 PostScript.  The `%!PS-Adobe-3.0'
593 comment at the beginning of PostScript output generated by groff
594 indicates that the file conforms to version 3.0 of the Adobe Document
595 Structuring Conventions.  The output generated by groff should be
596 printable on any PostScript printer.  Problems with groff output's not
597 printing are most often caused by the spooling system.
599 ----------------------------------------------------------------------
601 * The \n(st and \n(sb registers don't seem to work.  I thought \w set
602   them to the height and depth of its argument, but the registers
603   always seem to be 0.
605 \n(st and \n(sb aren't supposed to give the height and depth of the
606 string rather they give the minimum and maximum vertical displacement
607 of the baseline.  For example for \v'2u'\v'-3u', \n(st will be 1 and
608 \n(sb will be -2.  The height and depth of the string is available in
609 the \n[rst] and \n[rsb] registers: these are groff extensions.
611 ----------------------------------------------------------------------
613 * On an SGI system, how can I make the man command use groff?
615 From David Hinds <dhinds@allegro.stanford.edu> (some of these steps
616 are unnecessary if you install with the `g' Makefile variable defined
617 as empty):
619 Create a script called 'eqn':
621  > #!/bin/sh
622  > if [ ${1:-""} = /usr/pub/eqnchar ] ; then shift ; fi
623  > geqn $*
625 and a script called 'neqn':
627  > #!/bin/sh
628  > if [ ${1:-""} = /usr/pub/eqnchar ] ; then shift ; fi
629  > geqn -Tascii $*
631 and do:
633  > ln -s gnroff nroff
635 and edit the end of the gnroff script to be:
637  > rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
638  > exec groff -Wall -mtty-char $T $opts $rest
640 To get PostScript output from 'man -t', you also need to create a
641 'psroff' script similar to 'nroff'.  Here are the context diffs:
643 *** /usr/local/bin/nroff        Sat Feb 13 15:51:09 1993
644 --- /usr/local/bin/psroff       Sat Feb 13 17:45:46 1993
645 ***************
646 *** 1,8 ****
647   #!/bin/sh
648 ! # Emulate nroff with groff.
650   prog="$0"
651 ! T=-Tascii
652   opts=
654   for i
655 --- 1,8 ----
656   #!/bin/sh
657 ! # Emulate psroff with groff.
659   prog="$0"
660 ! T=-Tps
661   opts=
663   for i
664 ***************
665 *** 25,30 ****
666 --- 25,33 ----
667         -Tascii|-Tlatin1)
668                 T=$1
669                 ;;
670 +       -t)
671 +               # ignore -- default is send to stdout
672 +               ;;
673         -T*)
674                 # ignore other devices
675                 ;;
676 ***************
677 *** 49,53 ****
678   rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
680   # This shell script is intended for use with man, so warnings are
681   # probably not wanted.  Also load nroff-style character definitions.
682 ! exec groff -Wall -mtty-char $T $opts $rest
683 --- 52,56 ----
684   rest=`echo ${1+"$@"} | sed -e 's+/usr/lib/tmac+/usr/local/lib/groff/tmac+'`
686   # This shell script is intended for use with man, so warnings are
687 ! # probably not wanted.
688 ! exec groff -Wall $T $opts $rest