summaryrefslogtreecommitdiff
path: root/support/latex2man/latex2man.tex
blob: cc4a1e436caa933b453fc96a63a01111aa3c9738 (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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Project:     Documentation Tools
%% Descr:       Latex -->  MAN-page (groff -man), LATEX documentation
%% Author:      Dr. Jürgen Vollmer, Juergen.Vollmer@informatik-vollmer.de
%% $Id: latex2man.tex,v 1.203 2018/11/25 13:05:37 vollmer Exp $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Latex2man is a tool to translate UNIX manual pages written with LaTeX into a
%% format understood by the UNIX man(1)-command.
%% Alternatively HTML or TexInfo code can be produced too.
%% Output of parts of the text may be supressed using the conditional text
%% feature.
%%
%% There is LaTeX package (latex2man.sty) used for writing the Man-page
%% and a PERL script (latex2man) doing the actual translation.
%%
%% Copyright (C) 1998, Dr. Juergen Vollmer
%%                     Am Rennbuckel 21, D-76185 Karlsruhe, Germany
%%                     Juergen.Vollmer@informatik-vollmer.de
%% License:
%%   This program can be redistributed and/or modified under the terms
%%   of the LaTeX Project Public License Distributed from CTAN
%%   archives in directory macros/latex/base/lppl.txt; either
%%   version 1 of the License, or any later version.
%%
%% If you find this software useful, please send me a postcard.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[a4paper,english]{article}
\usepackage{a4wide}
\usepackage[latin1]{inputenc}
\usepackage{babel}
\usepackage{verbatim}

%% do we have the `hyperref package?
\IfFileExists{hyperref.sty}{
   \usepackage[bookmarksopen,bookmarksnumbered]{hyperref}
}{}

%% do we have the `fancyhdr' package?
\IfFileExists{fancyhdr.sty}{
\usepackage[fancyhdr]{latex2man}
}{
%% do we have the `fancyheadings' package?
\IfFileExists{fancyheadings.sty}{
\usepackage[fancy]{latex2man}
}{
\usepackage[nofancy]{latex2man}
\message{no fancyhdr or fancyheadings package present, discard it}
}}

%% do we have the `rcsinfo' package?
\IfFileExists{rcsinfo.sty}{
\usepackage[nofancy]{rcsinfo}
\rcsInfo $Id: latex2man.tex,v 1.203 2018/11/25 13:05:37 vollmer Exp $
\setDate{\rcsInfoLongDate}
}{
\setDate{2018/11/25}    %%%% must be manually set, if rcsinfo is not present
\message{package rcsinfo not present, discard it}
}

\setVersionWord{Version:}  %%% that's the default, no need to set it.
\setVersion{1.29}

\begin{document}

\begin{Name}{1}{latex2man}{Dr.~J{\"u}rgen Vollmer}{Documentation Tools}{\LaTeX2man\\--\\ A Documentation Tool}

  \Prog{Latex2man} is a tool to translate UNIX manual pages written with
  \LaTeX\ into a format understood by the UNIX \Cmd{man}{1}-command.
  Alternatively HTML, TexInfo, or \LaTeX\ code can be produced too.
  Output of parts of the text may be suppressed using the conditional text
  feature (for this, LaTeX generation may be used).
\end{Name}

\section{Synopsis}
%%%%%%%%%%%%%%%%%%

\Prog{latex2man} \oOptArg{-t}{transfile}
                 \oOptArg{-c}{CSSfile}
                 \oOpt{-HMTL} \oOpt{-h} \oOpt{-V} \oOptArg{-C}{name} \TEXIbr
                 \oOptArg{-a}{char}
                 \Arg{infile}
                 \Arg{outfile}

\section{Description}
%%%%%%%%%%%%%%%%%%%%%
\Prog{Latex2man} reads the file \Arg{infile} and writes \Arg{outfile}. The
input must be a \LaTeX\ document using the \Prog{latex2man} \LaTeX\ package.
\Prog{Latex2man} translates that document into the \Cmd{troff}{1} format using
the \Opt{-man} macro package.

Using the \Opt{-H} option, HTML code can be produced, instead of
\Cmd{troff}{1}.
With this option you can, optionally, specify a \Arg{CSSfile} as an argument.
CSS (Cascading Style Sheets) allows you to control the appearance of the resulting HTML page.
See below for the names of CSS classes that are included in the HTML tags as attributes.

Using the \Opt{-T} option, TexInfo code can be produced, instead of
\Cmd{troff}{1}.

Using the \Opt{-M} option, \Cmd{troff}{1} input is produced.

Using the \Opt{-L} option, \LaTeX\ ouput can be produced, instead of
\Cmd{troff}{1}.


\section{Options}
%%%%%%%%%%%%%%%%%
\begin{Description}[\OptArg{-t}{transfile}]\setlength{\itemsep}{0cm}
\item[\OptArg{-t}{transfile}] Translation for user defined \LaTeX\ macros.
\item[\OptArg{-c}{CSSfile}]  If you use the \Opt{-H} you can also specify a file that contains CSS
     style sheets. The link to the CSS file is inserted into the generatedHTML output using the
     specified \Arg{CSSfile} filename.
\item[\Opt{-M}] Produce output suitable for the \Cmd{man}{1} command (default).
\item[\Opt{-H}] Instead of producing output suitable for the \Cmd{man}{1}
     command, HTML code is produced (despite the name of the command).
\item[\Opt{-T}] Instead of producing output suitable for the \Cmd{man}{1}
     command, TexInfo code is produced (despite the name of the command).  The
     generated \File{.texi}-file may be processed with \Cmd{makeinfo}{1}
     (to produce an \File{.info}-file) which in turn may be installed using
     \Cmd{install-info}{1}.  The Info tags \verb+@dircategory+ and
     \verb+@direntry+ are provided.
\item[\Opt{-L}] The \LaTeX\ source is written to the \Arg{outfile}. This is
     useful in conjunction with the \OptArg{-C}{name} option.
\item[\OptArg{-C}{name}] Output the conditional text for \Arg{name}.  If more
     than one name should be given use quotes: \OptArg{-C}{'name1 name2 ...'}\\
     The following names are defined automatically:
     \begin{itemize}
        \item \Opt{-H} defines \texttt{HTML}
        \item \Opt{-T} defines \texttt{TEXI}
        \item \Opt{-M} defines \texttt{MAN}
        \item \Opt{-L} defines \texttt{LATEX}
     \end{itemize}
 \item[\OptArg{-a}{char}] Is used only in conjunction with -T.\\
     Background:\\
     TexInfo ignores all blanks before the first word on a new line. In order
     to produce some additional space before that word (using \Bs SP) some
     character has to be printed before the additional space. By default this
     is a . (dot).  The \Arg{char} specifies an alternative for that first
     character.  Giving a blank to
     \Opt{-a} supresses the indentation of a line.\\
     Note: only for the first \Bs SP of a series that \Arg{char} is printed.
\item[\Opt{-h}] Show a help text.
\item[\Opt{-V}] Show version information.
\end{Description}

\section{Files}
%%%%%%%%%%%%%%%

\begin{Description}\setlength{\itemsep}{0cm}
\item[\File{latex2man.tex}] The \LaTeX\ file containing this Man-page.
\item[\File{latex2man.inc}] A file read with \verb+\input{..}+ .
\item[\File{latex2man.sty}] The \LaTeX\ package defining the environments and
     commands.
\item[\File{latex2man.cfg}] The configuration file for \Prog{Latex2man}
     \LaTeX-package.
\item[\File{latex2man.css}] File containing example CSS definitions.
\item[\File{latex2man.trans}] File containing example translations of user
     defined \LaTeX\ macros.
\item[\File{fancyheadings.sty}] A \LaTeX\ package used to typeset head- and
     foot lines.
\item[\File{fancyhdr.sty}] A \LaTeX\ package used to typeset head- and foot
     lines.
\item[\File{rcsinfo.sty}] A \LaTeX\ package used to extract and use RCS version
     control information in \LaTeX\ documents.

\item[\URL{latex2man.pdf}] The PDF version of this document.
\end{Description}

\section{See Also}
%%%%%%%%%%%%%%%%%%

\LaTeX, TexInfo, \Cmd{troff}{1}, \Cmd{groff}{1}, \Cmd{makeinfo}{1}.

\section{\LaTeX\ commands}
%%%%%%%%%%%%%%%%%%%%%%%%%%

The \LaTeX\ package \texttt{latex2man} is used to write the Man-pages with
\LaTeX.  Since we translate into other text formats, not all \LaTeX\ stuff can
be translated.

\subsection{Package Options}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
The \texttt{latex2man} package accepts the following options:

\begin{description}\setlength{\itemsep}{0cm}
\item[fancy]    use the  \LaTeX\ package \texttt{fancyheadings}.
\item[fancyhdr] use the  \LaTeX\ package \texttt{fancyhdr}.
\item[nofancy] neither the \LaTeX\ package \texttt{fancyheadings} nor
     \texttt{fancyhdr} are used.
\end{description}

The default option may be specified in the file \texttt{latex2man.cfg}.

\subsection{Package Specific Environments}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The following environments are provided by the package:
\begin{description}\setlength{\itemsep}{0cm}
\item[\Bs begin\{Name\}\{chapter\}\{name\}\{author\}\{info\}\{title\} ] The
     \texttt{Name} environment takes five arguments: 1.\ the Man-page chapter,
     2.\ the name of the Man-page, 3.\ the author, 4.\ some short information
     about the tool printed in the footline of the Man-page, and 5.\ a text
     which is used as title, for HTML and \LaTeX\ (it's ignored for output of
     the Man-page or TeXinfo. The \texttt{Name} environment must be the first
     environment in the document. Processing starts with this environment. Any
     text before this is ignored (exception: the \verb+setVersion+ and
     \verb+setDate+ commands).  (Note: all arguments of \Bs begin\{Name\} must
     be written on one line).
\item[\Bs begin\{Table\}\Lbr width\Rbr\{columns\}] The \texttt{Table}
     environment takes two arguments: the first optional one specifies
     a width of the last column, the second one gives the number of columns.
     For example:

     \verb+\begin{Table}[2cm]{3}+            \\
     \verb+ Here & am  & I   \\\hline+  \\
     \verb+  A 1 & A 2 & A 3 1 2 3 4 5 A 3 1 2 3 4 5 \\+        \\
     \verb+  B 1 & B 2 & B 3 \\+        \\
     \verb+\end{Table}+

     will be typeset as:

     \begin{Table}[2cm]{3}
       Here & am  & I   \\\hline
        A 1 & A 2 & A 3 1 2 3 4 5 A 3 1 2 3 4 5\\
        B 1 & B 2 & B 3 \\
     \end{Table}

     If no optional \emph{width} argument is given, all entries are
     typeset left justified.
     The \emph{width} is a length measured absolutly in \emph{cm}.
     Processing with \LaTeX\ a \verb+p{width}+ column is typeset
     as last column. The translation to \Cmd{troff}{1} commands
     results in a \texttt{lw(width)} column specification. Translating
     to HTML and TexInfo ignores the \emph{width} parameter.

     \verb+\hline+ may be used.

     If the Man-page is formatted with \Cmd{troff}{1} and tables are used, the
     \Cmd{tbl}{1} preprocessor should be called, usually by giving
     a \Opt{-t} to the call of \Cmd{troff}{1}. When viewing the generated
     manula page using \Cmd{man}{1}, \Cmd{tbl}{1} is called automatically.
\item[\Bs begin\{Description\}] is the same as \Bs begin\{description\}
\item[\Bs begin\{Description\}\Lbr label\Rbr] is similar to
     \Bs begin\{description\}, but the item labels have at minimum the size
     of the (optional) word \emph{label}. The difference is visible only
     in the DVI and PDF-output, not in the troff, TexInfo or HTML output.
     \begin{description}
     \item[a]   \Bar a \verb+\begin{description}+
     \item[ab]  \Bar ab
     \item[abc] \Bar abc
     \end{description}
     \begin{Description}
     \item[a]  \Bar a \verb+\begin{Description}+
     \item[ab] \Bar ab
     \item[abc]\Bar abc
     \end{Description}
     \begin{Description}[ab]
     \item[a]   \Bar a \verb+\begin{Description}[aa]+
     \item[ab]  \Bar ab
     \item[abc] \Bar abc
     \end{Description}
\end{description}

\subsection{Accepted \LaTeX\ Environments}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The following environments are accepted:
\begin{itemize}\setlength{\itemsep}{0cm}
\item \texttt{description}
\item \texttt{enumerate}
\item \texttt{itemize}
\item \texttt{verbatim}
\item \texttt{center}
\end{itemize}

They may be nested:
\begin{itemize}
\item Itemize and nested center:
     \begin{center}
       A centered line.\\
       Another centered line.
     \end{center}
\item Another item an nested enumerate
     \begin{enumerate}
       \item a
       \item b
     \end{enumerate}
\end{itemize}


\subsection{Package Specific Macros}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The following commands are provided:
\begin{description}\setlength{\itemsep}{0cm}
\item[\Bs Opt\{option\}] Option:  \verb+\Opt{-o}+ will be typeset as \Opt{-o}.
\item[\Bs Arg\{argument\}] Argument: \verb+\Arg{filename}+ will be typeset as
     \Arg{filename}.
\item[\Bs OptArg\{option\}\{argument\}] Option with Argument:\\
     \verb+\OptArg{-o}{filename}+ will be typeset as \OptArg{-o}{filename}.
\item[\Bs OptoArg\{option\}\{argument\}] Option with optional Argument:\\
     \verb+\OptoArg{-o}{filename}+ will be
     typeset as \OptoArg{-o}{filename}.
\item[\Bs oOpt\{option\}] Optional option, e.g.\ \verb+\oOpt{-o}+ will be
     typeset as \oOpt{-o}.
\item[\Bs oArg\{argument\}] Optional argument, e.g.\ \verb+\oArg{filename}+
     will be typeset as \oArg{filename}.
\item[\Bs oOptArg\{option\}\{argument\}] Optional option with argument, e.g.\\
     \verb+\oOptArg{-o}{filename}+ will be typeset as \oOptArg{-o}{filename}.
\item[\Bs oOptoArg\{option\}\{argument\}] Optional option with optional
     argument, e.g.\\
     \verb+\oOptoArg{-o}{filename}+ will be typeset as \oOptoArg{-o}{filename}.
\item[\Bs File\{filename\}] used to typeset filenames, e.g.\
     \verb+\File{filename}+ will be typeset as \File{filename}.
\item[\Bs Prog\{prog\}] used to typeset program names, e.g.\
     \verb+\Prog{latex2man}+ will be typeset as \Prog{latex2man}.
\item[\Bs Cmd\{command\}\{chapter\}] used to typeset references to other
     commands, e.g.\\
     \verb+\Cmd{latex2man}{1}+ will be typeset as \Cmd{latex2man}{1}.
\item[\Bs Bar] is typeset as \Bar.
\item[\Bs Bs] (BackSlash) is typeset as \Bs.
\item[\Bs Tilde] is typeset as a \Tilde.
\item[\Bs Dots] is typeset as \Dots
\item[\Bs Bullet] us typeset as \Bullet.
\item[\Bs setVersion\{..\}] set  \verb+..+ as version information.
\item[\Bs setVersionWord\{..\}] set \verb+..+ for the word \emph{Version:} in
     the footline.\\
     The default is \verb+\setVersionWord{Version:}+.
\item[\Bs Version] returns the version information.
\item[\Bs setDate\{..\}] sets \verb+..+ as date information.
\item[\Bs Date] returns the date information.
\item[\Bs Email\{..\}] use to mark an Email address:\\
        \verb+\Email{Juergen.Vollmer@informatik-vollmer.de}+ is typeset as:\\
        \Email{Juergen.Vollmer@informatik-vollmer.de}.
\item[\Bs URL\{..\}] use to mark an URL:
        \verb+\URL{http://www.foo.de/\Tilde vollmer}+ is typeset as\\
        \URL{http://www.foo.de/\Tilde vollmer}.
\item[\Bs LatexManEnd] the input file is read and processed until reading
        end-of-file or\\
        \verb+\LatexManEnd+ (at the beginning of a line).
        \LaTeX\ ignores this command.
\item[\Bs Lbr, \Bs Rbr] is typeset as \Lbr\ and \Rbr\ (these variants are
        needed only somtimes like in\\
        \verb+\item[FooBar\LBr xx \Lbr]+. Usually \verb+[ ]+ will work.
\item[\Bs LBr, \Bs RBr] is typeset as \LBr\ and \RBr\ (these variants are
        needed when using \{ or \} as arguments to macros.
\item[\Bs Circum] is typeset as \Circum.
\item[\Bs Percent] is typeset as \Percent.
\item[\Bs TEXbr] If processed with \LaTeX\ causes a linebreak (i.e.\ is
     equivalent to \Bs\Bs). In the output of \Prog{latex2man} this macro is
     ignored.
\item[\Bs TEXIbr] If TexInfo output is generated, causes a linebreak (i.e.\ is
     equivalent to \Bs\Bs), otherwise ignored.
\item[\Bs MANbr] If Man-Page output is generated, causes a linebreak (i.e.\ is
     equivalent to \Bs\Bs), otherwise ignored.
\item[\Bs HTMLbr] If HTML output is generated, causes a linebreak (i.e.\ is
     equivalent to \Bs\Bs), otherwise ignored.
\item[\Bs medskip] An empty line.
\item[\Bs SP] Produces some extra space, works also at the beginning of lines.
     The code of the second line looks like:
     \texttt{\Bs SP abc \Bs SP\Bs SP xx\Bs\Bs}:\\
     abc  \SP\SP\SP xx\\
     \SP abc \SP\SP xx\\
     \SP\SP abc \SP xx

     Note: Due to some ``problems'' with TexInfo, the lines starting with
     \texttt{\Bs SP} have a leading . (dot) in the TexInfo output,
     see \OptArg{-a}{char}.
\end{description}

\subsection{Accepted Macros from the rcsinfo Package}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{description}\setlength{\itemsep}{0cm}
\item[\Bs rcsInfo \$Id ...\$] if the \LaTeX\ package \File{rcsinfo} is used,
     this command is used to extract the date of the Man-page.
\item[\Bs rcsInfoLongDate] if the \LaTeX\ package \File{rcsinfo} is used, this
     command is used to typeset the date coded in the \verb+$Id ..$+ string.
\end{description}

\subsection{Accepted \LaTeX\ Macros}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The following standard \LaTeX\ commands are accepted:
\begin{description}\setlength{\itemsep}{0cm}
\item[\Bs section\{..\}] The \texttt{section} macro takes one argument: the
     name of the Man-page section.  Each Man-page consists of several sections.
     Usually there are the following sections in a Man-page: \emph{Name}
     (special handling as environment, c.f.\ above), \emph{Synopsis},
     \emph{Description}, \emph{Options}, \emph{Files}, \emph{See Also},
     \emph{Diagnostics}, \emph{Return Values}, \emph{Bugs}, \emph{Author},
     \emph{version}, etc.

     \emph{Synopsis} must be the first section after the \texttt{Name}
     environment.

     Note: Do not use \LaTeX-macros in section names.
\item[\Bs subsection\{..\}] works as well as
\item[\Bs subsubsection\{..\}] those.
\item[\Bs emph\{..\}] \verb+\emph{example}+ is typeset as \emph{example}.
\item[\Bs textbf\{..\}] \verb+\textbf{example}+ is typeset as \textbf{example}.
\item[\Bs texttt\{..\}]\verb+\texttt{example}+ is typeset as \texttt{example}.
\item[\Bs underline\{..\}]\verb+\underline{example}+ is typeset as
     \underline{example of underline}.
\item[\Bs date\{..\}] uses \verb+..+ as date.
\item[\Bs verb+..+] but only + is allowed as delimiter.
\item[\$$<$\$]  is typeset as $<$.
\item[\$$>$\$]  is typeset as $>$.
\item[\$$<=$\$] is typeset as $<=$.
\item[\$$>=$\$] is typeset as $>=$.
\item[\$$=$\$]  is typeset as $=$.
\item[\$$<>$\$] is typeset as $<>$.
\item[\$\Bs ge\$] is typeset as $\ge$.
\item[\$\Bs le\$] is typeset as $\le$.
\item[\$\Bs leftarrow\$] is typeset as $\leftarrow$.
\item[\$\Bs Leftarrow\$] is typeset as $\Leftarrow$.
\item[\$\Bs rightarrow\$] is typeset as $\rightarrow$.
\item[\$\Bs Rightarrow\$] is typeset as $\Rightarrow$.
\item[\Bs \{] is typeset as \{.
\item[\Bs \}] is typeset as \}.
\item[\Bs \$] is typeset as \$.
\item[\Bs \Dollar] is typeset as \Dollar, should be used inside macro
     arguments.
\item[\Bs \_] is typeset as \_.
\item[\Bs \&] is typeset as \&.
\item[\Bs \#] is typeset as \#.
\item[\Bs \%] is typeset as \%.
\item[\Bs ,] is typeset as smaller blank -\,- (between the two -)
\item[\Bs -]  is used to mark hyphenation in a word.
\item[\Bs \Bs] is typeset as a linebreak or marks the end of a column in the
     \texttt{Table} environment.
\item[\Bs ] (a \Bs\ followed by a blank) is typeset as a blank,
     although it cannot be used at the beginning of a line to make indentation
     (see the \texttt{\Bs SP} command).
\item[\Tilde] is typeset as a blank.
\item[\Bs copyright] is typeset as \copyright.
\item[\Bs noindent]
\item[\Bs hline] inside a \texttt{Table} environment.
\item[\Bs item] inside a \texttt{itemize}, \texttt{enumerate}, or
     \texttt{description} environment.
\item[\Bs today] \today\ (see also the \texttt{rcsinfo} \LaTeX\ package).
\item[\Bs ss,\Bs"a, ...] \Bs ss = \ss, \Bs"a = \"a, \Bs"o = \"o, \Bs"u = \"u,
     \Bs"A = \"A, \Bs"O = \"O, \Bs"U = \"U. It is allowed to surround these
     macros in \{ and \} in all places, even inside other macros, e.g.
     \begin{verbatim}
     \textbf{\"a\"o\"u\"A\"O\"U\ss}
     \textbf{\"a}{\"o}{\"u}{\"A}{\"O}{\"U}{\ss}}
     \textbf{äöüÄÖÜß}
     \end{verbatim}

     \textbf{\"a\"o\"u\"A\"O\"U\ss {\"a}{\"o}{\"u}{\"A}{\"O}{\"U}{\ss} äöüÄÖÜß}

     If these letters are used in their LATIN-1 8-bit coding, they are
     translated into the equivalent letter of the desired output format.
     E.g. \texttt{Ä} becomes \texttt{\&Auml}; in HTML and \texttt{@"A}
     in texinfo.
\item[\Bs input\{..\}] Read and process the given filename.
\end{description}

Please note: the name of the \LaTeX-macros and its arguments must be contained in one line.

\subsection{Conditional Text}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\Prog{latex2man} preprocesses the \LaTeX\ input to allow text to be used
conditionally. A special sort of \LaTeX\ comment is used for that purpose.
\begin{itemize}\setlength{\itemsep}{0cm}
\item \Percent@\Percent\ IF \emph{condition} \Percent@\Percent
\item \Percent@\Percent\ ELSE \Percent@\Percent
\item \Percent@\Percent\ END-IF \Percent@\Percent
\end{itemize}

A line must contain only such a comment and nothing else.  \emph{condition} is
a boolean expression containing ``names'' and operators.  The names given with
the \OptArg{-C}{name} option have the value ``true'', while all other names
occuring in the expression are assumed to be ``false''.  If the evaluation of
the boolean expression results in the value ``true'', the text in the
``then''-part is used and the text in the optional ``else''-part is skipped
(and vice versa).  The \texttt{IF/ELSE/END-IF} may be nested.  As boolean
operators the following are allowed:

\begin{Table}{2}
\Bar\Bar & boolean or   \\
\&\&     & boolean and  \\
!        & negation
\end{Table}

( and ) for grouping are allowed.

\noindent
For example:\\
\Percent@\Percent\ IF abc                    \Percent@\Percent\\
\verb+    +abc set\\
\verb+    +\Percent@\Percent\ IF xyz         \Percent@\Percent\\
\verb+       +xyz set\\
\verb+    +\Percent@\Percent\ ELSE           \Percent@\Percent\\
\verb+       +xyz NOT set\\
\verb+    +\Percent@\Percent\ END-IF         \Percent@\Percent\\
\Percent@\Percent\ ELSE                      \Percent@\Percent\\
\verb+    +abc NOT set\\
\verb+    +\Percent@\Percent\ IF xyz \Bar\Bar\ !XYZ \Percent@\Percent\\
\verb+       +xyz OR !XYZ set\\
\verb+    +\Percent@\Percent\ ELSE           \Percent@\Percent\\
\verb+       +xyz OR !XYZ NOT set\\
\verb+    +\Percent@\Percent\ END-IF         \Percent@\Percent\\
\Percent@\Percent\ END-IF                    \Percent@\Percent

\noindent
Run this manual page through \Prog{latex2man} with e.g.\
\OptArg{-C}{'abc XYZ'} and have a look to the generated output.
(If simply running the \LaTeX-document\ through \LaTeX, all lines are shown in the
.dvi file).\\
%@% IF abc            %@%
   abc set\\
   %@% IF xyz         %@%
       xyz set\\
   %@% ELSE           %@%
       xyz NOT set\\
   %@% END-IF         %@%
%@% ELSE              %@%
    abc NOT set\\
    %@% IF xyz || !XYZ %@%
    xyz OR !XYZ set\\
    %@% ELSE          %@%
    xyz OR !XYZ NOT set
    %@% END-IF        %@%
%@% END-IF            %@%

\noindent
To check the conditional text feature, when \Prog{latex2man} is called with
\begin{description}
\item[\OptArg{-C}{HTML}]  the lines 1a, 2b, 3b, and 4b;
\item[\OptArg{-C}{TEXI}]  the lines 1b, 2a, 3b, and 4b;
\item[\OptArg{-C}{MAN}]   the lines 1b, 2b, 3a, and 4b;
\item[\OptArg{-C}{LATEX}] the lines 1b, 2b, 3b, and 4a;
\item[calling \LaTeX\ without preprocessing] all lines
\end{description}
should be shown:

%@% IF HTML %@%
1a. This text occurs only when viewing the HTML output.

%@% ELSE %@%
1b. The HTML conditional was not set.

%@% END-IF %@%

%@% IF TEXI %@%
2a. This text occurs only when viewing the TEXI output

%@% ELSE %@%
2b. The TEXI conditional was not set.

%@% END-IF %@%

%@% IF MAN %@%
3a. This text occurs only when viewing the MAN output

%@% ELSE %@%
3b. The MAN conditional was not set.

%@% END-IF %@%

%@% IF LATEX %@%
4a. This text occurs only when viewing the LATEX output

%@% ELSE %@%
4b. The LATEX conditional was not set.

%@% END-IF %@%

\subsection{Translation of User Defined Macros}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

The user macro translation file (given by the \oOptArg{-t}{transfile}) contains
\Prog{Perl} commands specifying the translation of \LaTeX\ macros defined by
the user. These macros may have none, one or two arguments. The following code
is expected:

\begin{itemize}\setlength{\itemsep}{0cm}
\item Comments start with a \# up to the end of the line.
\item For a macro \verb+\foo+ with no arguments, the following code must be
     specified:
     \begin{description}\setlength{\itemsep}{0cm}
       \item[Translation to Man-Pages]\TEXbr
            \verb+$manMacro{'foo'}  = '...';+
       \item[Translation to HTML]\TEXbr
            \verb+$htmlMacro{'foo'} = '...';+
       \item[Translation to TexInfo]\TEXbr
            \verb+$texiMacro{'foo'} = '...';+
     \end{description}

     where \verb+...+ is the translation.

\item For a macro \verb+\foo{..}+ with one argument, the following code must be
     specified:
     \begin{description}\setlength{\itemsep}{0cm}
       \item[Translation to Man-Pages]\TEXbr
            \verb+$manMacro1a{'foo'}  = '...';+\\
            \verb+$manMacro1b{'foo'}  = '...';+
       \item[Translation to HTML]\TEXbr
            \verb+$htmlMacro1a{'foo'} = '...';+\\
            \verb+$htmlMacro1b{'foo'} = '...';+

       \item[Translation to TexInfo]\TEXbr
            \verb+$texiMacro1a{'foo'} = '...';+\\
            \verb+$texiMacro1b{'foo'} = '...';+
     \end{description}

     where \verb+...+ is the translation. The \verb+1a+ code is used before the
     argument, while \verb+1b+ is typeset after the argument is set.

\item For a macro \verb+\foo{..}{..}+ with two arguments, the following code
     must be specified:
     \begin{description}\setlength{\itemsep}{0cm}
     \item[Translation to Man-Pages]\TEXbr
          \verb+$manMacro2a{'foo'}  = '...';+\\
          \verb+$manMacro2b{'foo'}  = '...';+\\
          \verb+$manMacro2c{'foo'}  = '...';+
     \item[Translation to HTML]\TEXbr
          \verb+$htmlMacro2a{'foo'} = '...';+\\
          \verb+$htmlMacro2b{'foo'} = '...';+\\
          \verb+$htmlMacro2c{'foo'} = '...';+
     \item[Translation to TexInfo]\TEXbr
          \verb+$texiMacro2a{'foo'} = '...';+\\
          \verb+$texiMacro2b{'foo'} = '...';+\\
          \verb+$texiMacro2c{'foo'} = '...';+
     \end{description}

     where \verb+...+ is the translation. The \verb+2a+ code is used before the
     first argument, \verb+2b+ between the two arguments and \verb+2c+ is
     typeset after the second argument is set.
\item The file \File{latex2man.trans} contains some example code.
\end{itemize}

\subsection{Verbatim Environment}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{verbatim}
This
    {is}
        \texttt{a}
                  $test$
                         _of_
verbatim
<this is no HTML tag> and no @* TexInfo command
\end{verbatim}

\subsection{Subsection works}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

This is a \verb+\subsection+.

\subsubsection{Subsubsection works}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

This is a \verb+\subsubsection+.

\subsubsection{Subsubsection still works}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

This is another \verb+\subsubsection+.


\subsection{General Remarks}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{enumerate}\setlength{\itemsep}{0cm}
\item Empty lines are typeset as paragraph separators.
\item The arguments of the \LaTeX\ commands must not be split over several
     lines.
\item Do not nest calls to macros.
\item Except the mentioned environment and macros, the usage of other \LaTeX\
     environments or macros are not translated. Their usage will cause garbage
     in the output.
\item \Prog{latex2man} requires Perl version $>=$ 5.0004\_03.
\item If you want to install the system with the distributed \File{Makefile},
     you need GNU-\Prog{make}. If you don't have it, you should execute the
     steps shown in the \File{Makefile} manually.
\end{enumerate}

\section{CSS classnames}

     The table below shows the names of CSS classes that will be included in the HTML tags as attributes.
     You can specify the CSS style properties in the \Arg{CSSfile} for these classes:

     \noindent
     \begin{Table}[8.5cm]{3}
       \textbf{HTML tag}  & \textbf{Class}            &  \textbf{Style applies to}\\
       body               &                           & the body of the HTML page \\
       h1                 & titlehead                 & the title at the top of the HTML page specified as an argument to the \emph{Name} environment \\
       h4                 & authorhead                & the author at the top of the HTML page specified as an argument to the \emph{Name} environment \\
       h4                 & datehead                  & the date at the top of the HTML page \\
       h4                 & versionhead               & the man page version at the top of the HTML page specified as an argument to the \emph{setVersion} macro \\
       h2                 & sectionname               & a section title specified as an argument to the \emph{section} macro \\
       h4                 & subsectionname            & a subsection title specified as an argument to the \emph{subsection} macro \\
       h5                 & subsubsectionname         & a subsubsection title specified as an argument to the \emph{subsubsection} macro \\
       font               & progname                  & a program name specified as an argument to the \emph{Prog} macro \\
       font               & filename                  & a file name specified as an argument to the \emph{File} macro \\
       font               & commandname               & a command name specified as an argument to the \emph{Cmd} macro \\
       font               & textstyle                 & all text that is not an argument to some LaTeX or latex2man macro \\
       font               & optstyle                  & a name of an option specified as an argument to the \emph{Opt}, \emph{oOpt}, \emph{OptArg}, \emph{oOptArg} or \emph{oOptoArg} macros   \\
       font               & argstyle                  & a name of an argument specified as an argument to the \emph{Arg}, \emph{oArg}, \emph{OptArg}, \emph{oOptArg} or \emph{oOptoArg} macros   \\
       a, font            & urlstyle                  & a URL specified as an argument to the \emph{URL} macro \\
       a, font            & urlstyle.link             & subclass of urlstyle class \\
       a, font            & urlstyle.visited          & subclass of urlstyle class \\
       a, font            & urlstyle.hover            & subclass of urlstyle class \\
       a, font            & emailstyle                & an email specified as an argument to the \emph{Email} macro \\
       a, font            & emailstyle.link           & subclass of emailstyle class \\
       a, font            & emailstyle.visited        & subclass of emailstyle class \\
       a, font            & emailstyle.hover          & subclass of emailstyle class \\
       table              & tablestyle                & a table specified as a \emph{Table} environment \\
       tr                 & rowstyle                  & a row of a table specified as a \emph{Table} environment \\
       td                 & cellstyle                 & a cell of a table specified as a \emph{Table} environment \\
     \end{Table}

\section{Some Bug Fix Tests}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% TODO: HTML: a blank line after \begin{description} should not emit a <p>
\begin{description}
\item[Leading . and ']
%%%%%%%%%%%%%%%%%%%%%%
Now leading . and ' in generation troff output should work propperly,
since a \verb+\&+ is added. Therfore the \verb+\Dot+ macro has been deleted.\\
Thanks to \Email{Frank.Schilder@Mathematik.Tu-Ilmenau.De}.\\
Testcase 1:
\begin{description}
\item['\Bs n'] ...
\end{description}
Testcase 2:\\
\File{.foobar}
Testcase 3:\\
\Dots

abc \Dots abc . efg ' 123

\item[\% in verbatim] A \% in a \Bs verb and verbatim-environment was not
     emitted correctly.  Thanks to Aleksey Nogin \Email{nogin@cs.caltech.edu}
     for the bug report and bug fix.

\verb+ % abc+

\begin{verbatim}
   % abc %
\end{verbatim}

but ignore comments following this: % this should be ignored

\end{description}

\section{Requirements}
%%%%%%%%%%%%%%%%%%%%%%

\begin{description}\setlength{\itemsep}{0cm}
\item[Perl] \Prog{latex2man} requires Perl version $>=$ 5.0004\_03.
\item[Make] If you want to install the system with the distributed
     \File{Makefile}, you need GNU-\Prog{make}. If you don't have it, you
     should execute the steps shown in the \File{Makefile} manually.
\item[\LaTeX] \LaTeX 2e is required.
\end{description}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\input{latex2man.inc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\section{Version}
%%%%%%%%%%%%%%%%%

Version: \Version\ of \Date.

\section{License and Copyright}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{description}
\item[Copyright] \copyright\ 1998, Dr.~Jürgen Vollmer, Am Rennbuckel 21,
     D-76185 Karlsruhe, Germany,\\
     \Email{Juergen.Vollmer@informatik-vollmer.de}


     The most recent version of  \Prog{Latex2man} may be found on my homepage\\
     \URL{http://www.informatik-vollmer.de/software/latex2man.html}.

\item[License] This program can be redistributed and/or modified under the
     terms of the LaTeX Project Public License Distributed from CTAN archives
     in directory \File{macros/latex/base/lppl.txt}; either version 1 of the
     License, or any later version.

\item[Misc] If you find this software useful, please send me a postcard from
     the place where you are living.
\end{description}

\section{Author}
%%%%%%%%%%%%%%%%

\noindent
Dr.~Jürgen Vollmer                      \\
Am Rennbuckel 21                        \\
D-76185 Karlsruhe                       \\
Email: \Email{Juergen.Vollmer@informatik-vollmer.de}  \\
WWW: \URL{http://www.informatik-vollmer.de}.

\LatexManEnd

\end{document}