home *** CD-ROM | disk | FTP | other *** search
/ MACD 4 / MACD4.iso / TeX / macros / latex2e / inputs / latexbug.tex < prev    next >
Encoding:
Text File  |  1978-03-06  |  12.2 KB  |  518 lines

  1. % \iffalse meta-comment
  2. %
  3. % Copyright 1994 the LaTeX3 project and the individual authors.
  4. % All rights reserved. For further copyright information see the file
  5. % legal.txt, and any other copyright indicated in this file.
  6. % This file is part of the LaTeX2e system.
  7. % ----------------------------------------
  8. %  This system is distributed in the hope that it will be useful,
  9. %  but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. %  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. % IMPORTANT NOTICE:
  12. % For error reports in case of UNCHANGED versions see bugs.txt.
  13. % Please do not request updates from us directly.  Distribution is
  14. % done through Mail-Servers and TeX organizations.
  15. % You are not allowed to change this file.
  16. % You are allowed to distribute this file under the condition that
  17. % it is distributed together with all files mentioned in manifest.txt.
  18. % If you receive only some of these files from someone, complain!
  19. % You are NOT ALLOWED to distribute this file alone.  You are NOT
  20. % ALLOWED to take money for the distribution or use of either this
  21. % file or a changed version, except for a nominal charge for copying
  22. % etc.
  23. % \fi
  24.  
  25. %%% ====================================================================
  26. %%%  @LaTeX-file{
  27. %%%     author          = "David Carlisle",
  28. %%%     version         = "1.08",
  29. %%%     date            = "08 June 1994",
  30. %%%     filename        = "latexbug.tex",
  31. %%%     email           = "latex-bugs@uni-mainz.de",
  32. %%%     codetable       = "ISO/ASCII",
  33. %%%     keywords        = "LaTeX, bugs, reporting",
  34. %%%     supported       = "yes",
  35. %%%     docstring       = "
  36. %%%
  37. %%%     LaTeX bug report generator.
  38. %%%     %%%%%%%%%%%%%%%%%%%%%%%%%%
  39. %%%
  40. %%%     Processing this file with LaTeX should produce
  41. %%%     a file latexbug.msg in the current directory.
  42. %%%
  43. %%%     latexbug.msg may be used as a template for submitting bug
  44. %%%     reports concerning files in the standard LaTeX distribution.
  45. %%%
  46. %%%     Any bug report should include a small LaTeX test file
  47. %%%     that shows the bug, and the log that LaTeX produces on the
  48. %%%     test file.
  49. %%%
  50. %%%     Please check before submitting a bug report that your format is
  51. %%%     not more than one year old. New LaTeX releases occur at 6
  52. %%%     monthly intervals, and so your bug may be fixed in a later
  53. %%%     release.
  54. %%%
  55. %%%     Completed bug report forms should be submitted to:
  56. %%%     latex-bugs@uni-mainz.de
  57. %%%
  58. %%%  }
  59. %%% ====================================================================
  60.  
  61. \ifcat{=
  62.  
  63. \catcode`\{=1 \let\bgroup{
  64. \catcode`\}=2 \let\egroup}
  65. \catcode`\#=6 
  66. \catcode`\^=7
  67. \catcode`\@=11
  68.  
  69. \newlinechar`\^^J
  70. \def\m@ne{-1 }
  71. \countdef\count@255
  72.  
  73. \def\fmtname{INITEX}
  74. \def\fmtversion{9999/00/00}
  75. \def\space{ }
  76. \def\@spaces{\space\space\space\space}
  77. \let\@@end\end
  78.  
  79. \chardef\msg15
  80. \immediate\openout\msg=\jobname.msg
  81.  
  82. \expandafter\edef\csname newif\endcsname#1#2{%
  83.   \let\noexpand\ifinteractive
  84.     \expandafter\noexpand\csname iffalse\endcsname}
  85.  
  86. \def\typeout{\immediate\write17}
  87.  
  88. \def\two@digits#1{\ifnum#1<10 0\fi\number#1}
  89.  
  90. \def\wmsg#1#{\bgroup\@wmsg}
  91.  
  92. \else
  93. %%
  94. %% @ is a letter
  95. %%
  96. \catcode`\@=11
  97.  
  98. %%
  99. %% Output stream to produce the bug report template.
  100. %%
  101. \newwrite\msg
  102. \immediate\openout\msg=\jobname.msg
  103.  
  104.  
  105. %%
  106. %% Check that LaTeX2e is being used.
  107. %%
  108. \ifx\undefined\newcommand
  109.  \newlinechar`\^^J%
  110.  \immediate\write17{^^J%
  111.     You must use LaTeX2e to generate the bug report!^^J^^J%
  112.     If there is a bug in the installation procedure,^^J%
  113.     and you can not create LaTeX2e, you may use initex^^J%
  114.     to generate the report}%
  115.  
  116.  \let\relax\end
  117. \else
  118. \def\@tempa{LaTeX2e}\ifx\@tempa\fmtname\else
  119.  \immediate\write17{^^J%
  120.   Older Versions of LaTeX are no longer supported.^^J%
  121.   You must use LaTeX2e to generate the bug report!^^J^^J%
  122.   If there is a bug in the installation procedure,^^J%
  123.   and you can not create LaTeX2e, you may use initex^^J%
  124.   to generate the report}%
  125.  \let\relax\@@end
  126. \fi\fi
  127.  
  128. %%
  129. %% \wmsg writes to the terminal, and the .msg file
  130. %% \wmsg* just writes to the .msg file
  131. %% \typeout just writes to the terminal
  132. %%
  133.  
  134. \def\wmsg{\bgroup\@ifstar{\interactivefalse\@wmsg}\@wmsg}
  135.  
  136. \fi
  137.  
  138. \relax
  139.  
  140.  
  141. \def\@wmsg#1{%
  142.   \ifinteractive\immediate\write17{#1}\fi
  143.   \immediate\write\msg{#1}%
  144.   \egroup}
  145.  
  146.  
  147. %%
  148. %% if \interactivefalse just make a blank template.
  149. %%
  150. \newif\ifinteractive
  151. \interactivetrue
  152.  
  153.  
  154. %%%
  155. %%% For testing for blank lines.
  156. %%%
  157. \def\xpar{\par}
  158.  
  159.  
  160. %%
  161. %% Opening Banner.
  162. %%
  163. \typeout{^^J%
  164. ============================================================^^J%
  165. ^^J%
  166. LaTeX bug report generator^^J%
  167. ==========================^^J%
  168. Processing this file with LaTeX will produce a template \jobname.msg^^J%
  169. for submitting bug reports for the LaTeX distribution.^^J%
  170. Please do not report bugs in other, non-standard, files to the^^J%
  171. latex-bugs address.^^J}
  172.  
  173. \count@=0
  174. \ifinteractive
  175. \typeout{%
  176. Several categories of files are supported,^^J%
  177. corresponding to directories in the standard LaTeX distribution:^^J^^J
  178. 0) base: \@spaces
  179.          The format itself, and the main classes such as `article'.^^J
  180. 1) tools:\@spaces
  181.          Packages supported by the LaTeX3 project team.^^J
  182. 2) graphics: 
  183.          The color and graphics packages.^^J
  184. 3) mfnfss: \space\space
  185.          Packages for using MetaFont fonts with NFSS (ie LaTeX2e).^^J
  186. 4) psnfss: \space\space
  187.          Packages for using PostScript fonts with NFSS (ie LaTeX2e).^^J
  188. 5) amslatex:
  189.          Classes and Packages supported by the AMS.^^J
  190. 6) babel:\@spaces
  191.          Packages supporting many different languages.^^J%
  192. }
  193. \message{Please select a category 0--6:  }
  194. \read\m@ne to \answer
  195. \count@=\answer
  196. \else
  197. \typeout{As you are using INITEX, I will assume category 0}
  198. \fi
  199.  
  200. \ifcase\count@
  201. \wmsg{^^J>Category: latex}\or
  202. \wmsg{^^J>Category: tools}\or
  203. \wmsg{^^J>Category: graphics}\or
  204. \wmsg{^^J>Category: mfnfss}\or
  205. \wmsg{^^J>Category: psnfss}\or
  206. \wmsg{^^J>Category: amslatex}\or
  207. \wmsg{^^J>Category: babel}\else
  208. \errhelp{Quit with `x' and then re-start latexbug}
  209. \def\badcategory{Only categories 0,...,6 are supported at this time}
  210. \errmessage{\badcategory}
  211. \fi
  212.  
  213.  
  214. \typeout{%
  215. ^^J%
  216. \ifinteractive
  217. This report generator may be used in one of two ways.^^J%
  218. If you choose the interactive option, you will be prompted to answer^^J%
  219. several questions. Otherwise a blank template will be created for^^J%
  220. you to fill in using your editor.^^J%
  221. \else
  222. INITEX should only be used for reporting bugs with the LaTeX2e^^J%
  223. installation procedure. If you have a working copy of LaTeX2e,^^J%
  224. please use that to generate the report.
  225. \fi}
  226.  
  227. \ifinteractive
  228. \message{Interactive session (y/n) ? }
  229. \read\m@ne to \answer
  230.  
  231. \ifx\answer\xpar
  232.    \def\answer{n}
  233. \fi
  234.  
  235. %%
  236. %% Allow anything begining with `y' or `Y' for yes.
  237. %%
  238. \edef\answer{\uccode`\expandafter\@car\answer\@nil}
  239. \ifnum \answer=`Y \else\interactivefalse\fi
  240. \else
  241. \def\answer{`\N}
  242. \fi
  243.  
  244. %%
  245. %% Header in the msg file.
  246. %%
  247. \wmsg*{^^J%
  248.  LaTeX2e bug report.^^J%
  249. \ifnum \answer=`Y Generated \else Template generated \fi
  250.  by latexbug.tex on \number\year/\two@digits\month/\two@digits\day^^J%
  251.  ============================================================}
  252.  
  253. \ifinteractive
  254. %%
  255. %% if interactive, \wread reads a line (verbatim) and write it to the
  256. %% .msg file, until a blank line is entered.
  257. %%
  258.   \typeout{^^J%
  259.     The answer to each question may take several lines.^^J%
  260.     (Each line will be prompted by =>.)^^J%
  261.     Typing a blank line terminates the current answer.}
  262.   \def\wread{{\catcode`\^^I=12
  263.   \let\do\@makeother\dospecials
  264.   \message{=> }\read\m@ne to \answer
  265.   \ifx\answer\xpar\else
  266.     \immediate\write\msg{\answer}
  267.     \expandafter\wread
  268.   \fi}}
  269. \else
  270. %%
  271. %% If non-interactive, \wread just writes a blank line to the .msg file,
  272. %% and \wmsg does not write to the terminal.
  273. %%
  274.   \def\wread{\wmsg{}}
  275. \fi
  276.  
  277. %%
  278. %% \copytomsg copies the contents of a file into the .msg file.
  279. %% (at least it does it as well as TeX can, so there may be
  280. %% transcription problems with 8-bit characters).
  281. %%
  282.  
  283. \chardef\inputfile=15
  284.  
  285. \def\copytomsg#1{{%
  286.    \def\do##1{\catcode`##1=11}%
  287.    \dospecials
  288.    \openin\inputfile#1
  289.    \@copytomsg
  290.    \closein\inputfile
  291. }}
  292.  
  293. \def\@copytomsg{%
  294.    \ifeof\inputfile
  295.    \else
  296.       \read\inputfile to \inputline
  297.       \ifx\inputline\xpar
  298.          \wmsg*{}
  299.       \else
  300.          \wmsg*{\inputline}
  301.       \fi
  302.       \expandafter\@copytomsg
  303.    \fi
  304. }
  305.  
  306. %% 
  307. %% \stripspaces...\endstripspaces strips space off the end of its
  308. %% argument. 
  309. %%
  310.  
  311. \def\stripspaces#1 \endstripspaces{#1}
  312.  
  313. %%
  314. %% Test which format is being used. These fields are completed
  315. %% automatically even if the blank template is being produced.
  316. %%
  317. \wmsg{^^J%
  318. Format:^^J%
  319. \expandafter\@secondoftwo\the\everyjob}
  320.  
  321. %%
  322. %% Test the age of the current format.
  323. %%
  324. \def\getage#1/#2/#3\@nil{%
  325.   \count@\year
  326.   \advance\count@-#1\relax
  327.   \multiply\count@ by 12\relax
  328.   \advance\count@\month
  329.   \advance\count@-#2\relax}
  330. %
  331. \expandafter\getage\fmtversion\@nil
  332. %%
  333. %% \count@ should now be the age of the format in months.
  334. %%
  335. \ifnum\count@>12
  336. \def\oldformat{^^J%
  337.    ! Your LaTeX installation is more than one year old.^^J%
  338.    ! Please consider updating LaTeX before submitting this report.^^J%
  339.    ! At least check a current latex.bug file, to see if the bug^^J%
  340.    ! has been fixed in the current release.^^J%
  341.    !}
  342. %%
  343. %% Put the message in a macro to improve the look of the error mesage.
  344. %%
  345.  
  346. \errhelp{If you still wish to complete the form, just type return.}
  347. \errmessage{\oldformat}
  348. \fi
  349.  
  350. %%
  351. %% Three macros that vary their definitions betwen LaTeX installations.
  352. %%
  353. \wmsg*{^^J%
  354. TeX Version:^^J%
  355. \meaning\@TeXversion}
  356.  
  357. \wmsg*{^^J%
  358. Current Directory Syntax:^^J%
  359. \meaning\@currdir}
  360.  
  361. \wmsg*{^^J%
  362. Input Path:^^J%
  363. \meaning\input@path}
  364.  
  365.  
  366. %%
  367. %% Now just use \wmsg and \wread for each of the fields in the form.
  368. %%
  369. \wmsg{^^J%
  370. Your Name:}
  371. \wread
  372.  
  373. \wmsg{^^J%
  374. Your Address (preferably email):}
  375. \wread
  376.  
  377. \wmsg{^^J%
  378. Brief description of bug:}
  379. \wread
  380.  
  381. \ifinteractive
  382.    \wmsg{^^J%
  383.       Name of a SHORT, SELF-CONTAINED file which indicates the problem:}
  384.    \message{=> }\read\m@ne to \filename
  385. \else
  386.    \def\filename{\par}
  387. \fi
  388.  
  389. %% 
  390. %% Try to find the .tex file and .log file
  391. %%
  392.  
  393. \ifx\filename\xpar
  394.  
  395. \ifx\LaTeX\undefinedcommand\else
  396.  
  397. \wmsg*{^^J%
  398. Sample file which indicates the problem:^^J%
  399. ========================================^^J%
  400. ^^J%
  401. The log file from running LaTeX on the sample:^^J%
  402. ==============================================}
  403.  
  404. \fi
  405.  
  406. \else
  407.  
  408. \wmsg*{\filename}
  409.  
  410. \edef\filename{\expandafter\stripspaces\filename\endstripspaces}
  411.  
  412. \filename@parse\filename
  413.  
  414. \IfFileExists{\filename}{
  415.    \edef\samplefile{\filename}
  416. }{}
  417.  
  418. \IfFileExists{\filename@area\filename@base.log}{
  419.    \edef\logfile{\filename@area\filename@base.log}
  420. }{
  421.    \IfFileExists{\filename@area\filename@base.lis}{
  422.       \edef\logfile{\filename@area\filename@base.lis}
  423.    }{}
  424. }
  425.  
  426.  
  427. %% 
  428. %% The example file goes here:
  429. %%
  430.  
  431. \wmsg*{^^J%
  432. Sample file which indicates the problem:^^J%
  433. ========================================}
  434.  
  435. \ifx\samplefile\undefinedcommand
  436.    \typeout{^^J%
  437.       Sample file \filename not found.^^J%
  438.       Please edit \jobname.msg to include the sample file.}
  439. \else
  440.    \copytomsg{\samplefile}
  441. \fi
  442.  
  443.  
  444. %%
  445. %% The log file goes here:
  446. %%
  447. \wmsg*{^^J%
  448. The log file from running LaTeX on the sample:^^J%
  449. ==============================================}
  450.  
  451. \ifx\logfile\undefinedcommand
  452.    \typeout{^^J%
  453.       Log file \filename@area\filename@base.log not found.^^J%
  454.       Please edit \jobname.msg to include the log file.}
  455. \else
  456.    \copytomsg{\logfile}
  457. \fi
  458.  
  459. \fi
  460.  
  461.  
  462. %%
  463. %% Closing Banner.
  464. %%
  465. \typeout{^^J%
  466. ============================================================}
  467.  
  468. \ifinteractive
  469.  \typeout{^^J%
  470.    You may wish to make further changes to the bug report file:^^J%
  471.    `\jobname.msg'^^J%
  472.    using your editor.}
  473. \else
  474.  \typeout{^^J%
  475.    A template for submitting bug reports has been left in the file:^^J%
  476.    \jobname.msg^^J%
  477.    Please use your editor to complete the file before submitting^^J%
  478.    your report.}
  479. \fi
  480.  
  481. \let\ifinteractivetrue\iftrue
  482. \typeout{^^J%
  483. ============================================================^^J%
  484. ^^J%
  485.   If you have access to email, please send `\jobname.msg' to:^^J%
  486.   latex-bugs@uni-mainz.de^^J%
  487. ^^J%
  488.   Thank you for taking the time to submit a bug report.^^J
  489. ^^J%
  490. ============================================================}
  491.  
  492. \wmsg*{^^J%
  493. ============================================================^^J
  494. ^^J%
  495.    End of LaTeX2e bug report.^^J%
  496. ^^J%
  497. ============================================================}
  498.  
  499. %%
  500. %% Close the .msg output stream.
  501. %%
  502. \immediate\closeout\msg
  503.  
  504. %%
  505. %% This is the TeX primitive \end command.
  506. %%
  507. \@@end
  508.