summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/fixme/fixme.dtx
blob: b2a51fc947aabcb284007e347bc8d49bbbbc170f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
% \iffalse                                                 -*- mode: LaTeX -*-
%
% fixme.dtx --- Doc file for the FiXme package (code and documentation)
%
% Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004 Didier Verna.
%
% PRCS: $Id: fixme.dtx 1.68 Mon, 31 Jan 2005 14:39:45 +0100 didier $
%
% Author:        Didier Verna <didier@lrde.epita.fr>
% Maintainer:    Didier Verna <didier@lrde.epita.fr>
% Created:       Thu Dec 10 16:04:01 1998
% Last Revision: Wed Dec 22 14:44:26 2004
%
% This file is part of FiXme.
%
% FiXme may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.1
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.1 or later is part of all distributions of LaTeX
% version 1999/06/01 or later.
%
% FiXme consists of the files listed in the file `README'.
%
%
% Commentary:
%
% Contents management by FCM version 0.1.
%
%
% Code:
%
%<*driver>
\documentclass[a4paper]{ltxdoc}
% \OnlyDescription
% \CodelineIndex
% \RecordChanges
\begin{document}
\DocInput{fixme.dtx}
\end{document}
%</driver>
%
% \fi
%
% \catcode`\¡=14
% \CheckSum{800}
%% \CharacterTable
%%  {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%
% ^^A $Format: "% \\newcommand\\version{v$Version$}"$
% \newcommand\version{v3.1}
% ^^A $Format: "% \\newcommand\\releasedate{$ReleaseDate$}"$
% \newcommand\releasedate{2005/01/31}
% ^^A $Format: "% \\newcommand\\packagecopyright{$LaTeXCopyright$}"$
% \newcommand\packagecopyright{Copyright \copyright{} 1998, 1999, 2000, 2001, 2002, 2004, 2005 Didier Verna}
% \newcommand\fixme{\textsf{FiXme}}
% \newcommand\auctex{AUC-\TeX}
% \MakeShortVerb{\|}
% \date\today
% \title{\fixme{} -- a \LaTeXe{} package for inserting fixme notes
% in your documents \thanks{This document describes \fixme{}
% \version, release date \releasedate.}}
% \author{Didier Verna\\
% \texttt{mailto:didier@lrde.epita.fr}\\
% \texttt{http://www.lrde.epita.fr/\~{}didier/}}
% \maketitle
%
%
% \begin{abstract}
% In the process of writing a long document, it is a common practice to leave
% some parts unwritten or uncomplete, and come back to them later. In such
% cases, you probably want to stick clues about which parts need to be
% ``fixed'', where they are located, and what needs to be done. This is what I
% call ``fixme notes''. The purpose of this package is to provide you with
% convenient ways to insert \fixme{} notes in your documents.\par
% The \fixme{} package is \packagecopyright{}, and distributed under the terms
% of the LPPL license.
% \end{abstract}
%
%
% \section{Description}
% With \fixme, you can insert different kinds of notes in your documents,
% ranging from simple not-so-important notices to critical stuff that must
% absolutely be fixed in the final version.\par
% \fixme{} gives you full control on the layout of these notes: they can be
% displayed inline (directly in the text), as marginal paragraphs (the
% default), as footnotes and even as index entries. All these possibilities
% can be mixed together. Additionally, you can summarize all \fixme{} notes in
% a ``list of fixme's''.\par
% \fixme{} notes are also recorded in the log file, and (depending on their
% importance level) some of them are displayed on the terminal during
% compilation. A final summary is also created at the end of the compilation
% process.\par
% All these features are actually available when you're working in
% \texttt{draft} mode. In \texttt{final} mode, the behavior is slightly
% different: any remaining critical note generates an error (the compilation
% aborts), while non critical ones are just removed from the document's body
% (they're still recorded in the log file though).
%
%
% \section{Using \fixme}
% First of all, please note that the \texttt{ifthen} and \texttt{verbatim}
% packages are required. You don't have to load them explicitly though. As
% long as \LaTeXe{} can locate them, they will be used automatically.\par
% To use \fixme, simply say |\usepackage[|\meta{options}|]{fixme}| in the
% preamble of your document.
%
% \subsection{Inserting notes}
% \subsubsection{Macros}
% \DescribeMacro{\fixme}
% The main command for inserting a \fixme{} note in your document is the
% |\fixme| macro. It takes the note to insert as its mandatory argument. Notes
% inserted via this command are considered fatal to your document's final
% processing (see section \ref{sec:behavior}).\par
% \DescribeMacro{\fxnote}
% \DescribeMacro{\fxwarning}
% \DescribeMacro{\fxerror}
% As of version 2.0, \fixme{} provides three new macros that insert
% meta-comments about the document, rather than real fixmes. These
% comments have three different importance levels: note, warning and (non
% critical) error. The corresponding macros obey the same syntax as |\fixme|.
% However, none of the notes inserted via these macros are fatal.
%
% \subsubsection{Environments}
% \DescribeEnv{anfxnote}
% \DescribeEnv{anfxwarning}
% \DescribeEnv{anfxerror}
% \DescribeEnv{afixme}
% As of version 3.0, \fixme{} provides environments for inserting longer
% notes. These environments take one optional argument (should be short,
% perhaps a summary of the note) that will be used in the list of fixme's and
% in the index if required.\par
% The \fixme{} environments behave exactly the same way as their macro
% counterpart, except for the layout (see section \ref{sec:layout}): as they
% are meant for longer notes, the layout is always \texttt{inline} (and
% possibly \texttt{index} if so required). By default, \fixme{} environments
% are typeset in a \texttt{quotation} one.
%
% \subsection{Controlling the behavior of \fixme\label{sec:behavior}}
% \DescribeEnv{final}
% \DescribeEnv{draft}
% The global behavior of the package is controlled via the two standard
% options \texttt{final} and \texttt{draft}. These options are usually given
% to |\documentclass{}| which in turn passes them to all packages.\par
% In \texttt{draft} mode, the notes are recorded in the log file, and
% appear in the text as specified by the layout settings (see section
% \ref{sec:layout}). Additionally, warnings, errors and fatal errors are also
% displayed on the terminal.\par
% In final mode, non fatal notes (those generated by the |\fx*| commands) are
% still logged, but they're removed from the document's body. On the other
% hand, any remaining fatal note (generated by |\fixme|) will abort
% compilation with an informative message. This will help you track down
% forgotten important caveats in your document. Let me say it again: final
% documents can only have notes, warnings, and (non critical) errors left.
% Well, if, for some reason, you really want to compile in \texttt{final}
% mode with critical \fixme{} notes left behind, you always have the
% possibility to pass the \texttt{draft} option to \fixme{} directly\ldots\par
% The \texttt{final} mode has been chosen as the default because \LaTeXe{}
% itself behaves this way.\par
%
% \subsection{Controlling the notes layout\label{sec:layout}}
% \DescribeEnv{inline}
% \DescribeEnv{margin}
% \DescribeEnv{footnote}
% \DescribeEnv{index}
% \fixme{} notes can appear in several forms (that can be combined) in your
% document. The forms currently supported are: inline (directly in the text),
% marginal notes, footnotes, and index entries. To activate a particular
% layout, use the corresponding package option. By default, only the
% \texttt{margin} layout is active.\par
% Each layout option has a counterpart that deactivates it. The counterpart
% option has the same name, prefixed with \texttt{no}. For instance, if you
% don't want marginal notes, use the \texttt{nomargin} option.\par
% \DescribeMacro{\fixme[]}
% \DescribeMacro{\fxnote[]}
% \DescribeMacro{\fxwarning[]}
% \DescribeMacro{\fxerror[]}
% As of version 3.0, \fixme{} provides a way to change the selected layout(s)
% on a per-note basis: each note insertion command takes an optional first
% argument that overrides the global layout. This argument consists of one or
% more layout options (\texttt{inline}, \texttt{margin}, \texttt{footnote} and
% \texttt{index}) separated by commas. Remember that local layouts
% \emph{override} the global ones; they don't add to it.\par
% On what occasion would one want to modify the layout for a particular note~?
% Here is a typical situation: suppose you have a document in which \fixme{}
% notes are typeset as margin paragraphs (this is the default). You would not
% be able to put a note in a figure, because floats can't be nested in
% \LaTeX{} (margin paragraphs are floats). In such a case, you would rather
% inline the note, which can be done with something like
% |\fixme[inline]{blah}|.\par
% Finally, note that \fixme{} environments behave in a special way: they are
% always typeset \texttt{inline}, regardless of your layout settings (they
% respect your whish for an index though).\par
%
% \subsection{Controlling the notes logging}
% \DescribeEnv{silent}
% \DescribeEnv{nosilent}
% As well as being displayed in the document itself, all \fixme{} notes are
% ``logged'' in different ways: by default, simple notes are recorded in the
% log file while the others are also displayed on the terminal output.\par
% You have the ability to suppress all kind of logging by using the
% \texttt{silent} option. By default, the behavior is that of
% \texttt{nosilent}.
%
% \subsection{List of \fixme's}
% \DescribeMacro{\listoffixmes}
% \fixme{} remembers where you put \fixme{} notes in a toc-like file whose
% extension is \texttt{lox}. The |\listoffixmes| macro generates the list of
% all \fixme{} notes in a manner similar to that of the ``list of figures''
% for instance. A standard layout is automatically used for the `article',
% `report', `book' classes and their koma-script replacements. If another
% class is used, the `article' layout is selected. Also, note that if no
% \fixme{} note remain in the document, this macro doesn't generate an empty
% list, but rather stays silent. It also stays silent in \texttt{final} mode,
% regardless of the presence of remaining notes.
%
%
% \section{Customizing \fixme}
% \subsection{Customizing the notes layout}
% \subsubsection{Macros}
% The \texttt{inline}, \texttt{margin} and \texttt{footnote} layouts have two
% parts: a ``prefix'' which depends on the note level, and the note
% itself. The prefix is one of ``\fixme{} note:'', ``\fixme{} warning:'',
% ``\fixme{} error:''  or simply ``\fixme{}:'', and appears in bold. The note
% itself appears emphasized.
% \DescribeMacro{\FXInline}
% \DescribeMacro{\FXMargin}
% \DescribeMacro{\FXFootnote}
% These layouts are implemented thanks to the corresponding |\FX*| macros that
% you can redefine if you whish. Each such macro takes two mandatory
% arguments: the prefix and the note, in that order.\par
% \DescribeMacro{\FXIndex}
% The |\FXIndex| macro is used for the \texttt{index} layout. All \fixme{}
% index entries appear under the ``\fixme{}'' key in the symbols section.
% There are 4 subcategories under this key, as many as there are note levels.
% By default, only the first 3 of them are used though (fatal errors do not
% appear under a subkey, but directly under the \fixme{} key). The notes are
% numbered in the index.\par
%
% \subsubsection{Environments}
% \DescribeMacro{\FXEnvBegin}
% \DescribeMacro{\FXEnvEnd}
% The optional argument of \fixme{} environments is always typeset according
% to the \texttt{inline} layout described above. By default, \fixme{} uses a
% \texttt{quotation} for displaying the environments'contents. If you want to
% change that, you can redefine the macros |\FXEnvBegin| and |\FXEnvEnd| that
% open and close the environments.
%
% \subsection{Customizing the notes logging}
% \DescribeMacro{\FXNote}
% \DescribeMacro{\FXWarning}
% \DescribeMacro{\FXError}
% \DescribeMacro{\FXFatal}
% If you want a finer control on logging, you can redefine the commands used
% to implement it. These commands (on the left) are the ones used by
% |\fxnote|, |\fxwarning|, |\fxerror| and |\fixme| respectively. They take the
% note itself as mandatory argument.
%
% \subsection{Fancy fruit salad layout}
% \DescribeEnv{user}
% \DescribeMacro{\FXUser}
% If, for some totally unjustified reason, you are not happy with the
% available layouts, you have the ability to define your own: pass the
% \texttt{user} option to the package (it also has its \texttt{nouser}
% counterpart), and define an |\FXUser| macro in the following manner:\\
% |\newcommand{\FXUser}[2]{|\meta{fancy fruit salad layout job}|}|\\ The
% arguments are the prefix, and the note itself, in that order.\par
% Note that the \texttt{user} option can also be used in the optional argument
% of the notes insertion commands.
%
% \subsection{Internationalization}
% \DescribeEnv{english}
% \DescribeEnv{french}
% \DescribeEnv{francais}
% \DescribeEnv{spanish}
% \DescribeEnv{italian}
% \DescribeEnv{german}
% \DescribeEnv{ngerman}
% \DescribeEnv{danish}
% \fixme{} currently supports English, French, Spanish, Italian, German and
% Danish. You can select the language you want to use by passing the
% corresponding option (these options are usually given directly to
% |\documentclass{}| which in turn passes them to all packages). The
% \texttt{french} and \texttt{francais} options are synonyms. The
% \texttt{german} and \texttt{ngerman} options are currently equivalent.\par
% If you want a finer grain on the language-dependent parts of \fixme{}, the
% following macros are provided and can be redefined.\par
% \DescribeMacro{\fixmenoteprefix}
% \DescribeMacro{\fixmewarningprefix}
% \DescribeMacro{\fixmeerrorprefix}
% \DescribeMacro{\fixmefatalprefix}
% \DescribeMacro{\fixmelogo}
% The |\fixme*prefix| macros define the prefix for the four different note
% levels. They make intensive use of the macro |\fixmelogo| ;-)\par
% \DescribeMacro{\fixmeindexname}
% \DescribeMacro{\fixmenoteindexname}
% \DescribeMacro{\fixmewarningindexname}
% \DescribeMacro{\fixmeerrorindexname}
% \DescribeMacro{\fixmefatalindexname}
% The macro |\fixmeindexname| defines the main \fixme{} index key. The other
% ones define the different index subkeys for each note level. Please note that
% an empty name for a subkey means that you don't actually want a subcategory
% (that's the case by default for fatal errors). The corresponding notes will
% then appear directly under the main \fixme{} key. For that reason, a non
% empty subkey must end with an exclamation mark.\par
% \DescribeMacro{\listfixmename}
% |\listfixmename| defines the title for the ``list of fixmes'' section.
%
% ^^A\subsection{Counters}
% ^^A \DescribeMacro{\thefixmecount}
% ^^A \DescribeMacro{\thefixmenotecount}
% ^^A \DescribeMacro{\thefixmewarningcount}
% ^^A \DescribeMacro{\thefixmeerrorcount}
% ^^A \DescribeMacro{\thefixmefatalcount}
% ^^A As of \fixme{} version 2.0, four counters are provided. They count
% ^^A respectively the total number of \fixme{} notes, and the number of
% ^^A level-specific ones. At the end of processing, a \fixme{} usage summary is
% ^^A displayed and logged.
%
%
% \section{\auctex{} support}
% \auctex{} is a powerful major mode for editing \TeX{} documents in
% \textsf{Emacs} or \textsf{XEmacs}. In particular, it provides automatic
% completion of macro names once they are known. \fixme{} supports \auctex{}
% by providing a style file named \texttt{fixme.el} which contains \auctex{}
% definitions for the relevant macros. This file should be installed in a
% place where \auctex{} can find it (usually in a subdirectory of your
% \LaTeX{} styles directory). Please refer to the \auctex{} documentation for
% more information on this.
%
% \section{Changes}
% \begin{itemize}
% \item[v3.1] Fix bug reported by Arnold Beckmann: the environments were
% visible in final mode.
% \item[v3.0] Added environments corresponding to the note insertion
% commands.\\
% Added an optional first argument to the note insertion commands
% to change the layout locally.\\
% Fix bug reported by Akim Demaille: marginal notes could mess up the
% document's layout by flushing it right.
% \item[v2.2] New option \texttt{silent} to suppress notes logging\\
% Support for Danish thanks to Kim Rud Bille |<krbi01@control.auc.dk>|
% \item[v2.1] Use |\nobreakspace| instead of the tilda character. This avoids
% conflicts with Babel in Spanish environments.\\
% Fix bug reported by Knut Lickert: index entries were unconditionally built.
% \item[v2.0] New feature: note levels\\
% New feature: \fixme{} note counters and usage summary\\
% Suggestions from Kasper B. Graversen |<kbg@dkik.dk>|\\
% Support for Spanish thanks to Agust\'in Mart\'in |<agusmba@terra.es>|
% \item[v1.5] New appearance option: \texttt{inline}.
% \item[v1.4] Support for the koma-script classes\\
% Fix bug reported by Ulf Jaenicke-Roessler: the |\listoffixmes| command
% didn't work when called before the first \fixme{} note.
% \item[v1.3] Support for Italian thanks to Riccardo Murri |<murri@phc.unipi.it>|
% \item[v1.2] Support for German thanks to Harald Harders |<h.harders@tu-bs.de>|
% \end{itemize}
%
% \StopEventually{\par Well, I think that's it. Enjoy using \fixme{}!
%   \vfill\hfill\small \packagecopyright{}.}
%
% \section{The Code}
% \begin{macro}{\fixmelogo}
%   Here's the preamble:
% \end{macro}
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}
¡$Format: "\\ProvidesPackage{fixme}[$ReleaseDate: 2004/10/19$ v$Version: 2.3$"$
\ProvidesPackage{fixme}[2005/01/31 v3.1
                        Insert fixme notes in your documents]

\RequirePackage{ifthen}
\RequirePackage{verbatim}

\newcommand*\fixmelogo{\textsf{FiXme}}

%    \end{macrocode}
% \subsection{List macros}
% \begin{macro}{\listoffixmes}
%   \begin{macro}{\listoffixmes@final}
%     \begin{macro}{\listoffixmes@draft}
%       |\listoffixmes| is empty by default. The |final| or |draft| options
%       will provide the proper definition. Lists are output in a document
%       class dependant fashion. Classes currently recognized are article,
%       report, book and their koma-script replacements.
%
%       In order to prevent the List of Fixme's chapter heading from being
%       generated when there are no fixmes, a test on the existence of the lox
%       file is performed. There's a slight bug left however: after removing
%       the last fixme, one ends up with an empty lox file, so the heading
%       still appear. Previously, this was done by checking if some fixmes
%       were given, but that was buggy: the list of fixme's could not appear
%       before the first fixme note\ldots I should try to detect whether the
%       file is empty.
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\newcommand\listoffixmes{}
\def\listoffixmes@final{}
\def\listoffixmes@draft{%
  \IfFileExists{\jobname .lox}{\@listoffixmes@pretoc}{}%
  \@starttoc{lox}%
  \IfFileExists{\jobname .lox}{\@listoffixmes@posttoc}{}%
  }

%    \end{macrocode}
% \begin{macro}{\listfixmename}
%   In order to redefine the list title, users have to call |\renewcommand|.
%   I don't like this much: it would be cleaner to provide a real command
%   that redefines the title internally. However, I'll stick with the
%   current scheme because it is consistent with the rest of \LaTeXe's lists.
% \end{macro}
%    \begin{macrocode}
\newcommand*\listfixmename{}

%    \end{macrocode}
%
% \subsubsection{Standard classes}
% \begin{macro}{\listoffixmes@pretoc@article}
%   \begin{macro}{\listoffixmes@posttoc@article}
%     \begin{macro}{\l@fixme@article}
%       Let's start with the article version:
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\def\@listoffixmes@pretoc@article{%
  \section*{\listfixmename%
    \@mkboth{\MakeUppercase\listfixmename}{\MakeUppercase\listfixmename}}%
  }
\def\@listoffixmes@posttoc@article{}
\def\l@fixme@article{\@dottedtocline{1}{1.5em}{2.3em}}

%    \end{macrocode}
% \begin{macro}{\listoffixmes@pretoc@report}
%   \begin{macro}{\listoffixmes@posttoc@report}
%     \begin{macro}{\l@fixme@report}
%       Here's the report version:
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\def\@listoffixmes@pretoc@report{%
  \if@twocolumn
    \@restonecoltrue\onecolumn
  \else
    \@restonecolfalse
  \fi
  \chapter*{\listfixmename%
    \@mkboth{\MakeUppercase\listfixmename}{\MakeUppercase\listfixmename}}%
  }
\def\@listoffixmes@posttoc@report{\if@restonecol\twocolumn\fi}
\def\l@fixme@report{\@dottedtocline{1}{1.5em}{2.3em}}

%    \end{macrocode}
% \begin{macro}{\listoffixmes@pretoc@book}
%   \begin{macro}{\listoffixmes@posttoc@book}
%     \begin{macro}{\l@fixme@book}
%       And here's the book version:
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\def\@listoffixmes@pretoc@book{%
  \if@twocolumn
    \@restonecoltrue\onecolumn
  \else
    \@restonecolfalse
  \fi
  \chapter*{\listfixmename%
    \@mkboth{\MakeUppercase\listfixmename}{\MakeUppercase\listfixmename}}%
  }
\def\@listoffixmes@posttoc@book{\if@restonecol\twocolumn\fi}
\def\l@fixme@book{\@dottedtocline{1}{1.5em}{2.3em}}

%    \end{macrocode}
%
% \subsubsection{koma-script classes}
% \begin{macro}{\listoffixmes@pretoc@scrartcl}
%   \begin{macro}{\listoffixmes@posttoc@scrartcl}
%     \begin{macro}{\l@fixme@scrartcl}
%       Let's start with the scrartcl version:
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\def\@listoffixmes@pretoc@scrartcl{%
  \section*{\listfixmename%
    \@mkboth{\listfixmename}{\listfixmename}}%
  }
\def\@listoffixmes@posttoc@scrartcl{}
\def\l@fixme@scrartcl{\@dottedtocline{1}{1.5em}{2.3em}}

%    \end{macrocode}
% \begin{macro}{\listoffixmes@pretoc@scrreprt}
%   \begin{macro}{\listoffixmes@posttoc@scrreprt}
%     \begin{macro}{\l@fixme@scrreprt}
%       Here's the scrreprt version:
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\def\@listoffixmes@pretoc@scrreprt{%
  \if@twocolumn
    \@restonecoltrue\onecolumn
  \else
    \@restonecolfalse
  \fi
  \chapter*{\listfixmename%
    \@mkboth{\listfixmename}{\listfixmename}}%
  }
\def\@listoffixmes@posttoc@scrreprt{\if@restonecol\twocolumn\fi}
\def\l@fixme@scrreprt{\@dottedtocline{1}{1.5em}{2.3em}}

%    \end{macrocode}
% \begin{macro}{\listoffixmes@pretoc@scrbook}
%   \begin{macro}{\listoffixmes@posttoc@scrbook}
%     \begin{macro}{\l@fixme@scrbook}
%       And here's the scrbook version:
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\def\@listoffixmes@pretoc@scrbook{%
  \if@twocolumn
    \@restonecoltrue\onecolumn
  \else
    \@restonecolfalse
  \fi
  \chapter*{\listfixmename%
    \@mkboth{\listfixmename}{\listfixmename}}%
  }
\def\@listoffixmes@posttoc@scrbook{\if@restonecol\twocolumn\fi}
\def\l@fixme@scrbook{\@dottedtocline{1}{1.5em}{2.3em}}

%    \end{macrocode}
%
% \subsection{Layout macros}
% \begin{macro}{\FXInline}
%   \begin{macro}{\FXMargin}
%     \begin{macro}{\FXFootnote}
%       The macros to implement different layouts for the fixme notes:
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\newcommand\FXInline[2]{%
  \textbf{#1}: \emph{#2}}
\newcommand\FXMargin[2]{%
  \marginpar{\footnotesize\raggedleft\textbf{#1}: \emph{#2}}}
\newcommand\FXFootnote[2]{%
  \footnote{\textbf{#1}: \emph{#2}}}

%    \end{macrocode}
% \begin{macro}{\fixmeindexname}
%   \begin{macro}{\FXIndex}
%     The macros for index generation:
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\newcommand*\fixmeindexname{}
\newcommand\FXIndex[1]{%
  \index{***@\fixmeindexname:!#1}}

%    \end{macrocode}
% \begin{macro}{\fixmefatalprefix}
% \begin{macro}{\FiXmeInline}
%   \begin{macro}{\FiXmeMargin}
%     \begin{macro}{\FiXmeFootnote}
%       \begin{macro}{\FiXmeUser}
%         \begin{macro}{\FiXmeIndex}
%           \begin{macro}{\FiXmeInfo}
%             \begin{macro}{\FiXmeWarning}
%               Apart from |\fixmefatalprefix|, the following macros are kept
%               only to preserve backward compatibility. They are used only by
%               critical notes and are made to call the new versions by
%               default:
%             \end{macro}
%           \end{macro}
%         \end{macro}
%       \end{macro}
%     \end{macro}
%   \end{macro}
% \end{macro}
% \end{macro}
%    \begin{macrocode}
\newcommand*\fixmefatalprefix{}
\newcommand\FiXmeInline[1]{\FXInline{\fixmefatalprefix}{#1}}
\newcommand\FiXmeMargin[1]{\FXMargin{\fixmefatalprefix}{#1}}
\newcommand\FiXmeFootnote[1]{\FXFootnote{\fixmefatalprefix}{#1}}
\newcommand\FiXmeUser[1]{}
\let\FiXmeUser\empty

\newcommand\FiXmeIndex[1]{\FXIndex{#1}}
\newcommand\FiXmeInfo[1]{}
\newcommand\FiXmeWarning[1]{}

%    \end{macrocode}
% Booleans that control which layouts are selected:
%    \begin{macrocode}
\newif\iffixme@inline
\newif\iffixme@margin
\newif\iffixme@footnote
\newif\iffixme@user
\newif\iffixme@index

%    \end{macrocode}
% \begin{macro}{\fixme@text}
%   This macro implements the common (textual) part of all notes:
% \end{macro}
%    \begin{macrocode}
\def\fixme@text#1#2{%
  \iffixme@inline\FXInline{#1}{#2}\fi%
  \iffixme@margin\FXMargin{#1}{#2}\fi%
  \iffixme@footnote\FXFootnote{#1}{#2}\fi%
  \iffixme@user\FXUser{#1}{#2}\fi}

%    \end{macrocode}
% Options that control which layouts are selected:
%    \begin{macrocode}
\DeclareOption{inline}{\fixme@inlinetrue}
\DeclareOption{noinline}{\fixme@inlinefalse}
\DeclareOption{margin}{\fixme@margintrue}
\DeclareOption{nomargin}{\fixme@marginfalse}
\DeclareOption{footnote}{\fixme@footnotetrue}
\DeclareOption{nofootnote}{\fixme@footnotefalse}
\DeclareOption{user}{\fixme@usertrue}
\DeclareOption{nouser}{\fixme@userfalse}
\DeclareOption{index}{\fixme@indextrue}
\DeclareOption{noindex}{\fixme@indexfalse}

%    \end{macrocode}
% The following options are here for backward compatibility, but are not used
% anymore:
%    \begin{macrocode}
\DeclareOption{info}{}
\DeclareOption{noinfo}{}
\DeclareOption{warning}{}
\DeclareOption{nowarning}{}

%    \end{macrocode}
%
% \subsection{Logging macros}
% \begin{macro}{\FXNote}
%   \begin{macro}{\FXWarning}
%     \begin{macro}{\FXerror}
%       \begin{macro}{\FXFatal}
%         The macros forcontrolling logging (log file and terminal output):
%       \end{macro}
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\newcommand\FXNote[1]{%
  \GenericInfo{%
    (FiXme)\@spaces\@spaces\@spaces\@spaces}{%
    Package FiXme Note: `#1'}}
\newcommand\FXWarning[1]{%
  \PackageWarning{FiXme}{`#1'}}
\newcommand\FXError[1]{%
  \GenericWarning{%
    (FiXme)\@spaces\@spaces\@spaces\@spaces}{%
    Package FiXme Error: `#1'}}
\newcommand\FXFatal[1]{%
  \GenericWarning{%
    (FiXme)\@spaces\@spaces\@spaces\@spaces}{%
    Package FiXme: `#1'}}

%    \end{macrocode}
% Boolean that control wether to stay silent or not:
%    \begin{macrocode}
\newif\iffixme@silent

%    \end{macrocode}
%% Options that control whether to be silent or not:
%    \begin{macrocode}
\DeclareOption{silent}{\fixme@silenttrue}
\DeclareOption{nosilent}{\fixme@silentfalse}

%    \end{macrocode}
%
% \subsection{\fixme{} notes}
% Here are the counters:
% \DescribeMacro{\thefixmecount}
% \DescribeMacro{\thefixmenotecount}
% \DescribeMacro{\thefixmewarningcount}
% \DescribeMacro{\thefixmeerrorcount}
% \DescribeMacro{\thefixmefatalcount}
%    \begin{macrocode}
\newcounter{fixmecount}
\newcounter{fixmenotecount}
\newcounter{fixmewarningcount}
\newcounter{fixmeerrorcount}
\newcounter{fixmefatalcount}

%    \end{macrocode}
% \begin{macro}{\fixmenoteprefix}
%   \begin{macro}{\fixmenoteindexname}
%     \begin{macro}{\fixme@note@draft}
%       \begin{macro}{\fixme@note@final}
%         The different flavors of fixme notes. Proper definitions will be
%         selected by the |draft| or |final| options. Let's start with the
%         note notes:
%       \end{macro}
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\newcommand*\fixmenoteprefix{}
\newcommand*\fixmenoteindexname{}
\def\fixme@note@draft#1{%
  \fixme@text{\fixmenoteprefix}{#1}%
  \iffixme@index\FXIndex{\fixmenoteindexname\thefixmenotecount: #1}\fi%
  \iffixme@silent\else\FXNote{#1}\fi%
  \addcontentsline{lox}{fixme}{\fixmenoteprefix: #1}}
\def\fixme@note@final#1{%
  \iffixme@silent\else\FXNote{#1}\fi%
  \addcontentsline{lox}{fixme}{\fixmenoteprefix: #1}}

%    \end{macrocode}
% \begin{macro}{\fixmewarningprefix}
%   \begin{macro}{\fixmewarningindexname}
%     \begin{macro}{\fixme@warning@draft}
%       \begin{macro}{\fixme@warning@final}
%         Here are the warnings notes:
%       \end{macro}
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\newcommand*\fixmewarningprefix{}
\newcommand*\fixmewarningindexname{}
\def\fixme@warning@draft#1{%
  \fixme@text{\fixmewarningprefix}{#1}%
  \iffixme@index\FXIndex{\fixmewarningindexname\thefixmewarningcount: #1}\fi%
  \iffixme@silent\else\FXWarning{#1}\fi%
  \addcontentsline{lox}{fixme}{\fixmewarningprefix: #1}}
\def\fixme@warning@final#1{%
  \iffixme@silent\else\FXWarning{#1}\fi%
  \addcontentsline{lox}{fixme}{\fixmewarningprefix: #1}}

%    \end{macrocode}
% \begin{macro}{\fixmeerrorprefix}
%   \begin{macro}{\fixmeerrorindexname}
%     \begin{macro}{\fixme@error@draft}
%       \begin{macro}{\fixme@error@final}
%         Here are the errors notes:
%       \end{macro}
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\newcommand*\fixmeerrorprefix{}
\newcommand*\fixmeerrorindexname{}
\def\fixme@error@draft#1{%
  \fixme@text{\fixmeerrorprefix}{#1}%
  \iffixme@index\FXIndex{\fixmeerrorindexname\thefixmeerrorcount: #1}\fi%
  \iffixme@silent\else\FXError{#1}\fi%
  \addcontentsline{lox}{fixme}{\fixmeerrorprefix: #1}}
\def\fixme@error@final#1{%
  \iffixme@silent\else\FXError{#1}\fi%
  \addcontentsline{lox}{fixme}{\fixmeerrorprefix: #1}}

%    \end{macrocode}
% \begin{macro}{\fixmefatalindexname}
%   \begin{macro}{\fixme@fatal@draft}
%     \begin{macro}{\fixme@fatal@final}
%       And here are the fatal ones:
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\newcommand*\fixmefatalindexname{}
\def\fixme@fatal@draft#1{%
  \iffixme@inline\FiXmeInline{#1}\fi%
  \iffixme@margin\FiXmeMargin{#1}\fi%
  \iffixme@footnote\FiXmeFootnote{#1}\fi%
  \iffixme@user\FiXmeUser{#1}\fi%
  \iffixme@index\FiXmeIndex{%
    \fixmefatalindexname\thefixmefatalcount: #1}\fi%
  \iffixme@silent\else\FXFatal{#1}\fi%
  \addcontentsline{lox}{fixme}{\fixmefatalprefix: #1}}
\def\fixme@fatal@final#1{%
  \PackageError{FiXme}{`#1' fixme left in final version}{%
    You are processing your document in final mode,\MessageBreak
    but you still have some critical FiXme's left behind.\MessageBreak
    Type X to quit, fix your document, and rerun LaTeX.}}

%    \end{macrocode}
% \begin{macro}{\@fixme}
%   \begin{macro}{\fxnote}
%     \begin{macro}{\fxwarning}
%       \begin{macro}{\fxerror}
%         \begin{macro}{\fixme}
%           Here are the notes insertion macros. The different versions are
%           |\let| to the draft of final flavors defined above by the
%           \texttt{draft} or \texttt{final} options.
%         \end{macro}
%       \end{macro}
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\def\@@fixme#1#2{%
  \stepcounter{fixmecount}%
  \stepcounter{fixme#1count}%
  \csname fixme@#1\endcsname{#2}}
\def\@fixme#1[#2]#3{%
  \bgroup%
  \fixme@inlinefalse%
  \fixme@marginfalse%
  \fixme@footnotefalse%
  \fixme@userfalse%
  \fixme@indexfalse%
  \@for\fixme@option:=#2\do{%
    \expandafter\ifx\csname fixme@\fixme@option true\endcsname\relax
      \PackageError{FiXme}{Unknown layout option `\fixme@option'}{%
        You have given an invalid option to \string\fixme, %
        or an \string\fx command.\MessageBreak
        Valid options are `inline', `margin', `footnote' and `index'.%
        \MessageBreak
        Type X to quit, fix your document, and rerun LaTeX.}%
      \else%
      \csname fixme@\fixme@option true\endcsname%
    \fi}%
  \@@fixme{#1}{#3}%
  \egroup}
\newcommand\fxnote{\@ifnextchar[%]
  {\@fixme{note}}{\@@fixme{note}}}
\newcommand\fxwarning{\@ifnextchar[%]
  {\@fixme{warning}}{\@@fixme{warning}}}
\newcommand\fxerror{\@ifnextchar[%]
  {\@fixme{error}}{\@@fixme{error}}}
\newcommand\fixme{\@ifnextchar[%]
  {\@fixme{fatal}}{\@@fixme{fatal}}}

%    \end{macrocode}
%
% \subsection{\fixme{} environments}
% The \fixme{} environments use the corresponding macro version to handle
% inline (and possibly index) layout, and to perform logging. In final mode,
% verbatim's \texttt{comment} environment is used to suppress output.
%    \begin{macrocode}
\newcommand\FXEnvBegin{\begin{quotation}}
\newcommand\FXEnvEnd{\end{quotation}}

\def\@fxenvbegin@draft#1#2{%
  \FXEnvBegin
  \edef\fixme@args{inline\iffixme@index,index\fi}%
  \csname#1\endcsname[\fixme@args]{#2}}
\def\@fxenvbegin@final#1#2{
  \edef\fixme@args{inline\iffixme@index,index\fi}%
  \csname#1\endcsname[\fixme@args]{#2}
  \comment
}

\def\@fxenvend@draft{\FXEnvEnd}
\def\@fxenvend@final{\endcomment}

\newenvironment{anfxnote}[1][]{%
  \@fxenvbegin{fxnote}{#1}}{%
  \@fxenvend}
\newenvironment{anfxwarning}[1][]{%
  \@fxenvbegin{fxwarning}{#1}}{%
  \@fxenvend}
\newenvironment{anfxerror}[1][]{%
  \@fxenvbegin{fxerror}{#1}}{%
  \@fxenvend}
\newenvironment{afixme}[1][]{%
  \@fxenvbegin{fixme}{#1}}{%
  \@fxenvend}

%    \end{macrocode}
%
% \subsection{Language processing}
% Options that control which language is selected:
%    \begin{macrocode}
\DeclareOption{english}{%
  \renewcommand*\fixmenoteprefix{\fixmelogo\nobreakspace Note}
  \renewcommand*\fixmewarningprefix{\fixmelogo\nobreakspace Warning}
  \renewcommand*\fixmeerrorprefix{\fixmelogo\nobreakspace Error}
  \renewcommand*\fixmefatalprefix{\fixmelogo}
  \renewcommand*\fixmeindexname{\fixmelogo}
  \renewcommand*\fixmenoteindexname{**a@Notes:!}
  \renewcommand*\fixmewarningindexname{**b@Warnings:!}
  \renewcommand*\fixmeerrorindexname{**c@Errors:!}
  \renewcommand*\fixmefatalindexname{}
  \renewcommand*{\listfixmename}{List of Corrections}}
\DeclareOption{french}{%
  \renewcommand*\fixmenoteprefix{\fixmelogo\nobreakspace Note}
  \renewcommand*\fixmewarningprefix{\fixmelogo\nobreakspace Attention}
  \renewcommand*\fixmeerrorprefix{\fixmelogo\nobreakspace Erreur}
  \renewcommand*\fixmefatalprefix{\fixmelogo}
  \renewcommand*\fixmeindexname{\fixmelogo}
  \renewcommand*\fixmenoteindexname{**a@Notes:!}
  \renewcommand*\fixmewarningindexname{**b@Avertissements:!}
  \renewcommand*\fixmeerrorindexname{**c@Erreurs:!}
  \renewcommand*\fixmefatalindexname{}
  \renewcommand*{\listfixmename}{Liste des Corrections}}
\DeclareOption{francais}{\ExecuteOptions{french}}
\DeclareOption{spanish}{%
  \renewcommand*\fixmenoteprefix{\fixmelogo\nobreakspace Nota}
  \renewcommand*\fixmewarningprefix{\fixmelogo\nobreakspace Aviso}
  \renewcommand*\fixmeerrorprefix{\fixmelogo\nobreakspace Error}
  \renewcommand*\fixmefatalprefix{\fixmelogo}
  \renewcommand*\fixmeindexname{\fixmelogo}
  \renewcommand*\fixmenoteindexname{**a@Notas:!}
  \renewcommand*\fixmewarningindexname{**b@Avisos:!}
  \renewcommand*\fixmeerrorindexname{**c@Errores:!}
  \renewcommand*\fixmefatalindexname{}
  \renewcommand*{\listfixmename}{Lista de Correcciones}}
\DeclareOption{italian}{%
  \renewcommand*\fixmenoteprefix{\fixmelogo\nobreakspace Nota}
  \renewcommand*\fixmewarningprefix{\fixmelogo\nobreakspace Avviso}
  \renewcommand*\fixmeerrorprefix{\fixmelogo\nobreakspace Errore}
  \renewcommand*\fixmefatalprefix{\fixmelogo}
  \renewcommand*\fixmeindexname{\fixmelogo}
  \renewcommand*\fixmenoteindexname{**a@Note:!}
  \renewcommand*\fixmewarningindexname{**b@Avvisi:!}
  \renewcommand*\fixmeerrorindexname{**c@Errori:!}
  \renewcommand*\fixmefatalindexname{}
  \renewcommand*{\listfixmename}{Corrigenda}}
\DeclareOption{german}{%
  \renewcommand*\fixmenoteprefix{\fixmelogo\nobreakspace Anm}
  \renewcommand*\fixmewarningprefix{\fixmelogo\nobreakspace Warnung}
  \renewcommand*\fixmeerrorprefix{\fixmelogo\nobreakspace Fehler}
  \renewcommand*\fixmefatalprefix{\fixmelogo}
  \renewcommand*\fixmeindexname{\fixmelogo}
  \renewcommand*\fixmenoteindexname{**a@Anmerkungen:!}
  \renewcommand*\fixmewarningindexname{**b@Warnungen:!}
  \renewcommand*\fixmeerrorindexname{**c@Fehler:!}
  \renewcommand*\fixmefatalindexname{}
  \renewcommand*{\listfixmename}{Verzeichnis der Korrekturen}}
\DeclareOption{ngerman}{%
  \ExecuteOptions{german}}
\DeclareOption{danish}{%
  \renewcommand*\fixmenoteprefix{\fixmelogo\nobreakspace Note}
  \renewcommand*\fixmewarningprefix{\fixmelogo\nobreakspace Advarsel}
  \renewcommand*\fixmeerrorprefix{\fixmelogo\nobreakspace Fejl}
  \renewcommand*\fixmefatalprefix{\fixmelogo}
  \renewcommand*\fixmeindexname{\fixmelogo}
  \renewcommand*\fixmenoteindexname{**a@Noter:!}
  \renewcommand*\fixmewarningindexname{**b@Advarsler:!}
  \renewcommand*\fixmeerrorindexname{**c@Fejl:!}
  \renewcommand*\fixmefatalindexname{}
  \renewcommand*{\listfixmename}{Rettelser}}

%    \end{macrocode}
%
% \subsection{Document status processing}
% \begin{macro}{\fixme@note}
%   \begin{macro}{\fixme@warning}
%     \begin{macro}{\fixme@error}
%       Here's where the draft or final version of the internal macros are
%       selected.
%     \end{macro}
%   \end{macro}
% \end{macro}
%    \begin{macrocode}
\DeclareOption{final}{
  \let\fixme@note\fixme@note@final
  \let\fixme@warning\fixme@warning@final
  \let\fixme@error\fixme@error@final
  \let\fixme@fatal\fixme@fatal@final
  \let\@fxenvbegin\@fxenvbegin@final
  \let\@fxenvend\@fxenvend@final
  \let\listoffixmes\listoffixmes@final
  }

\DeclareOption{draft}{
  \let\fixme@note\fixme@note@draft
  \let\fixme@warning\fixme@warning@draft
  \let\fixme@error\fixme@error@draft
  \let\fixme@fatal\fixme@fatal@draft
  \let\@fxenvbegin\@fxenvbegin@draft
  \let\@fxenvend\@fxenvend@draft
  \let\listoffixmes\listoffixmes@draft
  \@ifclassloaded{article}{
    \let\@listoffixmes@pretoc\@listoffixmes@pretoc@article
    \let\@listoffixmes@posttoc\@listoffixmes@posttoc@article
    \let\l@fixme\l@fixme@article}{
    \@ifclassloaded{report}{
      \let\@listoffixmes@pretoc\@listoffixmes@pretoc@report
      \let\@listoffixmes@posttoc\@listoffixmes@posttoc@report
      \let\l@fixme\l@fixme@report}{
      \@ifclassloaded{book}{
        \let\@listoffixmes@pretoc\@listoffixmes@pretoc@book
        \let\@listoffixmes@posttoc\@listoffixmes@posttoc@book
        \let\l@fixme\l@fixme@book}{
        \@ifclassloaded{scrartcl}{
          \let\@listoffixmes@pretoc\@listoffixmes@pretoc@scrartcl
          \let\@listoffixmes@posttoc\@listoffixmes@posttoc@scrartcl
          \let\l@fixme\l@fixme@scrartcl}{
          \@ifclassloaded{scrreprt}{
            \let\@listoffixmes@pretoc\@listoffixmes@pretoc@scrreprt
            \let\@listoffixmes@posttoc\@listoffixmes@posttoc@scrreprt
            \let\l@fixme\l@fixme@scrreprt}{
            \@ifclassloaded{scrbook}{
              \let\@listoffixmes@pretoc\@listoffixmes@pretoc@scrbook
              \let\@listoffixmes@posttoc\@listoffixmes@posttoc@scrbook
              \let\l@fixme\l@fixme@scrbook}{
              %% Use the article layout by default.
              \let\@listoffixmes@pretoc\@listoffixmes@pretoc@article
              \let\@listoffixmes@posttoc\@listoffixmes@posttoc@article
              \let\l@fixme\l@fixme@article}
            }
          }
        }
      }
    }
  }

%    \end{macrocode}
% Put us in \texttt{english} and \texttt{final} mode, and enable the marginal
% notes.
%    \begin{macrocode}
\ExecuteOptions{english,final,margin,nosilent}
\ProcessOptions*

%    \end{macrocode}
% Finally, ensure backward compatibility for |\fixme| with |\FiXmeUser|, and
% output a summary giving the number of fixme notes at the end of the
% compilation:
%    \begin{macrocode}
\AtBeginDocument{%
  \ifx\FiXmeUser\empty
    \renewcommand\FiXmeUser[1]{\FXUser{\fixmefatalprefix}{#1}}
  \fi}

\AtEndDocument{%
  \GenericWarning{%
    (FiXme)\@spaces\@spaces\@spaces\@spaces
  }{%
    Package FiXme Summary: Number of notes: \thefixmenotecount,\MessageBreak%
    Number of warnings: \thefixmewarningcount,\MessageBreak%
    Number of errors: \thefixmeerrorcount,\MessageBreak%
    Number of fatal errors: \thefixmefatalcount,\MessageBreak%
    Total: \thefixmecount\@gobble%
  }}
%    \end{macrocode}
%
% ^^A \PrintChanges
% ^^A \PrintIndex
% \Finale
%
% ^^A fixme.dtx ends here.