1 % \iffalse meta-comment
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: 2017-01-27$",
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
257 %% New don't use this banner
260 ============================================================^^J
%
263 ** OLD LaTeX bug
report generator^^J
%
264 ** ==============================^^J
%
265 ** This LaTeX bug
report generator is no longer the^^J
%
266 ** recommended mechanism for generating test reports.^^J
%
267 ** Please make a test file using the latexbug package^^J
%
268 ** and submit using the form at^^J
%
269 ** https://www.latex-project.org/bugs/bugs-upload/^^J
%
278 ============================================================^^J
%
280 LaTeX bug
report generator^^J
%
281 ==========================^^J
%
282 Processing this file with LaTeX will produce a template
\jobname.msg^^J
283 for submitting bug reports for the LaTeX distribution.^^J^^J
284 * Please do not
report bugs in contributed, non-standard, files to the
285 ^^J
\space latex-bugs address.^^J
286 * Please write your
report in English.^^J
287 * Please keep the
report as short as possible.^^J
%
288 * If possible, check whether the bug has already been reported.^^J
%
289 \space The bugs database is available on WWW:^^J
\space
290 http://www.latex-project.org/bugs.html^^J
}
294 \InputIfFileExists{latexbug.cfg
}{\typeout{** latexbug.cfg used **
}}{}
297 %% \batch is a `private' macro used to get a batchmode
298 %% (actually \nonstopmode) run for use with latexbug.el
306 * Please carefully select the category as different categories^^J
307 \space\space are supported by different people!^^J^^J
%
309 The `base' format, and standard classes only (base).^^J
311 Packages supported by the LaTeX3 project team (tools).^^J
313 The
color and graphics packages (graphics).^^J
314 3) mfnfss:
\space\space
315 --- Don't use, no longer supported! ---^^J
316 4) psnfss:
\space\space
317 Packages for using PostScript fonts LaTeX (psnfss).^^J
319 AMS supported Classes and Packages (amsfonts and amslatex).^^J
321 Packages supporting many different languages (babel).^^J
%
323 Experimental packages for TeX programmers. (expl3)^^J
%
324 8) cyrillic: Packages for using Cyrillic fonts (cyrillic).^^J
}
326 \message{Please select a category
0--
8:
}
327 \read\m@ne to
\answer
328 \if!
\answer!
\let\answer\m@ne
\fi
329 \count@=
\answer\relax
331 \typeout{As you are using INITEX, I will assume category `latex'
}
335 \def\category{latex
}\or
336 \def\category{tools
}\or
337 \def\category{graphics
}\or
338 \errhelp{Retry with <return>, or quit with x.
}
339 \def\badcategory{This category is no longer supported
}
340 \errmessage{\badcategory}
341 \expandafter\getcategory
343 \def\category{psnfss
}\or
344 \def\category{amslatex
}\or
345 \def\category{babel
}\or
346 \def\category{expl3
}\or
347 \def\category{cyrillic
}%
349 \errhelp{Retry with <return>, or quit with x.
}
350 \def\badcategory{Only categories
0,...,
8 are supported at this time
}
351 \errmessage{\badcategory}
352 \expandafter\getcategory
358 ============================================================^^J
%
360 Please give a one line ( <
50 character ) description of the problem.
%
362 If you are using email to
report the problem,^^J
%
363 please also use this text as the `Subject' line for the mail message:
%
364 ^^J \@spaces\@spaces
\space
365 |<------------------------------------------------>|
}
370 \readifnotknown{synopsis
}
378 This
report generator may be used in one of two ways.^^J
%
379 If you choose the interactive option, you will be prompted to answer^^J
%
380 several questions. Otherwise a blank template will be created for^^J
%
381 you to fill in using your editor.^^J
%
383 INITEX should only be used for reporting bugs with the LaTeX2e^^J
%
384 installation procedure. If you have a working copy of LaTeX2e,^^J
%
385 please use that to generate the
report.
389 \typeout{Interactive session (y/n) ?
}
390 \readifnotknown{interactive
}
392 \ifx\interactive\@empty
397 %% Allow anything begining with `y' or `Y' for yes.
399 \edef\interactive{\uccode`
\expandafter\@car
\interactive\@nil
}
400 \ifnum \interactive=`Y
\else\interactivefalse\fi
402 \def\interactive{`
\N}
406 \def\category{< CATEGORY >
}
407 \def\synopsis{< SYNOPSIS >
}
410 \def\interactive{`
\N}
414 %% Header in the msg file.
417 LaTeX2e bug
report.^^J
%
418 \ifnum \interactive=`Y Generated
\else Template generated
\fi
419 by latexbug.tex on
\number\year/
\two@digits
\month/
\two@digits
\day^^J
%
421 Reports may be submitted by email to latex-bugs@latex-project.org^^J
%
422 Please use the subject line:^^J
%
423 Subject:
\synopsis^^J
%
425 To follow up an existing
report, include the bug reference, e.g.^^J
426 "latex/
1234: ", preceding the subject text.^^J
427 ============================================================^^J
}
432 %% Category of bug, obtained earlier but put out now, after the header.
434 \wmsg{>Category:
\category}
437 %% synopsis of bug, obtained earlier but put out now, after the header.
439 \wmsg{>Synopsis:
\synopsis}
443 %% >Confidential: Default to no unless this is overridden
444 %% in latexbug.cfg. If you want to send a one-off confidential
445 %% report, just edit the latexbug.msg file to say yes.
447 \wmsg{>Confidential:
\ifx\confidential\undefined
454 %% Try to catch various formats that babel has used to add to the banner
455 %% over the years. Currently it uses \typeout, so put the first \typeout
456 %% in \format and the second in \hyphenation. Earlier releases used
459 \global\let\format\@empty
460 \gdef\hyphenation{standard
}
461 \def\immediate#1#
{\xdef\hyphenation}
463 \xdef\format{\format#1}\def\typeout#
#1{\xdef\hyphenation{#
#1}}}
467 \wmsg{>Release:
\format}
471 %% if interactive, \wread reads a line (verbatim) and writes it to the
472 %% .msg file, until two consecutive blank lines are entered.
477 \let\do\@makeother
\dospecials
481 \let\lastanswer\answer
482 \message{=>
}\read\m@ne to
\answer
483 \ifx\lastanswer\@empty
484 \let\lastanswer\answer
486 \ifx\lastanswer\@empty
489 \immediate\write\msg{\answer}%
490 \expandafter\wreadloop
494 %% If non-interactive, \wread just writes a blank line to the .msg file,
495 %% and \wmsg does not write to the terminal.
501 %% \copytomsg copies the contents of a file into the .msg file.
502 %% (at least it does it as well as TeX can, so there may be
503 %% transcription problems with 8-bit characters).
505 %% It does a line count, and complains if the test file is
508 \chardef\inputfile=
15
513 \def\do#
#1{\catcode`#
#1=
11}%
516 \openin\inputfile#1\relax
523 \typeout{***
\thefile\space line count =
\the\linecount}
525 \global\advance\linecount\@ne
526 \read\inputfile to
\inputline
527 \ifx\inputline\@empty
532 \expandafter\@copytomsg
537 %% Test the age of the current format.
539 \def\getage#1/
#2/
#3\@nil
{%
541 \advance\count@-
#1\relax
542 \multiply\count@ by
12\relax
543 \advance\count@
\month
544 \advance\count@-
#2\relax}
546 \expandafter\getage\fmtversion\@nil
548 %% \count@ should now be the age of the format in months.
550 %% Take a generous definition of `year'.
553 ! Your LaTeX installation is more than five years old.^^J
%
554 ! Please consider updating LaTeX before submitting this
report.^^J
%
555 ! At least check a current LaTeX changes.txt file, to see if the^^J
%
556 ! bug has been fixed in the current release.^^J
%
559 %% Put the message in a macro to improve the look of the error mesage.
562 \errhelp{If you still wish to complete the form, just type return.
}
563 \errmessage{\oldformat}
567 %% Test fonts not customised too much. (unless using initex)
571 \encodingdefault/
\familydefault/
\seriesdefault/
\shapedefault}
572 \def\standardfontdefaults{OT1/cmr/m/n
}
573 \ifx\fontdefaults\standardfontdefaults\else
574 \wmsg*
{>Unformatted:
}
575 \wmsg{Normal font:
\fontdefaults}
576 \def\customisedfonts{^^J
%
577 ! This format has customised font defaults.^^J
%
578 ! Please try to re-create the error using a standard format^^J
%
579 ! before submitting this
report}
580 \errhelp{If you still wish to complete the form, just type return.
}
581 \errmessage{\customisedfonts}
586 %% Now use \wmsg and \wread for each of the multi-line fields
588 %% One line fields use \readifnotknown, which will only prompt
589 %% if the field has not already been set in the configuration file.
592 \typeout{^^JYour name:
}
593 \readifnotknown{name
}
596 \def\name{ < ENTER YOUR NAME >
}
602 \typeout{^^JYour Address (preferably email):
}
603 \readifnotknown{address
}
605 \ifx\address\undefined
606 \def\address{ < ENTER YOUR EMAIL ADDRESS >
}
610 \wmsg*
{>Originator:
\address \space(
\name)
}
613 %% >Organisation: is really a GNATS multiline field
614 %% but we treat it as a one-line field.
616 \wmsg*
{>Organization:
\ifx\organisation\undefined
617 \ifx\organization\undefined\else
626 %% Test which format is being used. These fields are completed
627 %% automatically even if the blank template is being produced.
630 \wmsg*
{>Environment:
}
631 \wmsg*
{ Hyphenation:
\hyphenation}
632 \wmsg*
{ \string\@TeXversion:
\meaning\@TeXversion
633 \ifx\@TeXversion\@@undefined
634 \space (Standard setting for TeX3.141 and later)
\fi}
635 \wmsg*
{ \string\@currdir:
\meaning\@currdir
}
636 \wmsg*
{ \string\input@path:
\meaning\input@path
637 \ifx\input@path\@@undefined
638 \space (Standard setting)
\fi}
640 \wmsg*
{>Unformatted:
}
641 \wmsg*
{ *** Initex configuration files
}
643 %% These are in a comma separated list, so locally reset
646 \wmsg*
{\@inputfiles
}}
649 \wmsg*
{>Description:
}
651 \wmsg{Description of bug:
}
654 \@spaces The answer to this question may take several lines.^^J
%
655 \@spaces (Each such line will be prompted by =>.)^^J
%
656 \@spaces Typing TWO consecutive blank lines terminates the answer.
}
658 \wmsg{ < ENTER BUG REPORT HERE >
}
665 %% insertion of the test file
672 Name of a SHORT, SELF-CONTAINED file which indicates the problem:^^J
%
673 This file should be as small as possible (preferably <
60 lines)^^J
%
674 Any non-standard files that the test file uses should be included^^J
%
675 using the filecontents environment.^^J^^J
%
677 LaTeX will try to input this file, so give the full path^^J
%
678 if the file is not in the current directory.^^J^^J
%
680 If you are not reporting a bug, and there is therefore^^J
%
681 no test file, just hit <return>
}
682 \message{filename>
}\read\m@ne to
\filename
688 %% Try to find the .tex file and .log file
693 \ifx\LaTeX\undefinedcommand
696 \typeout{^^J^^JNo test file.^^J^^J
%
697 Three classes of
report are supported:^^J^^J
%
698 0) sw-bug:^^J\@spaces
699 Bug in the software, the
report should include a test file.^^J
700 1) doc-bug:^^J\@spaces
701 Inaccuracies in the documentation.^^J
702 2) change-request:^^J\@spaces
703 Not a bug, but rather a request for LaTeX to be changed.^^J
}
704 \message{Please select a category
0--
2:
}
705 \read\m@ne to
\answer
709 \count@=
\answer\relax
714 \ifinteractive\wmsg{>Class: sw-bug
}\fi
715 \typeout{^^J! Please edit the message to add a test file and log!
}
717 \wmsg*
{^^J>How-To-Repeat:
}
719 Sample file which indicates the problem:^^J
%
720 ========================================^^J
%
721 \space< TEST FILE HERE >^^J
%
723 The log file from running LaTeX on the sample:^^J
%
724 ==============================================^^J
%
725 \space< LOG FROM TEST FILE HERE >
}
727 \wmsg{>Class: doc-bug
}
729 \wmsg{>Class: change-request
}
731 \errhelp{Quit with `x' and then re-start latexbug
}
732 \def\badcategory{Only classes
0,
1,
2 are supported at this time
}
733 \errmessage{\badcategory}
738 \filename@parse
\filename
740 \IfFileExists{\filename}{\edef\samplefile{\filename}}{}
742 \IfFileExists{\filename@area
\filename@base.log
}
743 {\edef\logfile{\filename@area
\filename@base.log
}}
744 {\IfFileExists{\filename@area
\filename@base.lis
}
745 {\edef\logfile{\filename@area
\filename@base.lis
}}
750 %% The example file goes here:
752 \wmsg*
{^^J>How-To-Repeat:
}
755 Sample file which indicates the problem:^^J
%
756 ========================================
}
758 \ifx\samplefile\undefinedcommand
760 Sample file
\filename\space not found.^^J
%
761 Please edit
\jobname.msg to include the sample file.
}
762 \wmsg*
{ < TEST FILE HERE >
}
765 \copytomsg{\samplefile}
769 !!! Your test file is
\the\linecount\space lines long.^^J
%
770 !!! Such a large test file causes us problems:^^J
%
771 !!! * It makes it difficult to track down the error^^J
%
772 !!! * It makes our database for storing reports unnecessarily large.^^J
%
774 !!! Please, if at all possible, cut down your test file to the^^J
%
775 !!! smallest file that shows the behaviour.^^J
}
782 %% The log file goes here:
785 The log file from running LaTeX on the sample:^^J
%
786 ==============================================
}
788 \ifx\logfile\undefinedcommand
790 Log file
\filename@area
\filename@base.log not found.^^J
%
791 Please edit
\jobname.msg to include the log file.
}
792 \wmsg*
{ < < LOG FROM TEST FILE HERE >
}
805 ============================================================
}
809 You may wish to make further changes to the bug
report file:^^J
%
814 A template for submitting bug reports has been left in the file:^^J
%
816 Please use your editor to complete the file before submitting^^J
%
820 \let\ifinteractivetrue\iftrue
822 If you have access to email, please send `
\jobname.msg' to:^^J
%
823 latex-bugs@latex-project.org Please use the subject line:^^J
%
824 \@spaces Subject:
\synopsis^^J
%
826 (This subject will be used in all subsequent correspondence.)^^J
%
828 To follow up an existing
report, include the bug reference, e.g.^^J
%
829 "latex/
1234: ", preceding the subject text.^^J
%
831 Your message will be entered into a publicly readable database^^J
%
832 Accessable via the www (see bugs.txt for details).^^J
%
833 If do not wish this message made public, Edit the^^J
%
834 >Confidential: no^^J
%
835 field to yes before submitting this message.^^J
%
837 Thank you for taking the time to submit a bug
report.
}
840 ============================================================^^J
842 End of LaTeX2e bug
report.^^J
%
843 ============================================================
}
846 %% Close the .msg output stream.
848 \immediate\closeout\msg
851 %% This is the TeX primitive \end command.