1 % \iffalse meta-comment
3 % Copyright 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009
4 % The LaTeX3 Project and any individual authors listed elsewhere
7 % This file is part of the LaTeX base system.
8 % -------------------------------------------
10 % It may be distributed and/or modified under the
11 % conditions of the LaTeX Project Public License, either version 1.3c
12 % of this license or (at your option) any later version.
13 % The latest version of this license is in
14 % http://www.latex-project.org/lppl.txt
15 % and version 1.3c or later is part of all distributions of LaTeX
16 % version 2005/12/01 or later.
18 % This file has the LPPL maintenance status "maintained".
20 % The list of all files belonging to the LaTeX base distribution is
21 % given in the file `manifest.txt'. See also `legal.txt' for additional
24 % The list of derived (unpacked) files belonging to the distribution
25 % and covered by LPPL is defined by the unpacking scripts (with
26 % extension .ins) which are part of the distribution.
29 %%% ====================================================================
31 %%% author = "David Carlisle",
32 %%% version = "$Revision: 5652 $",
33 %%% date = "$Date: 2005-12-08 00:11:59 +0100 (Thu, 08 Dec 2005) $",
34 %%% filename = "latexbug.tex",
35 %%% email = "latex-bugs@latex-project.org",
36 %%% codetable = "ISO/ASCII",
37 %%% keywords = "LaTeX, bugs, reporting",
38 %%% supported = "yes",
41 %%% LaTeX bug report generator.
42 %%% %%%%%%%%%%%%%%%%%%%%%%%%%%
44 %%% Processing this file with LaTeX should produce
45 %%% a file latexbug.msg in the current directory.
47 %%% latexbug.msg may be used as a template for submitting bug
48 %%% reports concerning files in the standard LaTeX distribution.
50 %%% * Any bug report should include a small LaTeX test file
51 %%% that shows the bug, and the log that LaTeX produces on the
54 %%% * Reports should be in English.
56 %%% * Reports should be as short as possible.
58 %%% Please check before submitting a bug report that your format
59 %%% is not more than two years old. New LaTeX releases occur at
60 %%% regular intervals, and so your bug may be fixed in a later
63 %%% Completed bug report forms should be submitted to:
64 %%% latex-bugs@latex-project.org
67 %%% use the synopsis text as the `Subject' line of the message.
68 %%% ===========================================================
71 %%% Subject: \verb does not work inside \caption
73 %%% So that your message has an identifying subject.
74 %%% Do not use subject lines such as `LaTeX bug' as this does not
75 %%% help us to identify your message.
77 %%% To follow up an existing report, include the bug reference, e.g.
78 %%% "latex/1234: ", preceding the subject text.
80 %%% Configuring latexbug
81 %%% ====================
82 %%% If you often test early release of LaTeX packages, and feel that
83 %%% you may need to use this program often, you may create a file
85 %%% This should contain the answers of certain standard questions.
86 %%% (Such as your name and email address.)
88 %%% Currently the responses that may be stored in latexbug.cfg are:
89 %%% name address organisation and interactive.
90 %%% (If organisation is not set in the .cfg file latexbug does not
91 %%% prompt for it, as this is not vital information.)
93 %%% For example, a personal latexbug.cfg could look like
95 %%% \def\name{My Real Name}
96 %%% \def\address{name@some.place}
97 %%% \def\organisation{My Institution}
98 %%% \def\interactive{y}
100 %%% A site latexbug.cfg might just set the \organisation, leaving
101 %%% the personal details to be filled in interactively by the user.
104 %%% ====================================================================
106 % Test if we are using INITEX (or a strange format that does not
107 % have { as a `group open' character).
110 \catcode`\
{=
1 \let\bgroup{
111 \catcode`\
}=
2 \let\egroup}
121 \def\fmtversion{9999/
00/
00}
122 \def\@secondoftwo
#1#2{#2}
124 \everyjob{\typeout{INITEX
}}
126 \def\@spaces
{\space\space\space\space}
130 % hide outer macro names as we are inside an if
131 \expandafter\let\csname repeat
\expandafter\endcsname
135 \immediate\openout\msg=
\jobname.msg
137 \expandafter\edef\csname newif
\endcsname#1#2{%
138 \let\noexpand\ifinteractive
139 \expandafter\noexpand\csname iffalse
\endcsname}
141 \expandafter\def\csname newcount
\endcsname#1{}
143 \def\dospecials{\catcode`\\=
12 }
145 \def\typeout{\immediate\write17}
147 \def\two@digits
#1{\ifnum#1<
10 0\fi\number#1}
149 \def\wmsg#1#
{\bgroup\@wmsg
}
151 \def\@ifundefined
#1#2#3%
152 {\expandafter\ifx\csname#1\endcsname\relax#2\else#3\fi}
154 \def\@inputfiles
{INITEX
}
162 %% Grab the initex file list
164 %% If this file is called via
165 %% latex "\input{latexbug}" or some
166 %% similar command sequence rather than
168 %% then the debugging info in \reserved@a will already have been lost.
169 %% This might not matter, but if it does we may ask the user to resubmit
171 \ifx\reserved@b\@undefined
172 \ifx\reserved@a\@gobble
173 \def\@inputfiles
{NONE
}
175 \let\@inputfiles
\reserved@a
178 \def\@inputfiles
{LOST
}
182 %% Output stream to produce the bug report template.
185 \immediate\openout\msg=
\jobname.msg
189 %% Check that LaTeX2e is being used.
191 \ifx\undefined\newcommand
193 \immediate\write17{^^J
%
194 You must use LaTeX2e to generate the bug
report!^^J^^J
%
195 If there is a bug in the installation procedure,^^J
%
196 and you can not create LaTeX2e, you may use initex^^J
%
197 to generate the
report}%
201 \def\@tempa
{LaTeX2e
}\ifx\@tempa
\fmtname\else
202 \immediate\write17{^^J
%
203 Older Versions of LaTeX are no longer supported.^^J
%
204 You must use LaTeX2e to generate the bug
report!^^J^^J
%
205 If there is a bug in the installation procedure,^^J
%
206 and you can not create LaTeX2e, you may use initex^^J
%
207 to generate the
report}%
212 %% \wmsg writes to the terminal, and the .msg file
213 %% \wmsg* just writes to the .msg file
214 %% \typeout just writes to the terminal
217 \def\wmsg{\bgroup\@ifstar
{\interactivefalse\@wmsg
}\@wmsg
}
225 \ifinteractive\immediate\write17{#1}\fi
226 \immediate\write\msg{#1}%
230 %% if \interactivefalse just make a blank template.
236 %% Prompt for an answer from the user, if the answer is not
237 %% provided by the cfg file.
240 \def\readifnotknown#1{%
243 \catcode`\^^I=
12 \let\do\@makeother
\dospecials
244 \global\read\m@ne t
\expandafter o
\csname#1\endcsname}}%
245 {\message{\csname#1\endcsname}}}
248 %% Pause so messages do not scroll off screen.
252 \message{Press <return> key to continue.
}%
253 \read\m@ne to \@tempa
260 ============================================================^^J
%
262 LaTeX bug
report generator^^J
%
263 ==========================^^J
%
264 Processing this file with LaTeX will produce a template
\jobname.msg^^J
265 for submitting bug reports for the LaTeX distribution.^^J^^J
266 * Please do not
report bugs in contributed, non-standard, files to the
267 ^^J
\space latex-bugs address.^^J
268 * Please write your
report in English.^^J
269 * Please keep the
report as short as possible.^^J
%
270 * If possible, check whether the bug has already been reported.^^J
%
271 \space The bugs database is available on WWW:^^J
\space
272 http://www.latex-project.org/bugs.html^^J
}
276 \InputIfFileExists{latexbug.cfg
}{\typeout{** latexbug.cfg used **
}}{}
279 %% \batch is a `private' macro used to get a batchmode
280 %% (actually \nonstopmode) run for use with latexbug.el
288 * Please carefully select the category as different categories^^J
289 \space\space are supported by different people!^^J^^J
%
291 The `base' format, and standard classes only (base).^^J
293 Packages supported by the LaTeX3 project team (tools).^^J
295 The
color and graphics packages (graphics).^^J
296 3) mfnfss:
\space\space
297 --- Don't use, no longer supported! ---^^J
298 4) psnfss:
\space\space
299 Packages for using PostScript fonts LaTeX (psnfss).^^J
301 AMS supported Classes and Packages (amsfonts and amslatex).^^J
303 Packages supporting many different languages (babel).^^J
%
305 Experimental packages for TeX programmers. (expl3)^^J
%
306 8) cyrillic: Packages for using Cyrillic fonts (cyrillic).^^J
}
308 \message{Please select a category
0--
8:
}
309 \read\m@ne to
\answer
310 \if!
\answer!
\let\answer\m@ne
\fi
311 \count@=
\answer\relax
313 \typeout{As you are using INITEX, I will assume category `latex'
}
317 \def\category{latex
}\or
318 \def\category{tools
}\or
319 \def\category{graphics
}\or
320 \errhelp{Retry with <return>, or quit with x.
}
321 \def\badcategory{This category is no longer supported
}
322 \errmessage{\badcategory}
323 \expandafter\getcategory
325 \def\category{psnfss
}\or
326 \def\category{amslatex
}\or
327 \def\category{babel
}\or
328 \def\category{expl3
}\or
329 \def\category{cyrillic
}%
331 \errhelp{Retry with <return>, or quit with x.
}
332 \def\badcategory{Only categories
0,...,
8 are supported at this time
}
333 \errmessage{\badcategory}
334 \expandafter\getcategory
340 ============================================================^^J
%
342 Please give a one line ( <
50 character ) description of the problem.
%
344 If you are using email to
report the problem,^^J
%
345 please also use this text as the `Subject' line for the mail message:
%
346 ^^J \@spaces\@spaces
\space
347 |<------------------------------------------------>|
}
352 \readifnotknown{synopsis
}
360 This
report generator may be used in one of two ways.^^J
%
361 If you choose the interactive option, you will be prompted to answer^^J
%
362 several questions. Otherwise a blank template will be created for^^J
%
363 you to fill in using your editor.^^J
%
365 INITEX should only be used for reporting bugs with the LaTeX2e^^J
%
366 installation procedure. If you have a working copy of LaTeX2e,^^J
%
367 please use that to generate the
report.
371 \typeout{Interactive session (y/n) ?
}
372 \readifnotknown{interactive
}
374 \ifx\interactive\@empty
379 %% Allow anything begining with `y' or `Y' for yes.
381 \edef\interactive{\uccode`
\expandafter\@car
\interactive\@nil
}
382 \ifnum \interactive=`Y
\else\interactivefalse\fi
384 \def\interactive{`
\N}
388 \def\category{< CATEGORY >
}
389 \def\synopsis{< SYNOPSIS >
}
392 \def\interactive{`
\N}
396 %% Header in the msg file.
399 LaTeX2e bug
report.^^J
%
400 \ifnum \interactive=`Y Generated
\else Template generated
\fi
401 by latexbug.tex on
\number\year/
\two@digits
\month/
\two@digits
\day^^J
%
403 Reports may be submitted by email to latex-bugs@latex-project.org^^J
%
404 Please use the subject line:^^J
%
405 Subject:
\synopsis^^J
%
407 To follow up an existing
report, include the bug reference, e.g.^^J
408 "latex/
1234: ", preceding the subject text.^^J
409 ============================================================^^J
}
414 %% Category of bug, obtained earlier but put out now, after the header.
416 \wmsg{>Category:
\category}
419 %% synopsis of bug, obtained earlier but put out now, after the header.
421 \wmsg{>Synopsis:
\synopsis}
425 %% >Confidential: Default to no unless this is overridden
426 %% in latexbug.cfg. If you want to send a one-off confidential
427 %% report, just edit the latexbug.msg file to say yes.
429 \wmsg{>Confidential:
\ifx\confidential\undefined
436 %% Try to catch various formats that babel has used to add to the banner
437 %% over the years. Currently it uses \typeout, so put the first \typeout
438 %% in \format and the second in \hyphenation. Earlier releases used
441 \global\let\format\@empty
442 \gdef\hyphenation{standard
}
443 \def\immediate#1#
{\xdef\hyphenation}
445 \xdef\format{\format#1}\def\typeout#
#1{\xdef\hyphenation{#
#1}}}
449 \wmsg{>Release:
\format}
453 %% if interactive, \wread reads a line (verbatim) and writes it to the
454 %% .msg file, until two consecutive blank lines are entered.
459 \let\do\@makeother
\dospecials
463 \let\lastanswer\answer
464 \message{=>
}\read\m@ne to
\answer
465 \ifx\lastanswer\@empty
466 \let\lastanswer\answer
468 \ifx\lastanswer\@empty
471 \immediate\write\msg{\answer}%
472 \expandafter\wreadloop
476 %% If non-interactive, \wread just writes a blank line to the .msg file,
477 %% and \wmsg does not write to the terminal.
483 %% \copytomsg copies the contents of a file into the .msg file.
484 %% (at least it does it as well as TeX can, so there may be
485 %% transcription problems with 8-bit characters).
487 %% It does a line count, and complains if the test file is
490 \chardef\inputfile=
15
495 \def\do#
#1{\catcode`#
#1=
11}%
498 \openin\inputfile#1\relax
505 \typeout{***
\thefile\space line count =
\the\linecount}
507 \global\advance\linecount\@ne
508 \read\inputfile to
\inputline
509 \ifx\inputline\@empty
514 \expandafter\@copytomsg
519 %% Test the age of the current format.
521 \def\getage#1/
#2/
#3\@nil
{%
523 \advance\count@-
#1\relax
524 \multiply\count@ by
12\relax
525 \advance\count@
\month
526 \advance\count@-
#2\relax}
528 \expandafter\getage\fmtversion\@nil
530 %% \count@ should now be the age of the format in months.
532 %% Take a generous definition of `year'.
535 ! Your LaTeX installation is more than five years old.^^J
%
536 ! Please consider updating LaTeX before submitting this
report.^^J
%
537 ! At least check a current LaTeX changes.txt file, to see if the^^J
%
538 ! bug has been fixed in the current release.^^J
%
541 %% Put the message in a macro to improve the look of the error mesage.
544 \errhelp{If you still wish to complete the form, just type return.
}
545 \errmessage{\oldformat}
549 %% Test fonts not customised too much. (unless using initex)
553 \encodingdefault/
\familydefault/
\seriesdefault/
\shapedefault}
554 \def\standardfontdefaults{OT1/cmr/m/n
}
555 \ifx\fontdefaults\standardfontdefaults\else
556 \wmsg*
{>Unformatted:
}
557 \wmsg{Normal font:
\fontdefaults}
558 \def\customisedfonts{^^J
%
559 ! This format has customised font defaults.^^J
%
560 ! Please try to re-create the error using a standard format^^J
%
561 ! before submitting this
report}
562 \errhelp{If you still wish to complete the form, just type return.
}
563 \errmessage{\customisedfonts}
568 %% Now use \wmsg and \wread for each of the multi-line fields
570 %% One line fields use \readifnotknown, which will only prompt
571 %% if the field has not already been set in the configuration file.
574 \typeout{^^JYour name:
}
575 \readifnotknown{name
}
578 \def\name{ < ENTER YOUR NAME >
}
584 \typeout{^^JYour Address (preferably email):
}
585 \readifnotknown{address
}
587 \ifx\address\undefined
588 \def\address{ < ENTER YOUR EMAIL ADDRESS >
}
592 \wmsg*
{>Originator:
\address \space(
\name)
}
595 %% >Organisation: is really a GNATS multiline field
596 %% but we treat it as a one-line field.
598 \wmsg*
{>Organization:
\ifx\organisation\undefined
599 \ifx\organization\undefined\else
608 %% Test which format is being used. These fields are completed
609 %% automatically even if the blank template is being produced.
612 \wmsg*
{>Environment:
}
613 \wmsg*
{ Hyphenation:
\hyphenation}
614 \wmsg*
{ \string\@TeXversion:
\meaning\@TeXversion
615 \ifx\@TeXversion\@@undefined
616 \space (Standard setting for TeX3.141 and later)
\fi}
617 \wmsg*
{ \string\@currdir:
\meaning\@currdir
}
618 \wmsg*
{ \string\input@path:
\meaning\input@path
619 \ifx\input@path\@@undefined
620 \space (Standard setting)
\fi}
622 \wmsg*
{>Unformatted:
}
623 \wmsg*
{ *** Initex configuration files
}
625 %% These are in a comma separated list, so locally reset
628 \wmsg*
{\@inputfiles
}}
631 \wmsg*
{>Description:
}
633 \wmsg{Description of bug:
}
636 \@spaces The answer to this question may take several lines.^^J
%
637 \@spaces (Each such line will be prompted by =>.)^^J
%
638 \@spaces Typing TWO consecutive blank lines terminates the answer.
}
640 \wmsg{ < ENTER BUG REPORT HERE >
}
647 %% insertion of the test file
654 Name of a SHORT, SELF-CONTAINED file which indicates the problem:^^J
%
655 This file should be as small as possible (preferably <
60 lines)^^J
%
656 Any non-standard files that the test file uses should be included^^J
%
657 using the filecontents environment.^^J^^J
%
659 LaTeX will try to input this file, so give the full path^^J
%
660 if the file is not in the current directory.^^J^^J
%
662 If you are not reporting a bug, and there is therefore^^J
%
663 no test file, just hit <return>
}
664 \message{filename>
}\read\m@ne to
\filename
670 %% Try to find the .tex file and .log file
675 \ifx\LaTeX\undefinedcommand
678 \typeout{^^J^^JNo test file.^^J^^J
%
679 Three classes of
report are supported:^^J^^J
%
680 0) sw-bug:^^J\@spaces
681 Bug in the software, the
report should include a test file.^^J
682 1) doc-bug:^^J\@spaces
683 Inaccuracies in the documentation.^^J
684 2) change-request:^^J\@spaces
685 Not a bug, but rather a request for LaTeX to be changed.^^J
}
686 \message{Please select a category
0--
2:
}
687 \read\m@ne to
\answer
691 \count@=
\answer\relax
696 \ifinteractive\wmsg{>Class: sw-bug
}\fi
697 \typeout{^^J! Please edit the message to add a test file and log!
}
699 \wmsg*
{^^J>How-To-Repeat:
}
701 Sample file which indicates the problem:^^J
%
702 ========================================^^J
%
703 \space< TEST FILE HERE >^^J
%
705 The log file from running LaTeX on the sample:^^J
%
706 ==============================================^^J
%
707 \space< LOG FROM TEST FILE HERE >
}
709 \wmsg{>Class: doc-bug
}
711 \wmsg{>Class: change-request
}
713 \errhelp{Quit with `x' and then re-start latexbug
}
714 \def\badcategory{Only classes
0,
1,
2 are supported at this time
}
715 \errmessage{\badcategory}
720 \filename@parse
\filename
722 \IfFileExists{\filename}{\edef\samplefile{\filename}}{}
724 \IfFileExists{\filename@area
\filename@base.log
}
725 {\edef\logfile{\filename@area
\filename@base.log
}}
726 {\IfFileExists{\filename@area
\filename@base.lis
}
727 {\edef\logfile{\filename@area
\filename@base.lis
}}
732 %% The example file goes here:
734 \wmsg*
{^^J>How-To-Repeat:
}
737 Sample file which indicates the problem:^^J
%
738 ========================================
}
740 \ifx\samplefile\undefinedcommand
742 Sample file
\filename\space not found.^^J
%
743 Please edit
\jobname.msg to include the sample file.
}
744 \wmsg*
{ < TEST FILE HERE >
}
747 \copytomsg{\samplefile}
751 !!! Your test file is
\the\linecount\space lines long.^^J
%
752 !!! Such a large test file causes us problems:^^J
%
753 !!! * It makes it difficult to track down the error^^J
%
754 !!! * It makes our database for storing reports unnecessarily large.^^J
%
756 !!! Please, if at all possible, cut down your test file to the^^J
%
757 !!! smallest file that shows the behaviour.^^J
}
764 %% The log file goes here:
767 The log file from running LaTeX on the sample:^^J
%
768 ==============================================
}
770 \ifx\logfile\undefinedcommand
772 Log file
\filename@area
\filename@base.log not found.^^J
%
773 Please edit
\jobname.msg to include the log file.
}
774 \wmsg*
{ < < LOG FROM TEST FILE HERE >
}
787 ============================================================
}
791 You may wish to make further changes to the bug
report file:^^J
%
796 A template for submitting bug reports has been left in the file:^^J
%
798 Please use your editor to complete the file before submitting^^J
%
802 \let\ifinteractivetrue\iftrue
804 If you have access to email, please send `
\jobname.msg' to:^^J
%
805 latex-bugs@latex-project.org Please use the subject line:^^J
%
806 \@spaces Subject:
\synopsis^^J
%
808 (This subject will be used in all subsequent correspondence.)^^J
%
810 To follow up an existing
report, include the bug reference, e.g.^^J
%
811 "latex/
1234: ", preceding the subject text.^^J
%
813 Your message will be entered into a publicly readable database^^J
%
814 Accessable via the www (see bugs.txt for details).^^J
%
815 If do not wish this message made public, Edit the^^J
%
816 >Confidential: no^^J
%
817 field to yes before submitting this message.^^J
%
819 Thank you for taking the time to submit a bug
report.
}
822 ============================================================^^J
824 End of LaTeX2e bug
report.^^J
%
825 ============================================================
}
828 %% Close the .msg output stream.
830 \immediate\closeout\msg
833 %% This is the TeX primitive \end command.