diff options
author | Karl Berry <karl@freefriends.org> | 2008-11-13 17:43:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-11-13 17:43:59 +0000 |
commit | 5add2428204d8d6ff589a9679141d288cf421152 (patch) | |
tree | fcc87e4b9c091a2c4d62ea40401b79db218f7e16 /Master/texmf-dist | |
parent | 6ff046c12b6896c6b7ace34d964ace11ef5059ed (diff) |
new support script latex2man
git-svn-id: svn://tug.org/texlive/trunk@11289 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist')
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/CHANGES | 106 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/INSTALL | 49 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/Makefile | 216 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/README | 34 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/THIS-IS-VERSION-1.23 | 1 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/latex2man.1 | 1100 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/latex2man.html | 1160 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/latex2man.pdf | bin | 0 -> 206853 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/latex2man.tex | 758 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/latex2man.texi | 1005 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/latex2man.trans | 67 | ||||
-rw-r--r-- | Master/texmf-dist/doc/support/latex2man/latex2man.txt | 758 | ||||
-rwxr-xr-x | Master/texmf-dist/scripts/latex2man/latex2man | 1817 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/latex2man/latex2man.cfg | 12 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/latex2man/latex2man.sty | 189 |
15 files changed, 7272 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/support/latex2man/CHANGES b/Master/texmf-dist/doc/support/latex2man/CHANGES new file mode 100644 index 00000000000..d7a166dcfda --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/CHANGES @@ -0,0 +1,106 @@ + + Change history of the latex2man package + ======================================= + +$Id: CHANGES,v 1.60 2008/11/11 07:18:18 vollmer Exp $ +1.23 11 Nov 2008 - use /usr/bin/env to locate the perl interpreter + Thanks to "J.R. Mauro" <jrm8005-at-gmail.com> +1.22 05 Dec 2007 - Fixed TROFF code generation if none of -H -T -M -L + is given. +1.21 05 Jul 2007 - Fixed Makefile +1.20 24 Apr 2007 - Added optional parameter to Table-environment + - Fixed generataion of tbl-tables. +1.19 12 Sep 2005 - Thanks to Aleksey Nogin <nogin@cs.caltech.edu> for + his bugfix of the problem he found: + "I came across another issue in the latest + latex2man - if the source file has "\verb+.foo+" in + it, then the ".foo" will be copied to the man page + verbatim and if it happens to be placed on the + beginning of a line, then troff will consider it to + be a command and not display it properly." +1.18 20 July 2005 - latex2man.sty: Removed option pdf. +1.17 14 Oct 2004 - Fixed order of gerating & for HTML + (Thanks to Aleksey Nogin <nogin@cs.caltech.edu>) +1.16 06 Sep 2004 - Fixed handling of % in \verb+..+ and verbatim + environments + (Thanks to Aleksey Nogin <nogin@cs.caltech.edu>) + - added \subsubsection +1.15 12 Dec 2001 - added extra stuff in the headline of man pages + (thanks to Andrew Anderson <aja@emulab.ee.mu.oz.au>) +1.14 18 June 2001 - TROFF generation: fixed handling of leading . and ' + - removed macro \Dot +1.13 08 May 2001 - Added \begin{center} / \end{center}. + - Reimplemented font changing stuff in TROFF + generation (use now troff instead of -man commands). +1.12.3 10 Apr 2001 - Fixed \oOptArg in man output. +1.12.2 12 Mar 2001 - Fixed handling of conditional translation to LaTeX + (if in a IF .. ELSE .. END-IF, the condition + evaluates to true, the ELSE and END-IF are written + to the result file, but not the IF... + Now all %@% directives are written.) +1.12.1 13 Sep 2000 - In \setDate and \setVersion a ~ is replaced by the + output specific blank. +1.12 28 Aug 2000 - Fixed error in htmlVerb (thanks to + Glunz Wolfgang <Wolfgang.Glunz@icn.siemens.de>) + - Fixed error in conditional text handling: + (%@%ELSE%@% was not handled correct). +1.11 25 Aug 2000 - Fixed error in conditional text handling: + (MAN was not enabled by default, when calling + with -M). + - Added eror message, if arguments of \begin{Name}, + \section, and \subsection are not contained on a + single line. +1.10.1 21 Aug 2000 - Better handling of \Tilde. +1.10 13 Jun 2000 - added \Begin{Description}[label] (based on an idea of + Andi Winter <winter@cocolab.de>) + - Thanks to Andi Winter <winter@cocolab.de>: + - fixed: removed wrong line break in date for + TROFF output + - fixed wrong line breaks in some TROFF macros + - fixed wrong output of optional arguments in TROFF + - allow spaces between `\item' and following `[' +1.9.1 20 Mar 2000 - added \OptoArg \oOptoArg Option with optional + argument (Thanks to Andi Winter <winter@cocolab.de>) +1.9 13 Mar 2000 - latex2man.sty: Added option pdf. + latex2man: define names HTML TEXI MAN LATEX + automatically. +1.8 11 Feb 2000 - Added verbatim environment (many thanks to + "Olaf Maibaum" <Maibaum@Informatik.Uni-Oldenburg.DE> + who provided me the troff generation code) + - Added better handling of german Umlaut + - Fixed minor HTML tag mismatch. +1.7.1 17 Nov 1999 - Fixed END_IF handling of -L option. +1.7 25 July 1999 - Allow german Umlaute to be written as \"a, etc. +1.6.4 30 May 1999 - Added fix of Frank.Schilder@Mathematik.TU-Ilmenau.DE + line 418: from + if ($manRS == 0 && $list_nest > 0) { + to + if ($manRS == 0 && $list_nest > 1) { + line 471: from + + # manParagraph; + to + manParagraph; +1.6.3 25 Mar 1999 - Added \, Math stuff is matched now after macro + arguments +1.6.2 21 Nov 1998 - Added \LBr / \RBr, added \setlength{}{} and \itemsep + \Dollar $\ge$, $\le$, $\leftarrow$, $\Leftarrow$, + $\rightarrow$, $\Rightarrow$. +1.6.1 14 Sep 1998 - Added $<=$, $>=$, $=$ $<>$. +1.6 08 Sep 1998 - Added \SP macro. + - Hyphenation \- is translated for TexInfo into @-. + - Runs now under older Versions of Perl (e.g. 5.03). +1.5 22 Aug 1998 - Support for the fanyhdr package, added latex2man.cfg + - Now \% and \- work. +1.4 23 July 1998 - Fixed typos. + - Fixed generated HTML + The following is wrong: <a ..> <h..>....</h..></a> + Correct is: <h..><a ..>...</a></h..> +1.3 03 June 1998 - Add conditional text feature +1.2 18 Jan 1998 - Enumerate/itemize/description environments may + be nested now. + - Output specific line break macros. +1.1 14 Jan 1998 - Fixed bug in HTML generation (no blanks emited + after \hline) +1.0 11 Jan 1998 - Initial version + diff --git a/Master/texmf-dist/doc/support/latex2man/INSTALL b/Master/texmf-dist/doc/support/latex2man/INSTALL new file mode 100644 index 00000000000..f87b88d66f7 --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/INSTALL @@ -0,0 +1,49 @@ +How to install latex2man: + +Requirements: + - Latex2man requires Perl version >= 5.0004_03. + - LaTeX2e + - If you want to install the system with the distributed Makefile, you need + GNU-make. If you don't have it, you should execute the steps shown + in the Makefile manually. + +Installation: + - Edit the Makefile and set + BIN_DIR = $(HOME)/bin + MAN_DIR = $(HOME)/man + HTML_DIR = $(HOME)/public_html + INFO_DIR = $(HOME)/info + TEX_DIR = $(HOME)/tex/inputs + CFG_DIR = $(HOME)/tex/inputs + to your needs + - If you do not have pdflatex installed, remove in the "all" goal, + the sub goal "$(BASE).pdf". + - Edit latex2man and set in the first line + #!/usr/local/bin/perl + to the correct path + - make install + +That's it. + +The following files should be part of this package: + latex2man/latex2man + latex2man/latex2man.tex + latex2man/latex2man.cfg + latex2man/latex2man.sty + latex2man/latex2man.trans + latex2man/latex2man.1 + latex2man/latex2man.txt + latex2man/latex2man.html + latex2man/latex2man.texi + latex2man/latex2man.info + latex2man/latex2man.pdf + latex2man/Makefile + latex2man/README + latex2man/INSTALL + latex2man/CHANGES + latex2man/THIS-IS-VERSION-x.y + +Juergen + +$Id: INSTALL,v 1.7 2000/03/13 10:25:48 vollmer Entwurf $ + diff --git a/Master/texmf-dist/doc/support/latex2man/Makefile b/Master/texmf-dist/doc/support/latex2man/Makefile new file mode 100644 index 00000000000..f40f285f32b --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/Makefile @@ -0,0 +1,216 @@ +# Project: Documentation Tools +# Descr: Latex --> MAN-page (groff -man), Makefile +# Author: Dr. Jürgen Vollmer, Juergen.Vollmer@informatik-vollmer.de +# $Id: Makefile,v 1.106 2008/11/11 07:17:29 vollmer Exp $ + +BASE = latex2man + +#-------- user configuration section +BIN_DIR = $(HOME)/bin +MAN_DIR = $(HOME)/man +HTML_DIR = $(HOME)/public_html +INFO_DIR = $(HOME)/info +TEX_DIR = $(HOME)/tex/inputs +CFG_DIR = $(HOME)/tex/inputs +#-------- end of user configuration section + +DATE = `date +%Y-%m-%d` +DATE2 = `date +%Y/%m/%d` +TAR_BAK = $(BASE)-$(DATE)-backup.tar.gz +TAR_SRC = $(BASE)-$(DATE)-source.tar.gz +TAR_DIST = $(BASE)-$(VERSION).tar.gz +EX = --exclude "*.o" --exclude core --exclude "*.tar.gz" --exclude "*~" \ + --exclude "*.a" --exclude "*.php" +EXrcs = $(EX) --exclude "*/RCS/*" --exclude "*/RCS" + +VERSION = 1.23 +V_DATE = 2008/11/11 +latex2man = ./latex2man + +D = $ + +HOMEPAGE = $(HOME)/Privat/informatik-vollmer/software + +.PHONY: all clean realclean diff backup src-tar +#.SUFFIXES: .tex .html .ps .info .texi .txt + +all: $(BASE).1 $(BASE).html $(BASE).texi $(BASE).info $(BASE).txt \ + $(BASE).pdf + $(MAKE) clean + +%.ps: %.tex + latex $*.tex + latex $*.tex + dvips -o $*.ps $*.dvi + +%.pdf: %.tex + rm -f /tmp/$*.tex /tmp/$*.pdf /tmp/$*.aux /tmp/$*.toc /tmp/$*.log /tmp/$*.sty + (cp $*.tex $*.sty /tmp && \ + cd /tmp && \ + pdflatex $*.tex && \ + pdflatex $*.tex); + mv /tmp/$*.pdf . + +%.info: %.texi + makeinfo $*.texi + +%.txt: %.1 + groff -t -man -Tlatin1 $*.1 | \ + sed -e 's/.//g' \ + -e 's/7|//g' \ + -e 's/[6-9]//g' \ + -e 's///g' \ + -e 's/$$/- /' > $*.txt + +%.1: %.tex + $(latex2man) -M $*.tex $*.1 + +%.html: %.tex + $(latex2man) -H $*.tex $*.html + +%.texi: %.tex + $(latex2man) -T $*.tex $*.texi + +CHANGES.html: CHANGES + sed -e's/&/\&/g' -e's/>/\>/g' -e's/</\</g' \ + < CHANGES > CHANGES.html + +$(BASE).php: $(BASE).php.src Makefile CHANGES.html + sed < $(BASE).php.src \ + -e "s|@VERSION@|$(VERSION)|g" \ + -e "s|@DATE@|$(V_DATE)|g" \ + -e "/@CHANGELOG@/r CHANGES.html" \ + -e "/^@.*@$$/d" \ + -e "s|$(BASE).src|$(BASE)|g" \ + -e "s|$(D)\(Id: $(BASE),v .*\) $(D)|\1|g" |\ + sed -e "/$(D)Id: CHANGES,v/d" \ + > $(BASE).php + rm -f CHANGES.html + +latex2man-html.php: latex2man.html Makefile + @ (echo '<?php'; \ + echo ' $$prefix = "..";'; \ + echo ' $$logo = "abakus.jpg";'; \ + echo ' $$logo_text = "russischer Abakus";'; \ + echo ' $$language = "en";'; \ + echo ' include "$$prefix/scripts/header.inc"'; \ + echo '?>'; \ + sed < latex2man.html \ + -e "1,/<body*/d" \ + -e "/<h4 align=center>/d" \ + -e "s/ align=center//g" \ + -e "/<\/body>/d" \ + -e "/<\/html>/d"; \ + echo '<?php include "$$prefix/scripts/footer.inc"?>'; \ + ) > latex2man-html.php + +latex2man-text.php: latex2man.txt Makefile + @ (echo '<?php'; \ + echo ' $$prefix = "..";'; \ + echo ' $$logo = "abakus.jpg";'; \ + echo ' $$logo_text = "russischer Abakus";'; \ + echo ' $$langauge = "en";'; \ + echo ' include "$$prefix/scripts/header.inc"'; \ + echo '?>'; \ + echo '<h1>LaTeX2MAN<br><small>plain text / UNIX-man</small></h1>'; \ + echo '<pre'; \ + echo ' style="border-style:ridge;border-width:2px;">'; \ + cat latex2man.txt | \ + sed -e's/&/\&/g' -e's/>/\>/g' -e's/</\</g' ; \ + echo '</pre>'; \ + echo '<?php include "$$prefix/scripts/footer.inc"?>'; \ + ) > latex2man-text.php + +homepage: latex2man.pdf latex2man.txt latex2man.php latex2man-html.php \ + latex2man-text.php latex2man.info + cp -fp $(TAR_DIST) latex2man.pdf latex2man*.php latex2man.info $(HOMEPAGE) + cp -fp CHANGES $(HOMEPAGE)/latex2man-CHANGES + rm -f *.php + +install: realclean all + @echo + @if [ ! -f $(INFO_DIR)/dir ]; \ + then \ + (echo ; \ + echo ""; \ + echo "File: dir Node: Top This is the top of the INFO tree"; \ + echo "* Menu: " ) \ + > $(INFO_DIR)/dir ; \ + fi + cp -f $(BASE) $(BIN_DIR) + cp -f $(BASE).sty $(TEX_DIR) + cp -f $(BASE).cfg $(CFG_DIR) + cp -f $(BASE).1 $(MAN_DIR)/man1 + cp -f $(BASE).html $(HTML_DIR) + cp -f $(BASE).info $(INFO_DIR) + install-info $(BASE).info $(INFO_DIR)/dir + $(MAKE) clean + +uninstall: + rm -f $(BIN_DIR)/$(BASE) + rm -f $(TEX_DIR)/$(BASE).sty + rm -f $(CFG_DIR)/$(BASE).cfg + rm -f $(MAN_DIR)/man1/$(BASE).1 + rm -f $(HTML_DIR)/$(BASE).html + rm -f $(INFO_DIR)/$(BASE).info + - install-info --quiet --remove $(BASE).info $(INFO_DIR)/dir + +src-tar: + $(MAKE) realclean all + @cd ..; tar $(EXrcs) -czvf $(BASE)/$(TAR_SRC) $(BASE) + +dist: + rm -f THIS-IS-VERSION-* + @- co -l latex2man latex2man.tex latex2man.sty README + @rm -f .xxx; cp latex2man .xxx + @sed < .xxx -e 's/$VERSION = .*/$VERSION = "$(VERSION)";/' > latex2man + @rm -f .xxx; cp latex2man.tex .xxx + @sed < .xxx -e 's/^\\setVersion{[0-9]*\(\.[0-9]*\)*}/\\setVersion{$(VERSION)}/' \ + -e 's|^\\setDate{[0-9]*/[0-9]*/[0-9]*}|\\setDate{$(V_DATE)}|' \ + > latex2man.tex + @rm -f .xxx; cp latex2man.sty .xxx + @sed < .xxx -e 's/^%% VERSION:.*/%% VERSION: $(VERSION)/' \ + -e "s|^\(\\\\ProvidesPackage{latex2man}\).*|\1[$(DATE2) v$(VERSION)]|"\ + > latex2man.sty + rm -f .xxx; cp README .xxx + @sed < .xxx -e 's/^VERSION:.*/VERSION: $(VERSION)/' > README + @rm -f .xxx + ci -u -m"Distribution" latex2man latex2man.tex latex2man.sty README + - $(MAKE) realclean all + @echo "VERSION $(VERSION) DATE=$(V_DATE)" > THIS-IS-VERSION-$(VERSION) + @cd ..; tar $(EXrcs) -czvf $(BASE)/$(TAR_DIST) \ + $(BASE)/latex2man \ + $(BASE)/latex2man.tex \ + $(BASE)/latex2man.cfg \ + $(BASE)/latex2man.sty \ + $(BASE)/latex2man.trans \ + $(BASE)/latex2man.1 \ + $(BASE)/latex2man.txt \ + $(BASE)/latex2man.html \ + $(BASE)/latex2man.texi \ + $(BASE)/latex2man.info \ + $(BASE)/latex2man.pdf \ + $(BASE)/Makefile \ + $(BASE)/README \ + $(BASE)/INSTALL \ + $(BASE)/CHANGES \ + $(BASE)/THIS-IS-VERSION-$(VERSION) + +backup: + @ cd ..; tar $(EX) -czvf /tmp/$(TAR_BAK) $(BASE) + @ copy-to-backup -al -d $(BASE) /tmp/$(TAR_BAK) + @ rm /tmp/$(TAR_BAK) + +clean: + rm -f *~ *.aux *.log *.dvi .xxx *.out + +realclean: clean + rm -f *.ps *.1 *.html *.texi *.info *.txt *.pdf + +diff: + @echo + @echo "Check for differences with RCS" + @echo + for i in RCS/* ; do [ -f `basename $$i ,v` ] && rcsdiff -q $$i; done + @echo + diff --git a/Master/texmf-dist/doc/support/latex2man/README b/Master/texmf-dist/doc/support/latex2man/README new file mode 100644 index 00000000000..bd7e9042288 --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/README @@ -0,0 +1,34 @@ + + latex2man + ========= + +Latex2man is a tool to translate UNIX manual pages written with LaTeX into +the troff format understood by the UNIX man(1)-command. +Alternatively HTML, TexInfo, or LaTeX code can be produced too. +Output of parts of the text may be supressed using the conditional text +feature (for this, LaTeX generation may be used). + +There is LaTeX package (latex2man.sty) used for writing the Man-page +and a PERL script (latex2man) doing the actual translation. + +Requirements: + - Latex2man requires Perl version >= 5.0004_03. + - LaTeX2e + +VERSION: 1.23 + +Author and Copyright (c) 1998: + Dr. Jürgen Vollmer + Viktoriastraße 15 + D-76133 Karlsruhe + Email: <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. + +$Id: README,v 1.62 2008/11/11 07:21:18 vollmer Exp $ diff --git a/Master/texmf-dist/doc/support/latex2man/THIS-IS-VERSION-1.23 b/Master/texmf-dist/doc/support/latex2man/THIS-IS-VERSION-1.23 new file mode 100644 index 00000000000..b6307fa0d6e --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/THIS-IS-VERSION-1.23 @@ -0,0 +1 @@ +VERSION 1.23 DATE=2008/11/11 diff --git a/Master/texmf-dist/doc/support/latex2man/latex2man.1 b/Master/texmf-dist/doc/support/latex2man/latex2man.1 new file mode 100644 index 00000000000..587dbf434b8 --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/latex2man.1 @@ -0,0 +1,1100 @@ +'\" t +.\" Manual page created with latex2man on Di 11. Nov 08:21:27 CET 2008 +.\" NOTE: This file is generated, DO NOT EDIT. +.de Vb +.ft CW +.nf +.. +.de Ve +.ft R + +.fi +.. +.TH "LATEX2MAN" "1" "2008/11/11" "Documentation Tools " "Documentation Tools " +.SH NAME + +.PP +Latex2man +is a tool to translate UNIX manual pages written with +LaTeXinto a format understood by the UNIX \fIman\fP(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). +.PP +.SH SYNOPSIS + +.PP +latex2man +[\fB\-t\fP\fItransfile\fP] +[\fB\-HMTL\fP] +[\fB\-h\fP] +[\fB\-V\fP] +[\fB\-C\fP\fIname\fP] +[\fB\-a\fP\fIchar\fP] +\fIinfile\fP +\fIoutfile\fP +.PP +.SH DESCRIPTION + +Latex2man +reads the file \fIinfile\fP +and writes \fIoutfile\fP\&. +The +input must be a LaTeX document using the latex2man +LaTeXpackage. +Latex2man +translates that document into the \fItroff\fP(1) +format using +the \fB\-man\fP +macro package. +.PP +Using the \fB\-H\fP +option, HTML code can be produced, instead of +\fItroff\fP(1)\&. +.PP +Using the \fB\-T\fP +option, TexInfo code can be produced, instead of +\fItroff\fP(1)\&. +.PP +Using the \fB\-M\fP +option, \fItroff\fP(1) +input is produced. +.PP +Using the \fB\-L\fP +option, LaTeX ouput can be produced, instead of +\fItroff\fP(1)\&. +.PP +.SH OPTIONS + +.TP +\fB\-t\fP\fItransfile\fP + Translation for user defined LaTeX macros. +.TP +\fB\-M\fP + Produce output suitable for the \fIman\fP(1) +command (default). +.TP +\fB\-H\fP + Instead of producing output suitable for the \fIman\fP(1) +command, HTML code is produced (despite the name of the command). +.TP +\fB\-T\fP + Instead of producing output suitable for the \fIman\fP(1) +command, TexInfo code is produced (despite the name of the command). The +generated \&.texi\-file +may be processed with \fImakeinfo\fP(1) +(to produce an \&.info\-file) +which in turn may be installed using +\fIinstall\-info\fP(1)\&. +The Info tags @dircategory and +@direntry are provided. +.TP +\fB\-L\fP + The LaTeX source is written to the \fIoutfile\fP\&. +This is +useful in conjunction with the \fB\-C\fP\fIname\fP +option. +.TP +\fB\-C\fP\fIname\fP + Output the conditional text for \fIname\fP\&. +If more +than one name should be given use quotes: \fB\-C\fP\fI\&'name1 name2 ...\&'\fP +.br +The following names are defined automatically: +.RS +.TP +.B * +\fB\-H\fP defines HTML +.TP +.B * +\fB\-T\fP defines TEXI +.TP +.B * +\fB\-M\fP defines MAN +.TP +.B * +\fB\-L\fP defines LATEX +.RE +.RS +.PP +.RE +.TP +\fB\-a\fP\fIchar\fP + Is used only in conjunction with \-T. +.br +Background: +.br +TexInfo ignores all blanks before the first word on a new line. In order +to produce some additional space before that word (using \\SP) some +character has to be printed before the additional space. By default this +is a \&. (dot). The \fIchar\fP +specifies an alternative for that first +character. Giving a blank to +\fB\-a\fP +supresses the indentation of a line. +.br +Note: only for the first \\SP of a series that \fIchar\fP +is printed. +.TP +\fB\-h\fP + Show a help text. +.TP +\fB\-V\fP + Show version information. +.PP +.SH FILES + +.PP +.TP +latex2man.tex + The LaTeX file containing this Man\-page. +.TP +latex2man.sty + The LaTeX package defining the environments and +commands. +.TP +latex2man.cfg + The configuration file for Latex2man +LaTeX\-package. +.TP +latex2man.trans + File containing example translations of user +defined LaTeX macros. +.TP +fancyheadings.sty + A LaTeX package used to typeset head\- and +foot lines. +.TP +fancyhdr.sty + A LaTeX package used to typeset head\- and foot +lines. +.TP +rcsinfo.sty + A LaTeX package used to extract and use RCS version +control information in LaTeX documents. +.PP +.SH SEE ALSO + +.PP +LaTeX,TexInfo, \fItroff\fP(1), +\fIgroff\fP(1), +\fImakeinfo\fP(1)\&. +.PP +.SH LaTeX COMMANDS + +.PP +The LaTeX package latex2man +is used to write the Man\-pages with +LaTeX\&.Since we translate into other text formats, not all LaTeX stuff can +be translated. +.PP +.SS PACKAGE OPTIONS +The latex2man +package accepts the following options: +.PP +.TP +fancy +use the LaTeX package fancyheadings\&. +.TP +fancyhdr +use the LaTeX package fancyhdr\&. +.TP +nofancy +neither the LaTeX package fancyheadings +nor +fancyhdr +are used. +.PP +The default option may be specified in the file latex2man.cfg\&. +.PP +.SS PACKAGE SPECIFIC ENVIRONMENTS +.PP +The following environments are provided by the package: +.TP +\\begin{Name}{chapter}{name}{author}{info}{title} +The +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 Name +environment must be the first +environment in the document. Processing starts with this environment. Any +text before this is ignored (exception: the setVersion and +setDate commands). (Note: all arguments of \\begin{Name} must +be written on one line). +.TP +\\begin{Table}[width]{columns} +The 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: +.PP +\\begin{Table}[2cm]{3} +.br +Here & am & I \\\\\\hline +.br +A 1 & A 2 & A 3 1 2 3 4 5 A 3 1 2 3 4 5 \\\\ +.br +B 1 & B 2 & B 3 \\\\ +.br +\\end{Table} +.PP +will be typeset as: +.PP +.TS +tab(&); +l l lw(2cm). +T{ +Here +T}&T{ +am +T}&T{ +I +T} +_ +T{ +A 1 +T}&T{ +A 2 +T}&T{ +A 3 1 2 3 4 5 A 3 1 2 3 4 5 +T} +T{ +B 1 +T}&T{ +B 2 +T}&T{ +B 3 +T} +.TE +.PP +If no optional \fIwidth\fP +argument is given, all entries are +typeset left justified. +The \fIwidth\fP +is a length measured absolutly in \fIcm\fP\&. +Processing with LaTeX a p{width} column is typeset +as last column. The translation to \fItroff\fP(1) +commands +results in a lw(width) +column specification. Translating +to HTML and TexInfo ignores the \fIwidth\fP +parameter. +.PP +\\hline may be used. +.PP +If the Man\-page is formatted with \fItroff\fP(1) +and tables are used, the +\fItbl\fP(1) +preprocessor should be called, usually by giving +a \fB\-t\fP +to the call of \fItroff\fP(1)\&. +When viewing the generated +manula page using \fIman\fP(1), +\fItbl\fP(1) +is called automatically. +.TP +\\begin{Description} +is the same as \\begin{description} +.TP +\\begin{Description}[label] +is similar to +\\begin{description}, but the item labels have at minimum the size +of the (optional) word \fIlabel\fP\&. +The difference is visible only +in the DVI and PDF\-output, not in the troff, TexInfo or HTML output. +.RS +.TP +a +|a \\begin{description} +.TP +ab +|ab +.TP +abc +|abc +.RE +.RS +.PP +.RS +.RE +.TP +a +|a \\begin{Description} +.TP +ab +|ab +.TP +abc +|abc +.RE +.RS +.PP +.RS +.RE +.TP +a +|a \\begin{Description}[aa] +.TP +ab +|ab +.TP +abc +|abc +.RE +.RS +.PP +.RE +.PP +.SS ACCEPTED LaTeX ENVIRONMENTS +.PP +The following environments are accepted: +.RE +.TP +.B * +description +.TP +.B * +enumerate +.TP +.B * +itemize +.TP +.B * +verbatim +.TP +.B * +center +.PP +They may be nested: +.TP +.B * +Itemize and nested center: +.ce 100 +A centered line. +.br +Another centered line. +.ce 0 + +.TP +.B * +Another item an nested enumerate +.RS +.TP +1. +a +.TP +2. +b +.RE +.RS +.PP +.RE +.PP +.SS PACKAGE SPECIFIC MACROS +.PP +The following commands are provided: +.RE +.TP +\\Opt{option} +Option: \\Opt{\-o} will be typeset as \fB\-o\fP\&. +.TP +\\Arg{argument} +Argument: \\Arg{filename} will be typeset as +\fIfilename\fP\&. +.TP +\\OptArg{option}{argument} +Option with Argument: +.br +\\OptArg{\-o}{filename} will be typeset as \fB\-o\fP\fIfilename\fP\&. +.TP +\\OptoArg{option}{argument} +Option with optional Argument: +.br +\\OptoArg{\-o}{filename} will be +typeset as \fB\-o\fP[\fIfilename\fP]\&. +.TP +\\oOpt{option} +Optional option, e.g. \\oOpt{\-o} will be +typeset as [\fB\-o\fP]\&. +.TP +\\oArg{argument} +Optional argument, e.g. \\oArg{filename} +will be typeset as [\fIfilename\fP]\&. +.TP +\\oOptArg{option}{argument} +Optional option with argument, e.g. +.br +\\oOptArg{\-o}{filename} will be typeset as [\fB\-o\fP\fIfilename\fP]\&. +.TP +\\oOptoArg{option}{argument} +Optional option with optional +argument, e.g. +\\oOptoArg{\-o}{filename} will be typeset as [\fB\-o\fP[\fIfilename\fP]]\&. +.TP +\\File{filename} +used to typeset filenames, e.g. +\\File{filename} will be typeset as filename\&. +.TP +\\Prog{prog} +used to typeset program names, e.g. +\\Prog{latex2man} will be typeset as latex2man\&. +.TP +\\Cmd{command}{chapter} +used to typeset references to other +commands, e.g. \\Cmd{latex2man}{1} will be typeset as +\fIlatex2man\fP(1)\&. +.TP +\\Bar +is typeset as |\&. +.TP +\\Bs +(BackSlash) is typeset as \\\&. +.TP +\\Tilde +is typeset as a ~\&. +.TP +\\Dots +is typeset as \&... + +.TP +\\Bullet +us typeset as *\&. +.TP +\\setVersion{\&.\&.} +set \&.. as version information. +.TP +\\setVersionWord{\&.\&.} +set \&.. for the word \fIVersion:\fP +in +the footline. The default is \\setVersionWord{Version:}\&. +.TP +\\Version +returns the version information. +.TP +\\setDate{\&.\&.} +sets \&.. as date information. +.TP +\\Date +returns the date information. +.TP +\\Email{\&.\&.} +use to mark an Email address: +.br +\\Email{Juergen.Vollmer@informatik\-vollmer.de} is typeset as: +.br +\fBJuergen.Vollmer@informatik\-vollmer.de\fP\&. +.TP +\\URL{\&.\&.} +use to mark an URL: +\\URL{http://www.foo.de/\\Tilde vollmer} is typeset as +\fBhttp://www.foo.de/~vollmer\fP\&. +.TP +\\LatexManEnd +the input file is read and processed until reading +end\-of\-file or \\LatexManEnd (at the beginning of a line). +LaTeXignores this command. +.TP +\\Lbr, \\Rbr +is typeset as [ and ] (these variants are +needed only somtimes like in item[FooBar\\LBr xx \\Lbr]\&. Usually +[ ] will work. +.TP +\\LBr, \\RBr +is typeset as { and } (these variants are +needed when using { or } as arguments to macros. +.TP +\\Circum +is typeset as ^\&. +.TP +\\Percent +is typeset as %\&. +.TP +\\TEXbr +If processed with LaTeX causes a linebreak (i.e. is +equivalent to \\\\).In the output of latex2man +this macro is +ignored. +.TP +\\TEXIbr +If TexInfo output is generated, causes a linebreak (i.e. is +equivalent to \\\\),otherwise ignored. +.TP +\\MANbr +If Man\-Page output is generated, causes a linebreak (i.e. is +equivalent to \\\\),otherwise ignored. +.TP +\\HTMLbr +If HTML output is generated, causes a linebreak (i.e. is +equivalent to \\\\),otherwise ignored. +.TP +\\medskip +An empty line. +.TP +\\SP +Produces some extra space, works also at the beginning of lines. +The code of the second line looks like: +\\SP abc \\SP\\SP xx\\\\: +.br +abc \fB \fP\fB \fP\fB \fPxx +.br +\fB \fPabc \fB \fP\fB \fPxx +.br +\fB \fP\fB \fPabc \fB \fPxx +.PP +Note: Due to some ``problems\&'' with TexInfo, the lines starting with +\\SP +have a leading \&. (dot) in the TexInfo output, +see \fB\-a\fP\fIchar\fP\&. +.PP +.SS ACCEPTED MACROS FROM THE RCSINFO PACKAGE +.PP +.TP +\\rcsInfo $Id ...$ +if the LaTeX package rcsinfo +is used, +this command is used to extract the date of the Man\-page. +.TP +\\rcsInfoLongDate +if the LaTeX package rcsinfo +is used, this +command is used to typeset the date coded in the $Id ..$ string. +.PP +.SS ACCEPTED LaTeX MACROS +.PP +The following standard LaTeX commands are accepted: +.TP +\\section{\&.\&.} +The 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: \fIName\fP +(special handling as environment, c.f. above), \fISynopsis\fP, +\fIDescription\fP, +\fIOptions\fP, +\fIFiles\fP, +\fISee Also\fP, +\fIDiagnostics\fP, +\fIReturn Values\fP, +\fIBugs\fP, +\fIAuthor\fP, +\fIversion\fP, +etc. +.PP +\fISynopsis\fP +must be the first section after the Name +environment. +.PP +Note: Do not use LaTeX\-macrosin section names. +.TP +\\subsection{\&.\&.} +works as well as +.TP +\\subsubsection{\&.\&.} +those. +.TP +\\emph{\&.\&.} +\\emph{example} is typeset as \fIexample\fP\&. +.TP +\\textbf{\&.\&.} +\\textbf{example} is typeset as \fBexample\fP\&. +.TP +\\texttt{\&.\&.} +\\textt{example} is typeset as example\&. +.TP +\\underline{\&.\&.} +\\underline{example} is typeset as +.ul +example of underline +\&. +.TP +\\date{\&.\&.} +uses \&.. as date. +.TP +\\verb+..+ +but only + is allowed as delimiter. +.TP +$<$ is typeset as <\&. +.TP +$>$ is typeset as >\&. +.TP +$<=$ is typeset as <=\&. +.TP +$>=$ is typeset as >=\&. +.TP +$=$ is typeset as =\&. +.TP +$<>$ is typeset as <>\&. +.TP +$\\ge$ +is typeset as $>=$. +.TP +$\\le$ +is typeset as $<=$. +.TP +$\\leftarrow$ +is typeset as $<--$. +.TP +$\\Leftarrow$ +is typeset as $<==$. +.TP +$\\rightarrow$ +is typeset as $-->$. +.TP +$\\Rightarrow$ +is typeset as $==>$. +.TP +\\{ is typeset as {\&. +.TP +\\} is typeset as }\&. +.TP +\\$ is typeset as $\&. +.TP +\\$ is typeset as $,should be used inside macro +arguments. +.TP +\\_ is typeset as _\&. +.TP +\\& is typeset as &\&. +.TP +\\# is typeset as #\&. +.TP +\\% is typeset as %\&. +.TP +\\, +is typeset as smaller blank \- \- (between the two \-) +.TP +\\\- +is used to mark hyphenation in a word. +.TP +\\\\ is typeset as a linebreak or marks the end of a column in the +Table +environment. +.TP +\\ (a \\ 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 \\SP +command). +.TP +~ is typeset as a blank. +.TP +\\copyright +is typeset as (C)\&. +.TP +\\noindent +.TP +\\hline +inside a Table +environment. +.TP +\\item +inside a itemize, +enumerate, +or +description +environment. +.TP +\\today +11 November 2008(see also the rcsinfo +LaTeXpackage). +.TP +\\ss,\\"a, ... +\\ss = ß, \\"a= ä, \\"o= ö, \\"u= ü, +\\"A= Ä, \\"O= Ö, \\"U= Ü. It is allowed to surround these +macros in { and } in all places, even inside other macros, e.g. +.Vb + \\textbf{\\"a\\"o\\"u\\"A\\"O\\"U\\ss} + \\textbf{\\"a}{\\"o}{\\"u}{\\"A}{\\"O}{\\"U}{\\ss}} + \\textbf{äöüÄÖÜß} +.Ve +.PP +\fBäöüÄÖÜß äöüÄÖÜß äöüÄÖÜß\fP +.PP +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. Ä +becomes Ä +in HTML and @"A +in texinfo. +.PP +.SS CONDITIONAL TEXT +.PP +latex2man +preprocesses the LaTeX input to allow text to be used +conditionally. A special sort of LaTeX comment is used for that purpose. +.TP +.B * +%@% IF \fIcondition\fP %@% +.TP +.B * +%@% ELSE %@% +.TP +.B * +%@% END\-IF %@% +.PP +A line must contain only such a comment and nothing else. \fIcondition\fP +is +a boolean expression containing ``names\&'' and operators. The names given with +the \fB\-C\fP\fIname\fP +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 IF/ELSE/END\-IF +may be nested. As boolean +operators the following are allowed: +.PP +.TS +tab(&); +l l. +T{ +||T}&T{ +boolean or +T} +T{ +&&T}&T{ +boolean and +T} +T{ +! +T}&T{ +negation +.TE +.PP +( and ) for grouping are allowed. +.PP +For example: +.br +%@% IF abc %@% +.br +abc set +.br +%@% IF xyz %@% +.br +xyz set +.br +%@% ELSE %@% +.br +xyz NOT set +.br +%@% END\-IF %@% +.br +%@% ELSE %@% +.br +abc NOT set +.br +%@% IF xyz || !XYZ %@% +.br +xyz OR !XYZ set +.br +%@% ELSE %@% +.br +xyz OR !XYZ NOT set +.br +%@% END\-IF %@% +.br +%@% END\-IF %@% +.PP +Run this manual page through latex2man +with e.g. +\fB\-C\fP\fI\&'abc XYZ\&'\fP +and have a look to the generated output. +(If simply running the LaTeX\-document through LaTeX,all lines are shown in the +\&.dvi file). +.br +abc NOT set +.br +xyz OR !XYZ set +.br +.PP +To check the conditional text feature, when latex2man +is called with +.TP +\fB\-C\fP\fIHTML\fP + the lines 1a, 2b, 3b, and 4b; +.TP +\fB\-C\fP\fITEXI\fP + the lines 1b, 2a, 3b, and 4b; +.TP +\fB\-C\fP\fIMAN\fP + the lines 1b, 2b, 3a, and 4b; +.TP +\fB\-C\fP\fILATEX\fP + the lines 1b, 2b, 3b, and 4a; +.TP +calling LaTeX without preprocessing +all lines +.PP +should be shown: +.PP +1b. The HTML conditional was not set. +.PP +2b. The TEXI conditional was not set. +.PP +3a. This text occurs only when viewing the MAN output +.PP +4b. The LATEX conditional was not set. +.PP +.SS TRANSLATION OF USER DEFINED MACROS +.PP +The user macro translation file (given by the [\fB\-t\fP\fItransfile\fP]) +contains +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: +.PP +.TP +.B * +Comments start with a # up to the end of the line. +.TP +.B * +For a macro \\foo with no arguments, the following code must be +specified: +.RS +.TP +Translation to Man\-Pages +$manMacro{'foo'} = '...'; +.TP +Translation to HTML +$htmlMacro{'foo'} = '...'; +.TP +Translation to TexInfo +$texiMacro{'foo'} = '...'; +.RE +.RS +.PP +where \&... is the translation. +.PP +.RE +.TP +.B * +For a macro \\foo{..} with one argument, the following code must be +specified: +.RS +.TP +Translation to Man\-Pages +$manMacro1a{'foo'} = '...'; +.br +$manMacro1b{'foo'} = '...'; +.TP +Translation to HTML +$htmlMacro1a{'foo'} = '...'; +.br +$htmlMacro1b{'foo'} = '...'; +.RS +.PP +.RE +.TP +Translation to TexInfo +$texiMacro1a{'foo'} = '...'; +.br +$texiMacro1b{'foo'} = '...'; +.RE +.RS +.PP +where \&... is the translation. The 1a code is used before the +argument, while 1b is typeset after the argument is set. +.PP +.RE +.TP +.B * +For a macro \\foo{..}{..} with two arguments, the following code +must be specified: +.RS +.TP +Translation to Man\-Pages +$manMacro2a{'foo'} = '...'; +.br +$manMacro2b{'foo'} = '...'; +.br +$manMacro2c{'foo'} = '...'; +.TP +Translation to HTML +$htmlMacro2a{'foo'} = '...'; +.br +$htmlMacro2b{'foo'} = '...'; +.br +$htmlMacro2c{'foo'} = '...'; +.TP +Translation to TexInfo +$texiMacro2a{'foo'} = '...'; +.br +$texiMacro2b{'foo'} = '...'; +.br +$texiMacro2c{'foo'} = '...'; +.RE +.RS +.PP +where \&... is the translation. The 2a code is used before the +first argument, 2b between the two arguments and 2c is +typeset after the second argument is set. +.RE +.TP +.B * +The file latex2man.trans contains some example code. +.PP +.SS VERBATIM ENVIRONMENT +.PP +.Vb +This + {is} + \\texttt{a} + $test$ + _of_ +verbatim +<this is no HTML tag> and no @* TexInfo command +.Ve +.PP +.SS SUBSECTION WORKS +.PP +This is a \\subsection\&. +.PP +.SS Subsubsection works +.PP +This is a \\subsubsection\&. +.PP +.SS Subsubsection still works +.PP +This is another \\subsubsection\&. +.PP +.SS GENERAL REMARKS +.PP +.TP +1. +Empty lines are typeset as paragraph separators. +.TP +2. +The arguments of the LaTeX commands must not be split over several +lines. +.TP +3. +Do not nest calls to macros. +.TP +4. +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. +.TP +5. +latex2man requires Perl version >= 5.0004_03. +.TP +6. +If you want to install the system with the distributed Makefile, +you need GNU\-make\&. +If you don\&'t have it, you should execute the +steps shown in the Makefile +manually. +.PP +.SS SOME BUG FIX TESTS +.PP +.TP +Leading . and \&' +Now leading \&. and \&' in generation troff output should work propperly, +since a \\& is added. Therfore the \\Dot macro has been deleted. +.br +Thanks to \fBFrank.Schilder@Mathematik.Tu\-Ilmenau.De\fP\&. +.br +Testcase 1: +.RS +.TP +\&'\\n\&' +\&.\&.\&. +.RE +.RS +.PP +Testcase 2: +.br +\&.foobar +Testcase 3: +.br +\&... +.PP +abc \&... +abc \&. efg \&' 123 +.PP +.RE +.TP +%in verbatim +A % in a \\verb and verbatim\-environment was not +emitted correctly. Thanks to Aleksey Nogin \fBnogin@cs.caltech.edu\fP +for the bug report and bug fix. +.PP +% abc +.PP +.Vb + % abc % +.Ve +.PP +but ignore comments following this: +.PP +.SH REQUIREMENTS + +.PP +.TP +Perl +latex2man +requires Perl version >= 5.0004_03. +.TP +Make +If you want to install the system with the distributed +Makefile, +you need GNU\-make\&. +If you don\&'t have it, you +should execute the steps shown in the Makefile +manually. +.TP +LaTeX LaTeX2e is required. +.PP +.SH CHANGES + +Please check the file \fBlatex2man\-CHANGES\fP +for the list of changes. +.PP +.SH VERSION + +.PP +Version: 1.23 of 2008/11/11\&. +.PP +.SH LICENSE AND COPYRIGHT + +.PP +.TP +Copyright +(C)1998, Dr. Jürgen Vollmer, Viktoriastraße 15, +D\-76133 Karlsruhe, Germany, \fBJuergen.Vollmer@informatik\-vollmer.de\fP +.PP +The actual version of Latex2man +may be found on my homepage +.br +\fBhttp://www.informatik\-vollmer.de/software/latex2man.html\fP\&. +.PP +.TP +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. +.PP +.TP +Misc +If you find this software useful, please send me a postcard from +the place where you are living. +.PP +.SH AUTHOR + +.PP +Dr. Jürgen Vollmer +.br +Viktoriastraße 15 +.br +D\-76133 Karlsruhe +.br +Email: \fBJuergen.Vollmer@informatik\-vollmer.de\fP +.br +WWW: \fBhttp://www.informatik\-vollmer.de\fP\&. +.PP +.\" NOTE: This file is generated, DO NOT EDIT. diff --git a/Master/texmf-dist/doc/support/latex2man/latex2man.html b/Master/texmf-dist/doc/support/latex2man/latex2man.html new file mode 100644 index 00000000000..03612aa1acb --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/latex2man.html @@ -0,0 +1,1160 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<!-- Manual page created with latex2man on Di 11. Nov 08:21:27 CET 2008 -- +-- Author of latex2man: Juergen.Vollmer@informatik-vollmer.de -- +-- NOTE: This file is generated, DO NOT EDIT. --> +<html> +<head><title>LATEX2MAN</title></head> +<body bgcolor="white"> +<h1 align=center> +LaTeX2man -<br> +A Documentation Tool +</h1> +<h4 align=center>Dr. Jürgen Vollmer </h4> +<h4 align=center>2008/11/11</h4> +<h4 align=center>Version 1.23</h4> +<p> +<tt>Latex2man</tt> +is a tool to translate UNIX manual pages written with +LaTeXinto a format understood by the UNIX <em>man</em>(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). +<h3>Table of Contents</h3> +<ul> +<li><a href="#section_1">Synopsis </a></li> +<li><a href="#section_2">Description </a></li> +<li><a href="#section_3">Options </a></li> +<li><a href="#section_4">Files </a></li> +<li><a href="#section_5">See Also </a></li> +<li><a href="#section_6">LaTeX commands</a> +<ul> +<li><a href="#section_7">Package Options </a></li> +<li><a href="#section_8">Package Specific Environments </a></li> +<li><a href="#section_9">Accepted LaTeX Environments</a></li> +<li><a href="#section_10">Package Specific Macros </a></li> +<li><a href="#section_11">Accepted Macros from the rcsinfo Package </a></li> +<li><a href="#section_12">Accepted LaTeX Macros</a></li> +<li><a href="#section_13">Conditional Text </a></li> +<li><a href="#section_14">Translation of User Defined Macros </a></li> +<li><a href="#section_15">Verbatim Environment </a></li> +<li><a href="#section_16">Subsection works </a> +<ul> +<li><a href="#section_17">Subsubsection works </a></li> +<li><a href="#section_18">Subsubsection still works </a></li> +</ul> +<li><a href="#section_19">General Remarks </a></li> +<li><a href="#section_20">Some Bug Fix Tests </a></li> +</ul> +<li><a href="#section_21">Requirements </a></li> +<li><a href="#section_22">Changes </a></li> +<li><a href="#section_23">Version </a></li> +<li><a href="#section_24">License and Copyright </a></li> +<li><a href="#section_25">Author </a></li> +</ul> +<p> +<h2><a name="section_1">Synopsis</a></h2> + +<p> +<tt>latex2man</tt> +[<b>-t</b><i>transfile</i>] +[<b>-HMTL</b>] +[<b>-h</b>] +[<b>-V</b>] +[<b>-C</b><i>name</i>] +[<b>-a</b><i>char</i>] +<i>infile</i> +<i>outfile</i> +<p> +<h2><a name="section_2">Description</a></h2> + +<tt>Latex2man</tt> +reads the file <i>infile</i> +and writes <i>outfile</i>. +The +input must be a LaTeX document using the <tt>latex2man</tt> +LaTeXpackage. +<tt>Latex2man</tt> +translates that document into the <em>troff</em>(1) +format using +the <b>-man</b> +macro package. +<p> +Using the <b>-H</b> +option, HTML code can be produced, instead of +<em>troff</em>(1). +<p> +Using the <b>-T</b> +option, TexInfo code can be produced, instead of +<em>troff</em>(1). +<p> +Using the <b>-M</b> +option, <em>troff</em>(1) +input is produced. +<p> +Using the <b>-L</b> +option, LaTeX ouput can be produced, instead of +<em>troff</em>(1). +<p> +<h2><a name="section_3">Options</a></h2> + +<dl compact> +<dt><b>-t</b><i>transfile</i> +</dt> +<dd> Translation for user defined LaTeX macros. +</dd> +<dt><b>-M</b> +</dt> +<dd> Produce output suitable for the <em>man</em>(1) +command (default). +</dd> +<dt><b>-H</b> +</dt> +<dd> Instead of producing output suitable for the <em>man</em>(1) +command, HTML code is produced (despite the name of the command). +</dd> +<dt><b>-T</b> +</dt> +<dd> Instead of producing output suitable for the <em>man</em>(1) +command, TexInfo code is produced (despite the name of the command). The +generated <tt>.texi</tt>-file +may be processed with <em>makeinfo</em>(1) +(to produce an <tt>.info</tt>-file) +which in turn may be installed using +<em>install-info</em>(1). +The Info tags <tt>@dircategory</tt> and +<tt>@direntry</tt> are provided. +</dd> +<dt><b>-L</b> +</dt> +<dd> The LaTeX source is written to the <i>outfile</i>. +This is +useful in conjunction with the <b>-C</b><i>name</i> +option. +</dd> +<dt><b>-C</b><i>name</i> +</dt> +<dd> Output the conditional text for <i>name</i>. +If more +than one name should be given use quotes: <b>-C</b><i>'name1 name2 ...'</i><br> + +The following names are defined automatically: +<ul compact> +<li><b>-H</b> defines <tt>HTML</tt> +</li> +<li><b>-T</b> defines <tt>TEXI</tt> +</li> +<li><b>-M</b> defines <tt>MAN</tt> +</li> +<li><b>-L</b> defines <tt>LATEX</tt> +</li> +</ul> +</dd> +<dt><b>-a</b><i>char</i> +</dt> +<dd> Is used only in conjunction with -T.<br> + +Background:<br> + +TexInfo ignores all blanks before the first word on a new line. In order +to produce some additional space before that word (using \SP) some +character has to be printed before the additional space. By default this +is a . (dot). The <i>char</i> +specifies an alternative for that first +character. Giving a blank to +<b>-a</b> +supresses the indentation of a line.<br> + +Note: only for the first \SP of a series that <i>char</i> +is printed. +</dd> +<dt><b>-h</b> +</dt> +<dd> Show a help text. +</dd> +<dt><b>-V</b> +</dt> +<dd> Show version information. +</dd> +</dl> +<p> +<h2><a name="section_4">Files</a></h2> + +<p> +<dl compact> +<dt><tt>latex2man.tex</tt> +</dt> +<dd> The LaTeX file containing this Man-page. +</dd> +<dt><tt>latex2man.sty</tt> +</dt> +<dd> The LaTeX package defining the environments and +commands. +</dd> +<dt><tt>latex2man.cfg</tt> +</dt> +<dd> The configuration file for <tt>Latex2man</tt> +LaTeX-package. +</dd> +<dt><tt>latex2man.trans</tt> +</dt> +<dd> File containing example translations of user +defined LaTeX macros. +</dd> +<dt><tt>fancyheadings.sty</tt> +</dt> +<dd> A LaTeX package used to typeset head- and +foot lines. +</dd> +<dt><tt>fancyhdr.sty</tt> +</dt> +<dd> A LaTeX package used to typeset head- and foot +lines. +</dd> +<dt><tt>rcsinfo.sty</tt> +</dt> +<dd> A LaTeX package used to extract and use RCS version +control information in LaTeX documents. +</dd> +</dl> +<p> +<h2><a name="section_5">See Also</a></h2> + +<p> +LaTeX,TexInfo, <em>troff</em>(1), +<em>groff</em>(1), +<em>makeinfo</em>(1). +<p> +<h2><a name="section_6">LaTeX commands</a></h2> + +<p> +The LaTeX package <tt>latex2man</tt> +is used to write the Man-pages with +LaTeX.Since we translate into other text formats, not all LaTeX stuff can +be translated. +<p> +<h4><a name="section_7">Package Options</a></h4> + +The <tt>latex2man</tt> +package accepts the following options: +<p> +<dl compact> +<dt>fancy</dt> +<dd> use the LaTeX package <tt>fancyheadings</tt>. +</dd> +<dt>fancyhdr</dt> +<dd> use the LaTeX package <tt>fancyhdr</tt>. +</dd> +<dt>nofancy</dt> +<dd> neither the LaTeX package <tt>fancyheadings</tt> +nor +<tt>fancyhdr</tt> +are used. +</dd> +</dl> +<p> +The default option may be specified in the file <tt>latex2man.cfg</tt>. +<p> +<h4><a name="section_8">Package Specific Environments</a></h4> + +<p> +The following environments are provided by the package: +<dl compact> +<dt>\begin{Name}{chapter}{name}{author}{info}{title} </dt> +<dd> The +<tt>Name</tt> +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 <tt>Name</tt> +environment must be the first +environment in the document. Processing starts with this environment. Any +text before this is ignored (exception: the <tt>setVersion</tt> and +<tt>setDate</tt> commands). (Note: all arguments of \begin{Name} must +be written on one line). +</dd> +<dt>\begin{Table}[width]{columns}</dt> +<dd> The <tt>Table</tt> +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: +<p> +<tt>\begin{Table}[2cm]{3}</tt> <br> + +<tt>Here & am & I \\\hline</tt> <br> + +<tt>A 1 & A 2 & A 3 1 2 3 4 5 A 3 1 2 3 4 5 \\</tt> <br> + +<tt>B 1 & B 2 & B 3 \\</tt> <br> + +<tt>\end{Table}</tt> +<p> +will be typeset as: +<p> +<table> +<tr> +<td>Here </td> +<td> am </td> +<td> I </td> +</tr> + +<tr> +<td>A 1 </td> +<td> A 2 </td> +<td> A 3 1 2 3 4 5 A 3 1 2 3 4 5</td> +</tr> + +<tr> +<td>B 1 </td> +<td> B 2 </td> +<td> B 3 </td> +</tr> + +</table> +<p> +If no optional <em>width</em> +argument is given, all entries are +typeset left justified. +The <em>width</em> +is a length measured absolutly in <em>cm</em>. +Processing with LaTeX a <tt>p{width}</tt> column is typeset +as last column. The translation to <em>troff</em>(1) +commands +results in a <tt>lw(width)</tt> +column specification. Translating +to HTML and TexInfo ignores the <em>width</em> +parameter. +<p> +<tt>\hline</tt> may be used. +<p> +If the Man-page is formatted with <em>troff</em>(1) +and tables are used, the +<em>tbl</em>(1) +preprocessor should be called, usually by giving +a <b>-t</b> +to the call of <em>troff</em>(1). +When viewing the generated +manula page using <em>man</em>(1), +<em>tbl</em>(1) +is called automatically. +</dd> +<dt>\begin{Description}</dt> +<dd> is the same as \begin{description} +</dd> +<dt>\begin{Description}[label]</dt> +<dd> is similar to +\begin{description}, but the item labels have at minimum the size +of the (optional) word <em>label</em>. +The difference is visible only +in the DVI and PDF-output, not in the troff, TexInfo or HTML output. +<dl compact> +<dt>a</dt> +<dd> |a <tt>\begin{description}</tt> +</dd> +<dt>ab</dt> +<dd> |ab +</dd> +<dt>abc</dt> +<dd> |abc +</dd> +</dl> +<dl compact> +<dt>a</dt> +<dd> |a <tt>\begin{Description}</tt> +</dd> +<dt>ab</dt> +<dd> |ab +</dd> +<dt>abc</dt> +<dd>| abc +</dd> +</dl> +<dl compact> +<dt>a</dt> +<dd> |a <tt>\begin{Description}[aa]</tt> +</dd> +<dt>ab</dt> +<dd> |ab +</dd> +<dt>abc</dt> +<dd> |abc +</dd> +</dl> +</dd> +</dl> +<p> +<h4><a name="section_9">Accepted LaTeX Environments</a></h4> + +<p> +The following environments are accepted: +<ul compact> +<li><tt>description</tt> +</li> +<li><tt>enumerate</tt> +</li> +<li><tt>itemize</tt> +</li> +<li><tt>verbatim</tt> +</li> +<li><tt>center</tt> +</li> +</ul> +<p> +They may be nested: +<ul compact> +<li>Itemize and nested center: +<div align=center> +A centered line.<br> + +Another centered line. +</div> +</li> +<li>Another item an nested enumerate +<ol compact> +<li value =1>a +</li> +<li value =2>b +</li> +</ol> +</li> +</ul> +<p> +<h4><a name="section_10">Package Specific Macros</a></h4> + +<p> +The following commands are provided: +<dl compact> +<dt>\Opt{option}</dt> +<dd> Option: <tt>\Opt{-o}</tt> will be typeset as <b>-o</b>. +</dd> +<dt>\Arg{argument}</dt> +<dd> Argument: <tt>\Arg{filename}</tt> will be typeset as +<i>filename</i>. +</dd> +<dt>\OptArg{option}{argument}</dt> +<dd> Option with Argument:<br> + +<tt>\OptArg{-o}{filename}</tt> will be typeset as <b>-o</b><i>filename</i>. +</dd> +<dt>\OptoArg{option}{argument}</dt> +<dd> Option with optional Argument:<br> + +<tt>\OptoArg{-o}{filename}</tt> will be +typeset as <b>-o</b>[<i>filename</i>]. +</dd> +<dt>\oOpt{option}</dt> +<dd> Optional option, e.g. <tt>\oOpt{-o}</tt> will be +typeset as [<b>-o</b>]. +</dd> +<dt>\oArg{argument}</dt> +<dd> Optional argument, e.g. <tt>\oArg{filename}</tt> +will be typeset as [<i>filename</i>]. +</dd> +<dt>\oOptArg{option}{argument}</dt> +<dd> Optional option with argument, e.g.<br> + +<tt>\oOptArg{-o}{filename}</tt> will be typeset as [<b>-o</b><i>filename</i>]. +</dd> +<dt>\oOptoArg{option}{argument}</dt> +<dd> Optional option with optional +argument, e.g. +<tt>\oOptoArg{-o}{filename}</tt> will be typeset as [<b>-o</b>[<i>filename</i>]]. +</dd> +<dt>\File{filename}</dt> +<dd> used to typeset filenames, e.g. +<tt>\File{filename}</tt> will be typeset as <tt>filename</tt>. +</dd> +<dt>\Prog{prog}</dt> +<dd> used to typeset program names, e.g. +<tt>\Prog{latex2man}</tt> will be typeset as <tt>latex2man</tt>. +</dd> +<dt>\Cmd{command}{chapter}</dt> +<dd> used to typeset references to other +commands, e.g. <tt>\Cmd{latex2man}{1}</tt> will be typeset as +<em>latex2man</em>(1). +</dd> +<dt>\Bar</dt> +<dd> is typeset as |. +</dd> +<dt>\Bs</dt> +<dd> (BackSlash) is typeset as \. +</dd> +<dt>\Tilde</dt> +<dd> is typeset as a ~. +</dd> +<dt>\Dots</dt> +<dd> is typeset as ... +</dd> +<dt>\Bullet</dt> +<dd> us typeset as *. +</dd> +<dt>\setVersion{..}</dt> +<dd> set <tt>..</tt> as version information. +</dd> +<dt>\setVersionWord{..}</dt> +<dd> set <tt>..</tt> for the word <em>Version:</em> +in +the footline. The default is <tt>\setVersionWord{Version:}</tt>. +</dd> +<dt>\Version</dt> +<dd> returns the version information. +</dd> +<dt>\setDate{..}</dt> +<dd> sets <tt>..</tt> as date information. +</dd> +<dt>\Date</dt> +<dd> returns the date information. +</dd> +<dt>\Email{..}</dt> +<dd> use to mark an Email address:<br> + +<tt>\Email{Juergen.Vollmer@informatik-vollmer.de}</tt> is typeset as:<br> + +<a href ="mailto:Juergen.Vollmer@informatik-vollmer.de"><tt>Juergen.Vollmer@informatik-vollmer.de</tt></a>. +</dd> +<dt>\URL{..}</dt> +<dd> use to mark an URL: +<tt>\URL{http://www.foo.de/\Tilde vollmer}</tt> is typeset as +<a href ="http://www.foo.de/~vollmer"><tt>http://www.foo.de/~vollmer</tt></a>. +</dd> +<dt>\LatexManEnd</dt> +<dd> the input file is read and processed until reading +end-of-file or <tt>\LatexManEnd</tt> (at the beginning of a line). +LaTeXignores this command. +</dd> +<dt>\Lbr, \Rbr</dt> +<dd> is typeset as [ and ] (these variants are +needed only somtimes like in <tt>item[FooBar\LBr xx \Lbr]</tt>. Usually +<tt>[ ]</tt> will work. +</dd> +<dt>\LBr, \RBr</dt> +<dd> is typeset as { and } (these variants are +needed when using { or } as arguments to macros. +</dd> +<dt>\Circum</dt> +<dd> is typeset as ^. +</dd> +<dt>\Percent</dt> +<dd> is typeset as %. +</dd> +<dt>\TEXbr</dt> +<dd> If processed with LaTeX causes a linebreak (i.e. is +equivalent to \\).In the output of <tt>latex2man</tt> +this macro is +ignored. +</dd> +<dt>\TEXIbr</dt> +<dd> If TexInfo output is generated, causes a linebreak (i.e. is +equivalent to \\),otherwise ignored. +</dd> +<dt>\MANbr</dt> +<dd> If Man-Page output is generated, causes a linebreak (i.e. is +equivalent to \\),otherwise ignored. +</dd> +<dt>\HTMLbr</dt> +<dd> If HTML output is generated, causes a linebreak (i.e. is +equivalent to \\),otherwise ignored. +</dd> +<dt>\medskip</dt> +<dd> An empty line. +</dd> +<dt>\SP</dt> +<dd> Produces some extra space, works also at the beginning of lines. +The code of the second line looks like: +<tt>\SP abc \SP\SP xx\\</tt>:<br> + +abc xx<br> + + abc xx<br> + + abc xx +<p> +Note: Due to some ``problems'' with TexInfo, the lines starting with +<tt>\SP</tt> +have a leading . (dot) in the TexInfo output, +see <b>-a</b><i>char</i>. +</dd> +</dl> +<p> +<h4><a name="section_11">Accepted Macros from the rcsinfo Package</a></h4> + +<p> +<dl compact> +<dt>\rcsInfo $Id ...$</dt> +<dd> if the LaTeX package <tt>rcsinfo</tt> +is used, +this command is used to extract the date of the Man-page. +</dd> +<dt>\rcsInfoLongDate</dt> +<dd> if the LaTeX package <tt>rcsinfo</tt> +is used, this +command is used to typeset the date coded in the <tt>$Id ..$</tt> string. +</dd> +</dl> +<p> +<h4><a name="section_12">Accepted LaTeX Macros</a></h4> + +<p> +The following standard LaTeX commands are accepted: +<dl compact> +<dt>\section{..}</dt> +<dd> The <tt>section</tt> +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: <em>Name</em> +(special handling as environment, c.f. above), <em>Synopsis</em>, +<em>Description</em>, +<em>Options</em>, +<em>Files</em>, +<em>See Also</em>, +<em>Diagnostics</em>, +<em>Return Values</em>, +<em>Bugs</em>, +<em>Author</em>, +<em>version</em>, +etc. +<p> +<em>Synopsis</em> +must be the first section after the <tt>Name</tt> +environment. +<p> +Note: Do not use LaTeX-macrosin section names. +</dd> +<dt>\subsection{..}</dt> +<dd> works as well as +</dd> +<dt>\subsubsection{..}</dt> +<dd> those. +</dd> +<dt>\emph{..}</dt> +<dd> <tt>\emph{example}</tt> is typeset as <em>example</em>. +</dd> +<dt>\textbf{..}</dt> +<dd> <tt>\textbf{example}</tt> is typeset as <strong>example</strong>. +</dd> +<dt>\texttt{..}</dt> +<dd><tt>\textt{example}</tt> is typeset as <tt>example</tt>. +</dd> +<dt>\underline{..}</dt> +<dd><tt>\underline{example}</tt> is typeset as +<u>example of underline</u>. +</dd> +<dt>\date{..}</dt> +<dd> uses <tt>..</tt> as date. +</dd> +<dt>\verb+..+</dt> +<dd> but only + is allowed as delimiter. +</dd> +<dt>$<$</dt> +<dd> is typeset as <. +</dd> +<dt>$>$</dt> +<dd> is typeset as >. +</dd> +<dt>$<=$</dt> +<dd> is typeset as <=. +</dd> +<dt>$>=$</dt> +<dd> is typeset as >=. +</dd> +<dt>$=$</dt> +<dd> is typeset as =. +</dd> +<dt>$<>$</dt> +<dd> is typeset as <>. +</dd> +<dt>$\ge$</dt> +<dd> is typeset as $>$. +</dd> +<dt>$\le$</dt> +<dd> is typeset as $<=$. +</dd> +<dt>$\leftarrow$</dt> +<dd> is typeset as $<--$. +</dd> +<dt>$\Leftarrow$</dt> +<dd> is typeset as $<==$. +</dd> +<dt>$\rightarrow$</dt> +<dd> is typeset as $-->$. +</dd> +<dt>$\Rightarrow$</dt> +<dd> is typeset as $==>$. +</dd> +<dt>\{</dt> +<dd> is typeset as {. +</dd> +<dt>\}</dt> +<dd> is typeset as }. +</dd> +<dt>\$</dt> +<dd> is typeset as $. +</dd> +<dt>\$</dt> +<dd> is typeset as $,should be used inside macro +arguments. +</dd> +<dt>\_</dt> +<dd> is typeset as _. +</dd> +<dt>\&</dt> +<dd> is typeset as &. +</dd> +<dt>\#</dt> +<dd> is typeset as #. +</dd> +<dt>\%</dt> +<dd> is typeset as %. +</dd> +<dt>\,</dt> +<dd> is typeset as smaller blank - - (between the two -) +</dd> +<dt>\-</dt> +<dd> is used to mark hyphenation in a word. +</dd> +<dt>\\</dt> +<dd> is typeset as a linebreak or marks the end of a column in the +<tt>Table</tt> +environment. +</dd> +<dt>\</dt> +<dd> (a \ 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 <tt>\SP</tt> +command). +</dd> +<dt>~</dt> +<dd> is typeset as a blank. +</dd> +<dt>\copyright</dt> +<dd> is typeset as ©. +</dd> +<dt>\noindent</dt> +<dd> +</dd> +<dt>\hline</dt> +<dd> inside a <tt>Table</tt> +environment. +</dd> +<dt>\item</dt> +<dd> inside a <tt>itemize</tt>, +<tt>enumerate</tt>, +or +<tt>description</tt> +environment. +</dd> +<dt>\today</dt> +<dd> 11 November 2008 (see also the <tt>rcsinfo</tt> +LaTeXpackage). +</dd> +<dt>\ss,\"a, ...</dt> +<dd> \ss = ß, \"a= ä, \"o= ö, \"u= ü, +\"A= Ä, \"O= Ö, \"U= Ü. It is allowed to surround these +macros in { and } in all places, even inside other macros, e.g. +<pre> + \textbf{\"a\"o\"u\"A\"O\"U\ss} + \textbf{\"a}{\"o}{\"u}{\"A}{\"O}{\"U}{\ss}} + \textbf{äöüÄÖÜß} +</pre> +<p> +<strong>äöüÄÖÜß äöüÄÖÜß äöüÄÖÜß</strong> +<p> +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. <tt>Ä</tt> +becomes <tt>&Auml</tt>; +in HTML and <tt>@"A</tt> +in texinfo. +</dd> +</dl> +<p> +<h4><a name="section_13">Conditional Text</a></h4> + +<p> +<tt>latex2man</tt> +preprocesses the LaTeX input to allow text to be used +conditionally. A special sort of LaTeX comment is used for that purpose. +<ul compact> +<li>%@% IF <em>condition</em> %@% +</li> +<li>%@% ELSE %@% +</li> +<li>%@% END-IF %@% +</li> +</ul> +<p> +A line must contain only such a comment and nothing else. <em>condition</em> +is +a boolean expression containing ``names'' and operators. The names given with +the <b>-C</b><i>name</i> +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 <tt>IF/ELSE/END-IF</tt> +may be nested. As boolean +operators the following are allowed: +<p> +<table> +<tr> +<td>||</td> +<td> boolean or </td> +</tr> + +<tr> +<td>&& </td> +<td> boolean and </td> +</tr> + +<tr> +<td>! </td> +<td> negation +</table> +<p> +( and ) for grouping are allowed. +<p> +For example:<br> + +%@% IF abc %@%<br> + +<tt></tt>abc set<br> + +<tt></tt>%@% IF xyz %@%<br> + +<tt></tt>xyz set<br> + +<tt></tt>%@% ELSE %@%<br> + +<tt></tt>xyz NOT set<br> + +<tt></tt>%@% END-IF %@%<br> + +%@% ELSE %@%<br> + +<tt></tt>abc NOT set<br> + +<tt></tt>%@% IF xyz || !XYZ %@%<br> + +<tt></tt>xyz OR !XYZ set<br> + +<tt></tt>%@% ELSE %@%<br> + +<tt></tt>xyz OR !XYZ NOT set<br> + +<tt></tt>%@% END-IF %@%<br> + +%@% END-IF %@% +<p> +Run this manual page through <tt>latex2man</tt> +with e.g. +<b>-C</b><i>'abc XYZ'</i> +and have a look to the generated output. +(If simply running the LaTeX-document through LaTeX,all lines are shown in the +.dvi file).<br> + +abc NOT set<br> + +xyz OR !XYZ set<br> + +<p> +To check the conditional text feature, when <tt>latex2man</tt> +is called with +<dl compact> +<dt><b>-C</b><i>HTML</i> +</dt> +<dd> the lines 1a, 2b, 3b, and 4b; +</dd> +<dt><b>-C</b><i>TEXI</i> +</dt> +<dd> the lines 1b, 2a, 3b, and 4b; +</dd> +<dt><b>-C</b><i>MAN</i> +</dt> +<dd> the lines 1b, 2b, 3a, and 4b; +</dd> +<dt><b>-C</b><i>LATEX</i> +</dt> +<dd> the lines 1b, 2b, 3b, and 4a; +</dd> +<dt>calling LaTeX without preprocessing</dt> +<dd> all lines +</dd> +</dl> +should be shown: +<p> +1a. This text occurs only when viewing the HTML output. +<p> +2b. The TEXI conditional was not set. +<p> +3b. The MAN conditional was not set. +<p> +4b. The LATEX conditional was not set. +<p> +<h4><a name="section_14">Translation of User Defined Macros</a></h4> + +<p> +The user macro translation file (given by the [<b>-t</b><i>transfile</i>]) +contains +<tt>Perl</tt> +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: +<p> +<ul compact> +<li>Comments start with a # up to the end of the line. +</li> +<li>For a macro <tt>\foo</tt> with no arguments, the following code must be +specified: +<dl compact> +<dt>Translation to Man-Pages</dt> +<dd> +<tt>$manMacro{'foo'} = '...';</tt> +</dd> +<dt>Translation to HTML</dt> +<dd> +<tt>$htmlMacro{'foo'} = '...';</tt> +</dd> +<dt>Translation to TexInfo</dt> +<dd> +<tt>$texiMacro{'foo'} = '...';</tt> +</dd> +</dl> +<p> +where <tt>...</tt> is the translation. +<p> +</li> +<li>For a macro <tt>\foo{..}</tt> with one argument, the following code must be +specified: +<dl compact> +<dt>Translation to Man-Pages</dt> +<dd> +<tt>$manMacro1a{'foo'} = '...';</tt><br> + +<tt>$manMacro1b{'foo'} = '...';</tt> +</dd> +<dt>Translation to HTML</dt> +<dd> +<tt>$htmlMacro1a{'foo'} = '...';</tt><br> + +<tt>$htmlMacro1b{'foo'} = '...';</tt> +<p> +</dd> +<dt>Translation to TexInfo</dt> +<dd> +<tt>$texiMacro1a{'foo'} = '...';</tt><br> + +<tt>$texiMacro1b{'foo'} = '...';</tt> +</dd> +</dl> +<p> +where <tt>...</tt> is the translation. The <tt>1a</tt> code is used before the +argument, while <tt>1b</tt> is typeset after the argument is set. +<p> +</li> +<li>For a macro <tt>\foo{..}{..}</tt> with two arguments, the following code +must be specified: +<dl compact> +<dt>Translation to Man-Pages</dt> +<dd> +<tt>$manMacro2a{'foo'} = '...';</tt><br> + +<tt>$manMacro2b{'foo'} = '...';</tt><br> + +<tt>$manMacro2c{'foo'} = '...';</tt> +</dd> +<dt>Translation to HTML</dt> +<dd> +<tt>$htmlMacro2a{'foo'} = '...';</tt><br> + +<tt>$htmlMacro2b{'foo'} = '...';</tt><br> + +<tt>$htmlMacro2c{'foo'} = '...';</tt> +</dd> +<dt>Translation to TexInfo</dt> +<dd> +<tt>$texiMacro2a{'foo'} = '...';</tt><br> + +<tt>$texiMacro2b{'foo'} = '...';</tt><br> + +<tt>$texiMacro2c{'foo'} = '...';</tt> +</dd> +</dl> +<p> +where <tt>...</tt> is the translation. The <tt>2a</tt> code is used before the +first argument, <tt>2b</tt> between the two arguments and <tt>2c</tt> is +typeset after the second argument is set. +</li> +<li>The file <tt>latex2man.trans</tt> contains some example code. +</li> +</ul> +<p> +<h4><a name="section_15">Verbatim Environment</a></h4> + +<p> +<pre> +This + {is} + \texttt{a} + $test$ + _of_ +verbatim +<this is no HTML tag> and no @* TexInfo command +</pre> +<p> +<h4><a name="section_16">Subsection works</a></h4> + +<p> +This is a <tt>\subsection</tt>. +<p> +<h5><a name="section_17">Subsubsection works</a></h5> + +<p> +This is a <tt>\subsubsection</tt>. +<p> +<h5><a name="section_18">Subsubsection still works</a></h5> + +<p> +This is another <tt>\subsubsection</tt>. +<p> +<h4><a name="section_19">General Remarks</a></h4> + +<p> +<ol compact> +<li value =1>Empty lines are typeset as paragraph separators. +</li> +<li value =2>The arguments of the LaTeX commands must not be split over several +lines. +</li> +<li value =3>Do not nest calls to macros. +</li> +<li value =4>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. +</li> +<li value =5><tt>latex2man</tt> requires Perl version >= 5.0004_03. +</li> +<li value =6>If you want to install the system with the distributed <tt>Makefile</tt>, +you need GNU-<tt>make</tt>. +If you don't have it, you should execute the +steps shown in the <tt>Makefile</tt> +manually. +</li> +</ol> +<p> +<h4><a name="section_20">Some Bug Fix Tests</a></h4> + +<p> +<dl compact> +<dt>Leading . and '</dt> +<dd> +Now leading . and ' in generation troff output should work propperly, +since a <tt>\&</tt> is added. Therfore the <tt>\Dot</tt> macro has been deleted.<br> + +Thanks to <a href ="mailto:Frank.Schilder@Mathematik.Tu-Ilmenau.De"><tt>Frank.Schilder@Mathematik.Tu-Ilmenau.De</tt></a>.<br> + +Testcase 1: +<dl compact> +<dt>'\n'</dt> +<dd> ... +</dd> +</dl> +Testcase 2:<br> + +<tt>.foobar</tt> +Testcase 3:<br> + +...<p> +abc ...abc . efg ' 123 +<p> +</dd> +<dt>% in verbatim</dt> +<dd> A % in a \verb and verbatim-environment was not +emitted correctly. Thanks to Aleksey Nogin <a href ="mailto:nogin@cs.caltech.edu"><tt>nogin@cs.caltech.edu</tt></a> +for the bug report and bug fix. +<p> +<tt>% abc</tt> +<p> +<pre> + % abc % +</pre> +<p> +but ignore comments following this: +<p> +</dd> +</dl> +<p> +<h2><a name="section_21">Requirements</a></h2> + +<p> +<dl compact> +<dt>Perl</dt> +<dd> <tt>latex2man</tt> +requires Perl version >= 5.0004_03. +</dd> +<dt>Make</dt> +<dd> If you want to install the system with the distributed +<tt>Makefile</tt>, +you need GNU-<tt>make</tt>. +If you don't have it, you +should execute the steps shown in the <tt>Makefile</tt> +manually. +</dd> +<dt>LaTeX</dt> +<dd> LaTeX2e is required. +</dd> +</dl> +<p> +<h2><a name="section_22">Changes</a></h2> + +Please check the file <a href ="latex2man-CHANGES"><tt>latex2man-CHANGES</tt></a> +for the list of changes. +<p> +<h2><a name="section_23">Version</a></h2> + +<p> +Version: 1.23 of 2008/11/11. +<p> +<h2><a name="section_24">License and Copyright</a></h2> + +<p> +<dl compact> +<dt>Copyright</dt> +<dd> © 1998, Dr. Jürgen Vollmer, Viktoriastraße 15, +D-76133 Karlsruhe, Germany, <a href ="mailto:Juergen.Vollmer@informatik-vollmer.de"><tt>Juergen.Vollmer@informatik-vollmer.de</tt></a> +<p> +The actual version of <tt>Latex2man</tt> +may be found on my homepage<br> + +<a href ="http://www.informatik-vollmer.de/software/latex2man.html"><tt>http://www.informatik-vollmer.de/software/latex2man.html</tt></a>. +<p> +</dd> +<dt>License</dt> +<dd> This program can be redistributed and/or modified under the +terms of the LaTeX Project Public License Distributed from CTAN archives +in directory <tt>macros/latex/base/lppl.txt</tt>; +either version 1 of the +License, or any later version. +<p> +</dd> +<dt>Misc</dt> +<dd> If you find this software useful, please send me a postcard from +the place where you are living. +</dd> +</dl> +<p> +<h2><a name="section_25">Author</a></h2> + +<p> +Dr. Jürgen Vollmer <br> + +Viktoriastraße 15 <br> + +D-76133 Karlsruhe <br> + +Email: <a href ="mailto:Juergen.Vollmer@informatik-vollmer.de"><tt>Juergen.Vollmer@informatik-vollmer.de</tt></a> +<br> +WWW: <a href ="http://www.informatik-vollmer.de"><tt>http://www.informatik-vollmer.de</tt></a>. +<p> +</body> +</html> +<!-- NOTE: This file is generated, DO NOT EDIT. --> diff --git a/Master/texmf-dist/doc/support/latex2man/latex2man.pdf b/Master/texmf-dist/doc/support/latex2man/latex2man.pdf Binary files differnew file mode 100644 index 00000000000..13768b901c3 --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/latex2man.pdf diff --git a/Master/texmf-dist/doc/support/latex2man/latex2man.tex b/Master/texmf-dist/doc/support/latex2man/latex2man.tex new file mode 100644 index 00000000000..b4d02ad8f83 --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/latex2man.tex @@ -0,0 +1,758 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% 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.187 2008/11/11 07:21:18 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 +%% Viktoriastrasse 15, D-76133 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[english]{article} +\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.187 2008/11/11 07:21:18 vollmer Exp $ +\setDate{\rcsInfoLongDate} +}{ +\setDate{2008/11/11} %%%% 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.23} + +\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} + \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}. + +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[\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.sty}] The \LaTeX\ package defining the environments and + commands. +\item[\File{latex2man.cfg}] The configuration file for \Prog{Latex2man} + \LaTeX-package. +\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. +\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+\textt{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{\Ä}; in HTML and \texttt{@"A} + in texinfo. +\end{description} + +\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} + +\subsection{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} + +\section{Changes} +%@% IF LATEX %@% +{\small\verbatiminput{CHANGES}} +%@% ELSE %@% +Please check the file \URL{latex2man-CHANGES} for the list of changes. +%@% END-IF %@% + +\section{Version} +%%%%%%%%%%%%%%%%% + +Version: \Version\ of \Date. + +\section{License and Copyright} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{description} +\item[Copyright] \copyright\ 1998, Dr.~Jürgen Vollmer, Viktoriastraße 15, + D-76133 Karlsruhe, Germany, \Email{Juergen.Vollmer@informatik-vollmer.de} + + + The actual 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 \\ +Viktoriastraße 15 \\ +D-76133 Karlsruhe \\ +Email: \Email{Juergen.Vollmer@informatik-vollmer.de} \\ +WWW: \URL{http://www.informatik-vollmer.de}. + +\LatexManEnd + +\end{document} diff --git a/Master/texmf-dist/doc/support/latex2man/latex2man.texi b/Master/texmf-dist/doc/support/latex2man/latex2man.texi new file mode 100644 index 00000000000..0614458666d --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/latex2man.texi @@ -0,0 +1,1005 @@ +\input texinfo @c -*-texinfo-*- +@c %**start of header +@setfilename latex2man.info +@settitle latex2man +@c %**end of header +@c Manual page created with latex2man on Di 11. Nov 08:21:27 CET 2008> +@c NOTE: This file is generated, DO NOT EDIT. +@dircategory Man-pages +@direntry +* Latex2man: (latex2man). Its Man-Page +@end direntry +@titlepage +@title latex2man +@subtitle Documentation Tools +@author Dr.~J@"urgen Vollmer +@end titlepage +@node Top, Description, (dir), (dir) +@top latex2man + +Latex2man +is a tool to translate UNIX manual pages written with +LaTeXinto a format understood by the UNIX 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). + +@section Synopsis + + +latex2man +[ -t@var{transfile} ] +[ -HMTL ] +[ -h ] +[ -V ] +[ -C@var{name} ] +@* +[ -a@var{char} ] +@var{infile} +@var{outfile} + +@menu +* Description:: +* Options:: +* Files:: +* See Also:: +* LaTeX commands:: +* Package Options:: +* Package Specific Environments:: +* Accepted LaTeX Environments:: +* Package Specific Macros:: +* Accepted Macros from the rcsinfo Package:: +* Accepted LaTeX Macros:: +* Conditional Text:: +* Translation of User Defined Macros:: +* Verbatim Environment:: +* Subsection works:: +* Subsubsection works:: +* Subsubsection still works:: +* General Remarks:: +* Some Bug Fix Tests:: +* Requirements:: +* Changes:: +* Version:: +* License and Copyright:: +* Author:: +@end menu +@node Description, Options, Top, Top +@section Description + +Latex2man +reads the file @var{infile} +and writes @var{outfile}. +The +input must be a LaTeX document using the latex2man +LaTeXpackage. +Latex2man +translates that document into the troff(1) +format using +the -man +macro package. + +Using the -H +option, HTML code can be produced, instead of +troff(1). + +Using the -T +option, TexInfo code can be produced, instead of +troff(1). + +Using the -M +option, troff(1) +input is produced. + +Using the -L +option, LaTeX ouput can be produced, instead of +troff(1). + +@node Options, Files, Description, Top +@section Options + +@table @samp +@item -t@var{transfile} +Translation for user defined LaTeX macros. +@item -M +Produce output suitable for the man(1) +command (default). +@item -H +Instead of producing output suitable for the man(1) +command, HTML code is produced (despite the name of the command). +@item -T +Instead of producing output suitable for the man(1) +command, TexInfo code is produced (despite the name of the command). The +generated @file{.texi}-file +may be processed with makeinfo(1) +(to produce an @file{.info}-file) +which in turn may be installed using +install-info(1). +The Info tags @t{@@dircategory} and +@t{@@direntry} are provided. +@item -L +The LaTeX source is written to the @var{outfile}. +This is +useful in conjunction with the -C@var{name} +option. +@item -C@var{name} +Output the conditional text for @var{name}. +If more +than one name should be given use quotes: -C@var{'name1 name2 ...'}@* + +The following names are defined automatically: +@itemize @bullet +@item +-H defines @t{HTML} +@item +-T defines @t{TEXI} +@item +-M defines @t{MAN} +@item +-L defines @t{LATEX} +@end itemize +@item -a@var{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 \SP) some +character has to be printed before the additional space. By default this +is a . (dot). The @var{char} +specifies an alternative for that first +character. Giving a blank to +-a +supresses the indentation of a line.@* + +Note: only for the first \SP of a series that @var{char} +is printed. +@item -h +Show a help text. +@item -V +Show version information. +@end table + +@node Files, See Also, Options, Top +@section Files + + +@table @samp +@item @file{latex2man.tex} +The LaTeX file containing this Man-page. +@item @file{latex2man.sty} +The LaTeX package defining the environments and +commands. +@item @file{latex2man.cfg} +The configuration file for Latex2man +LaTeX-package. +@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. +@end table + +@node See Also, LaTeX commands, Files, Top +@section See Also + + +LaTeX,TexInfo, troff(1), +groff(1), +makeinfo(1). + +@node LaTeX commands, Package Options, See Also, Top +@section LaTeX commands + + +The LaTeX package @t{latex2man} +is used to write the Man-pages with +LaTeX.Since we translate into other text formats, not all LaTeX stuff can +be translated. + +@node Package Options, Package Specific Environments, LaTeX commands, Top +@subsection Package Options + +The @t{latex2man} +package accepts the following options: + +@table @samp +@item fancy +use the LaTeX package @t{fancyheadings}. +@item fancyhdr +use the LaTeX package @t{fancyhdr}. +@item nofancy +neither the LaTeX package @t{fancyheadings} +nor +@t{fancyhdr} +are used. +@end table + +The default option may be specified in the file @t{latex2man.cfg}. + +@node Package Specific Environments, Accepted LaTeX Environments, Package Options, Top +@subsection Package Specific Environments + + +The following environments are provided by the package: +@table @samp +@item \begin@{Name@}@{chapter@}@{name@}@{author@}@{info@}@{title@} +The +@t{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 @t{Name} +environment must be the first +environment in the document. Processing starts with this environment. Any +text before this is ignored (exception: the @t{setVersion} and +@t{setDate} commands). (Note: all arguments of \begin@{Name@} must +be written on one line). +@item \begin@{Table@}[width]@{columns@} +The @t{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: + +@t{\begin@{Table@}[2cm]@{3@}} @* + +@t{Here & am & I \\\hline} @* + +@t{A 1 & A 2 & A 3 1 2 3 4 5 A 3 1 2 3 4 5 \\} @* + +@t{B 1 & B 2 & B 3 \\} @* + +@t{\end@{Table@}} + +will be typeset as: + +@multitable @columnfractions 0.3 0.3 0.3 +@item Here @tab am @tab I + +@item +A 1 @tab A 2 @tab A 3 1 2 3 4 5 A 3 1 2 3 4 5 + +@item B 1 @tab B 2 @tab B 3 + +@end multitable + +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 @t{p@{width@}} column is typeset +as last column. The translation to troff(1) +commands +results in a @t{lw(width)} +column specification. Translating +to HTML and TexInfo ignores the @emph{width} +parameter. + +@t{\hline} may be used. + +If the Man-page is formatted with troff(1) +and tables are used, the +tbl(1) +preprocessor should be called, usually by giving +a -t +to the call of troff(1). +When viewing the generated +manula page using man(1), +tbl(1) +is called automatically. +@item \begin@{Description@} +is the same as \begin@{description@} +@item \begin@{Description@}[label] +is similar to +\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. +@table @samp +@item a +|a @t{\begin@{description@}} +@item ab +|ab +@item abc +|abc +@end table +@table @samp +@item a +|a @t{\begin@{Description@}} +@item ab +|ab +@item abc +|abc +@end table +@table @samp +@item a +|a @t{\begin@{Description@}[aa]} +@item ab +|ab +@item abc +|abc +@end table +@end table + +@node Accepted LaTeX Environments, Package Specific Macros, Package Specific Environments, Top +@subsection Accepted LaTeX Environments + + +The following environments are accepted: +@itemize @bullet +@item +@t{description} +@item +@t{enumerate} +@item +@t{itemize} +@item +@t{verbatim} +@item +@t{center} +@end itemize + +They may be nested: +@itemize @bullet +@item +Itemize and nested center: + +@center A centered line.@* +@center Another centered line. +@center +@item +Another item an nested enumerate +@enumerate +@item +a +@item +b +@end enumerate +@end itemize + +@node Package Specific Macros, Accepted Macros from the rcsinfo Package, Accepted LaTeX Environments, Top +@subsection Package Specific Macros + + +The following commands are provided: +@table @samp +@item \Opt@{option@} +Option: @t{\Opt@{-o@}} will be typeset as -o. +@item \Arg@{argument@} +Argument: @t{\Arg@{filename@}} will be typeset as +@var{filename}. +@item \OptArg@{option@}@{argument@} +Option with Argument:@* + +@t{\OptArg@{-o@}@{filename@}} will be typeset as -o@var{filename}. +@item \OptoArg@{option@}@{argument@} +Option with optional Argument:@* + +@t{\OptoArg@{-o@}@{filename@}} will be +typeset as -o[@var{filename}]. +@item \oOpt@{option@} +Optional option, e.g. @t{\oOpt@{-o@}} will be +typeset as [ -o ]. +@item \oArg@{argument@} +Optional argument, e.g. @t{\oArg@{filename@}} +will be typeset as [ @var{filename} ]. +@item \oOptArg@{option@}@{argument@} +Optional option with argument, e.g.@* + +@t{\oOptArg@{-o@}@{filename@}} will be typeset as [ -o@var{filename} ]. +@item \oOptoArg@{option@}@{argument@} +Optional option with optional +argument, e.g. +@t{\oOptoArg@{-o@}@{filename@}} will be typeset as [ -o[@var{filename}] ]. +@item \File@{filename@} +used to typeset filenames, e.g. +@t{\File@{filename@}} will be typeset as @file{filename}. +@item \Prog@{prog@} +used to typeset program names, e.g. +@t{\Prog@{latex2man@}} will be typeset as latex2man. +@item \Cmd@{command@}@{chapter@} +used to typeset references to other +commands, e.g. @t{\Cmd@{latex2man@}@{1@}} will be typeset as +latex2man(1). +@item \Bar +is typeset as |. +@item \Bs +(BackSlash) is typeset as \. +@item \Tilde +is typeset as a ~. +@item \Dots +is typeset as ... +@item \Bullet +us typeset as *. +@item \setVersion@{..@} +set @t{..} as version information. +@item \setVersionWord@{..@} +set @t{..} for the word @emph{Version:} +in +the footline. The default is @t{\setVersionWord@{Version:@}}. +@item \Version +returns the version information. +@item \setDate@{..@} +sets @t{..} as date information. +@item \Date +returns the date information. +@item \Email@{..@} +use to mark an Email address:@* + +@t{\Email@{Juergen.Vollmer@@informatik-vollmer.de@}} is typeset as:@* + +@email{Juergen.Vollmer@@informatik-vollmer.de}. +@item \URL@{..@} +use to mark an URL: +@t{\URL@{http://www.foo.de/\Tilde vollmer@}} is typeset as +@url{http://www.foo.de/~vollmer}. +@item \LatexManEnd +the input file is read and processed until reading +end-of-file or @t{\LatexManEnd} (at the beginning of a line). +LaTeXignores this command. +@item \Lbr, \Rbr +is typeset as [ and ] (these variants are +needed only somtimes like in @t{item[FooBar\LBr xx \Lbr]}. Usually +@t{[ ]} will work. +@item \LBr, \RBr +is typeset as @{ and @} (these variants are +needed when using @{ or @} as arguments to macros. +@item \Circum +is typeset as ^. +@item \Percent +is typeset as %. +@item \TEXbr +If processed with LaTeX causes a linebreak (i.e. is +equivalent to \\).In the output of latex2man +this macro is +ignored. +@item \TEXIbr +If TexInfo output is generated, causes a linebreak (i.e. is +equivalent to \\),otherwise ignored. +@item \MANbr +If Man-Page output is generated, causes a linebreak (i.e. is +equivalent to \\),otherwise ignored. +@item \HTMLbr +If HTML output is generated, causes a linebreak (i.e. is +equivalent to \\),otherwise ignored. +@item \medskip +An empty line. +@item \SP +Produces some extra space, works also at the beginning of lines. +The code of the second line looks like: +@t{\SP abc \SP\SP xx\\}:@* + +abc @ @ @ @ @ @ xx@* + +.@ abc @ @ @ @ xx@* + +.@ .@ abc @ @ xx + +Note: Due to some ``problems'' with TexInfo, the lines starting with +@t{\SP} +have a leading . (dot) in the TexInfo output, +see -a@var{char}. +@end table + +@node Accepted Macros from the rcsinfo Package, Accepted LaTeX Macros, Package Specific Macros, Top +@subsection Accepted Macros from the rcsinfo Package + + +@table @samp +@item \rcsInfo $Id ...$ +if the LaTeX package @file{rcsinfo} +is used, +this command is used to extract the date of the Man-page. +@item \rcsInfoLongDate +if the LaTeX package @file{rcsinfo} +is used, this +command is used to typeset the date coded in the @t{$Id ..$} string. +@end table + +@node Accepted LaTeX Macros, Conditional Text, Accepted Macros from the rcsinfo Package, Top +@subsection Accepted LaTeX Macros + + +The following standard LaTeX commands are accepted: +@table @samp +@item \section@{..@} +The @t{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 @t{Name} +environment. + +Note: Do not use LaTeX-macrosin section names. +@item \subsection@{..@} +works as well as +@item \subsubsection@{..@} +those. +@item \emph@{..@} +@t{\emph@{example@}} is typeset as @emph{example}. +@item \textbf@{..@} +@t{\textbf@{example@}} is typeset as @strong{example}. +@item \texttt@{..@} +@t{\textt@{example@}} is typeset as @t{example}. +@item \underline@{..@} +@t{\underline@{example@}} is typeset as +example of underline. +@item \date@{..@} +uses @t{..} as date. +@item \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 $\ge$ +is typeset as $>=$. +@item $\le$ +is typeset as $<=$. +@item $\leftarrow$ +is typeset as $<--$. +@item $\Leftarrow$ +is typeset as $<==$. +@item $\rightarrow$ +is typeset as $-->$. +@item $\Rightarrow$ +is typeset as $==>$. +@item \@{ +is typeset as @{. +@item \@} +is typeset as @}. +@item \$ +is typeset as $. +@item \$ +is typeset as $,should be used inside macro +arguments. +@item \_ +is typeset as _. +@item \& +is typeset as &. +@item \# +is typeset as #. +@item \% +is typeset as %. +@item \, +is typeset as smaller blank - - (between the two -) +@item \- +is used to mark hyphenation in a word. +@item \\ +is typeset as a linebreak or marks the end of a column in the +@t{Table} +environment. +@item \ +(a \ 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 @t{\SP} +command). +@item ~ +is typeset as a blank. +@item \copyright +is typeset as @copyright{}. +@item \noindent +@item \hline +inside a @t{Table} +environment. +@item \item +inside a @t{itemize}, +@t{enumerate}, +or +@t{description} +environment. +@item \today +11 November 2008(see also the @t{rcsinfo} +LaTeXpackage). +@item \ss,\"a, ... +\ss = @ss{}, \"a= @"a, \"o= @"o, \"u= @"u, +\"A= @"A, \"O= @"O, \"U= @"U. It is allowed to surround these +macros in @{ and @} in all places, even inside other macros, e.g. +@* +.@ @ @ @ @ \textbf@{\"a\"o\"u\"A\"O\"U\ss@}@* +.@ @ @ @ @ \textbf@{\"a@}@{\"o@}@{\"u@}@{\"A@}@{\"O@}@{\"U@}@{\ss@}@}@* +.@ @ @ @ @ \textbf@{äöüÄÖÜß@}@* + +@strong{@"a@"o@"u@"A@"O@"U@ss{} @"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. @t{@"A} +becomes @t{Ä}; +in HTML and @t{@@"A} +in texinfo. +@end table + +@node Conditional Text, Translation of User Defined Macros, Accepted LaTeX Macros, Top +@subsection Conditional Text + + +latex2man +preprocesses the LaTeX input to allow text to be used +conditionally. A special sort of LaTeX comment is used for that purpose. +@itemize @bullet +@item +%@@% IF @emph{condition} %@@% +@item +%@@% ELSE %@@% +@item +%@@% END-IF %@@% +@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 -C@var{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 @t{IF/ELSE/END-IF} +may be nested. As boolean +operators the following are allowed: + +@multitable @columnfractions 0.45 0.45 +@item ||@tab boolean or + +@item && @tab boolean and + +@item ! @tab negation +@end multitable + +( and ) for grouping are allowed. + +@noindent + +For example:@* + +%@@% IF abc %@@%@* + +@t{}abc set@* + +@t{}%@@% IF xyz %@@%@* + +@t{}xyz set@* + +@t{}%@@% ELSE %@@%@* + +@t{}xyz NOT set@* + +@t{}%@@% END-IF %@@%@* + +%@@% ELSE %@@%@* + +@t{}abc NOT set@* + +@t{}%@@% IF xyz || !XYZ %@@%@* + +@t{}xyz OR !XYZ set@* + +@t{}%@@% ELSE %@@%@* + +@t{}xyz OR !XYZ NOT set@* + +@t{}%@@% END-IF %@@%@* + +%@@% END-IF %@@% + +@noindent + +Run this manual page through latex2man +with e.g. +-C@var{'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).@* + +abc NOT set@* + +xyz OR !XYZ set@* + + +@noindent + +To check the conditional text feature, when latex2man +is called with +@table @samp +@item -C@var{HTML} +the lines 1a, 2b, 3b, and 4b; +@item -C@var{TEXI} +the lines 1b, 2a, 3b, and 4b; +@item -C@var{MAN} +the lines 1b, 2b, 3a, and 4b; +@item -C@var{LATEX} +the lines 1b, 2b, 3b, and 4a; +@item calling LaTeX without preprocessing +all lines +@end table +should be shown: + +1b. The HTML conditional was not set. + +2a. This text occurs only when viewing the TEXI output + +3b. The MAN conditional was not set. + +4b. The LATEX conditional was not set. + +@node Translation of User Defined Macros, Verbatim Environment, Conditional Text, Top +@subsection Translation of User Defined Macros + + +The user macro translation file (given by the [ -t@var{transfile} ]) +contains +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: + +@itemize @bullet +@item +Comments start with a # up to the end of the line. +@item +For a macro @t{\foo} with no arguments, the following code must be +specified: +@table @samp +@item Translation to Man-Pages +@t{$manMacro@{'foo'@} = '...';} +@item Translation to HTML +@t{$htmlMacro@{'foo'@} = '...';} +@item Translation to TexInfo +@t{$texiMacro@{'foo'@} = '...';} +@end table + +where @t{...} is the translation. + +@item +For a macro @t{\foo@{..@}} with one argument, the following code must be +specified: +@table @samp +@item Translation to Man-Pages +@t{$manMacro1a@{'foo'@} = '...';}@* + +@t{$manMacro1b@{'foo'@} = '...';} +@item Translation to HTML +@t{$htmlMacro1a@{'foo'@} = '...';}@* + +@t{$htmlMacro1b@{'foo'@} = '...';} + +@item Translation to TexInfo +@t{$texiMacro1a@{'foo'@} = '...';}@* + +@t{$texiMacro1b@{'foo'@} = '...';} +@end table + +where @t{...} is the translation. The @t{1a} code is used before the +argument, while @t{1b} is typeset after the argument is set. + +@item +For a macro @t{\foo@{..@}@{..@}} with two arguments, the following code +must be specified: +@table @samp +@item Translation to Man-Pages +@t{$manMacro2a@{'foo'@} = '...';}@* + +@t{$manMacro2b@{'foo'@} = '...';}@* + +@t{$manMacro2c@{'foo'@} = '...';} +@item Translation to HTML +@t{$htmlMacro2a@{'foo'@} = '...';}@* + +@t{$htmlMacro2b@{'foo'@} = '...';}@* + +@t{$htmlMacro2c@{'foo'@} = '...';} +@item Translation to TexInfo +@t{$texiMacro2a@{'foo'@} = '...';}@* + +@t{$texiMacro2b@{'foo'@} = '...';}@* + +@t{$texiMacro2c@{'foo'@} = '...';} +@end table + +where @t{...} is the translation. The @t{2a} code is used before the +first argument, @t{2b} between the two arguments and @t{2c} is +typeset after the second argument is set. +@item +The file @file{latex2man.trans} contains some example code. +@end itemize + +@node Verbatim Environment, Subsection works, Translation of User Defined Macros, Top +@subsection Verbatim Environment + + +@* +.This@* +.@ @ @ @ @{is@}@* +.@ @ @ @ @ @ @ @ \texttt@{a@}@* +.@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ $test$@* +.@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ _of_@* +.verbatim@* +.<this@ is@ no@ HTML@ tag>@ and@ no@ @@*@ TexInfo@ command@* + +@node Subsection works, Subsubsection works, Verbatim Environment, Top +@subsection Subsection works + + +This is a @t{\subsection}. + +@node Subsubsection works, Subsubsection still works, Subsection works, Top +@subsubsection Subsubsection works + + +This is a @t{\subsubsection}. + +@node Subsubsection still works, General Remarks, Subsubsection works, Top +@subsubsection Subsubsection still works + + +This is another @t{\subsubsection}. + +@node General Remarks, Some Bug Fix Tests, Subsubsection still works, Top +@subsection General Remarks + + +@enumerate +@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 +latex2man requires Perl version >= 5.0004_03. +@item +If you want to install the system with the distributed @file{Makefile}, +you need GNU-make. +If you don't have it, you should execute the +steps shown in the @file{Makefile} +manually. +@end enumerate + +@node Some Bug Fix Tests, Requirements, General Remarks, Top +@subsection Some Bug Fix Tests + + +@table @samp +@item Leading . and ' +Now leading . and ' in generation troff output should work propperly, +since a @t{\&} is added. Therfore the @t{\Dot} macro has been deleted.@* + +Thanks to @email{Frank.Schilder@@Mathematik.Tu-Ilmenau.De}.@* + +Testcase 1: +@table @samp +@item '\n' +... +@end table +Testcase 2:@* + +@file{.foobar} +Testcase 3:@* + +... +abc ...abc . efg ' 123 + +@item % in verbatim +A % in a \verb and verbatim-environment was not +emitted correctly. Thanks to Aleksey Nogin @email{nogin@@cs.caltech.edu} +for the bug report and bug fix. + +@t{% abc} + +@* +.@ @ @ %@ abc@ %@* + +but ignore comments following this: + +@end table + +@node Requirements, Changes, Some Bug Fix Tests, Top +@section Requirements + + +@table @samp +@item Perl +latex2man +requires Perl version >= 5.0004_03. +@item Make +If you want to install the system with the distributed +@file{Makefile}, +you need GNU-make. +If you don't have it, you +should execute the steps shown in the @file{Makefile} +manually. +@item LaTeX +LaTeX2e is required. +@end table + +@node Changes, Version, Requirements, Top +@section Changes + +Please check the file @url{latex2man-CHANGES} +for the list of changes. + +@node Version, License and Copyright, Changes, Top +@section Version + + +Version: 1.23 of 2008/11/11. + +@node License and Copyright, Author, Version, Top +@section License and Copyright + + +@table @samp +@item Copyright +@copyright{}1998, Dr. J@"urgen Vollmer, Viktoriastra@ss{}e 15, +D-76133 Karlsruhe, Germany, @email{Juergen.Vollmer@@informatik-vollmer.de} + +The actual version of 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 table + +@node Author, , License and Copyright, Top +@section Author + + +@noindent + +Dr. J@"urgen Vollmer @* + +Viktoriastra@ss{}e 15 @* + +D-76133 Karlsruhe @* + +Email: @email{Juergen.Vollmer@@informatik-vollmer.de} +@* +WWW: @url{http://www.informatik-vollmer.de}. + +@bye +@c NOTE: This file is generated, DO NOT EDIT. diff --git a/Master/texmf-dist/doc/support/latex2man/latex2man.trans b/Master/texmf-dist/doc/support/latex2man/latex2man.trans new file mode 100644 index 00000000000..2b77cc2fc21 --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/latex2man.trans @@ -0,0 +1,67 @@ +################################################################################# +# Project: Documentation Tools +# Descr: Latex --> MAN-page (groff -man), and HTML; example of user macro +# translations +# Author: Dr. Jürgen Vollmer, Juergen.Vollmer@acm.org +# $Id: latex2man.trans,v 1.2 1998/01/03 17:06:52 vollmer Exp $ +################################################################################# + +################################################################################# +# translation for MAN +################################################################################# + +# LaTeX macros without arguments +$manMacro{'LaTeX'} = 'LaTeX'; +$manMacro{'LATEX'} = 'LaTeX'; # needed, since \LaTeX is contained in a + # section name (which are transposed + # into uppercase + +# LaTeX macros with one argument +$manMacro1a{'myEmph'} = '\n.IR "'; $manMacro1b{'myEmph'} = '"'; + +# LaTeX macros with two arguments +$manMacro2a{'myCmd'} = '\n.I "'; + $manMacro2b{'myCmd'} = '"\n('; + $manMacro2c{'myCmd'} = ')'; + +################################################################################# +# translation for HTML +################################################################################# + +# LaTeX macros without arguments +$htmlMacro{'LaTeX'} = 'LaTeX'; +$htmlMacro{'LATEX'} = 'LaTeX'; # needed, since \LaTeX is contained in a + # section name (which are transposed + # into uppercase + +# LaTeX macros with one argument +$htmlMacro1a{'myEmph'} = '<em>'; $htmlMacro1b{'myEmph'} = '</em>'; + +# LaTeX macros with two arguments +$htmlMacro2a{'Cmymd'} = '<em>'; + $htmlMacro2b{'myCmd'} = '</em>('; + $htmlMacro2c{'myCmd'} = ')'; + +################################################################################# +# translation for TexInfo +################################################################################# + +# LaTeX macros without arguments +$texiMacro{'LaTeX'} = 'LaTeX'; +$texiMacro{'LATEX'} = 'LaTeX'; # needed, since \LaTeX is contained in a + # section name (which are transposed + # into uppercase + +# LaTeX macros with one argument +$texiMacro1a{'myEmph'} = '@emph{'; $texiMacro1b{'myEmph'} = '}'; + +# LaTeX macros with two arguments +$texiMacro2a{'Cmymd'} = ''; + $texiMacro2b{'myCmd'} = ' ('; + $texiMacro2c{'myCmd'} = ')'; + +################################################################################# +## emacs variables +## Local Variables: *** +## mode: perl *** +## End: *** diff --git a/Master/texmf-dist/doc/support/latex2man/latex2man.txt b/Master/texmf-dist/doc/support/latex2man/latex2man.txt new file mode 100644 index 00000000000..2ded2fa1000 --- /dev/null +++ b/Master/texmf-dist/doc/support/latex2man/latex2man.txt @@ -0,0 +1,758 @@ +LATEX2MAN(1) Documentation Tools LATEX2MAN(1) + + + +NAME + Latex2man is a tool to translate UNIX manual pages written with LaTeX- + into a format understood by the UNIX 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). + + +SYNOPSIS + latex2man [-ttransfile] [-HMTL] [-h] [-V] [-Cname] [-achar] infile out- + file + + +DESCRIPTION + Latex2man reads the file infile and writes outfile. The input must be + a LaTeX document using the latex2man LaTeXpackage. Latex2man trans- + lates that document into the troff(1) format using the -man macro pack- + age. + + Using the -H option, HTML code can be produced, instead of troff(1). + + Using the -T option, TexInfo code can be produced, instead of troff(1). + + Using the -M option, troff(1) input is produced. + + Using the -L option, LaTeX ouput can be produced, instead of troff(1). + + +OPTIONS + -ttransfile + Translation for user defined LaTeX macros. + + -M Produce output suitable for the man(1) command (default). + + -H Instead of producing output suitable for the man(1) command, + HTML code is produced (despite the name of the command). + + -T Instead of producing output suitable for the man(1) command, + TexInfo code is produced (despite the name of the command). The + generated .texi-file may be processed with makeinfo(1) (to pro- + duce an .info-file) which in turn may be installed using + install-info(1). The Info tags @dircategory and @direntry are + provided. + + -L The LaTeX source is written to the outfile. This is useful in + conjunction with the -Cname option. + + -Cname Output the conditional text for name. If more than one name + should be given use quotes: -C'name1 name2 ...' + The following names are defined automatically: + + * -H defines HTML + + * -T defines TEXI + + * -M defines MAN + + * -L defines LATEX + + + -achar 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 \SP) some character has to be printed before the addi- + tional space. By default this is a . (dot). The char specifies + an alternative for that first character. Giving a blank to -a + supresses the indentation of a line. + Note: only for the first \SP of a series that char is printed. + + -h Show a help text. + + -V Show version information. + + +FILES + latex2man.tex + The LaTeX file containing this Man-page. + + latex2man.sty + The LaTeX package defining the environments and commands. + + latex2man.cfg + The configuration file for Latex2man LaTeX-package. + + latex2man.trans + File containing example translations of user defined LaTeX + macros. + + fancyheadings.sty + A LaTeX package used to typeset head- and foot lines. + + fancyhdr.sty + A LaTeX package used to typeset head- and foot lines. + + rcsinfo.sty + A LaTeX package used to extract and use RCS version control + information in LaTeX documents. + + +SEE ALSO + LaTeX,TexInfo, troff(1), groff(1), makeinfo(1). + + +LaTeX COMMANDS + The LaTeX package latex2man is used to write the Man-pages with + LaTeX.Since we translate into other text formats, not all LaTeX stuff + can be translated. + + + PACKAGE OPTIONS + The latex2man package accepts the following options: + + + fancy use the LaTeX package fancyheadings. + + fancyhdr + use the LaTeX package fancyhdr. + + nofancy + neither the LaTeX package fancyheadings nor fancyhdr are used. + + The default option may be specified in the file latex2man.cfg. + + + PACKAGE SPECIFIC ENVIRONMENTS + The following environments are provided by the package: + + \begin{Name}{chapter}{name}{author}{info}{title} + The 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 + Name environment must be the first environment in the document. + Processing starts with this environment. Any text before this is + ignored (exception: the setVersion and setDate commands). (Note: + all arguments of \begin{Name} must be written on one line). + + \begin{Table}[width]{columns} + The 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: + + \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} + + will be typeset as: + + + Here am I + ---------------------- + A 1 A 2 A 3 1 2 + 3 4 5 A + 3 1 2 3 + 4 5 + B 1 B 2 B 3 + + If no optional width argument is given, all entries are typeset left + justified. The width is a length measured absolutly in cm. Processing + with LaTeX a p{width} column is typeset as last column. The translation + to troff(1) commands results in a lw(width) column specification. + Translating to HTML and TexInfo ignores the width parameter. + + \hline may be used. + + If the Man-page is formatted with troff(1) and tables are used, the + tbl(1) preprocessor should be called, usually by giving a -t to the + call of troff(1). When viewing the generated manula page using man(1), + tbl(1) is called automatically. + + \begin{Description} + is the same as \begin{description} + + \begin{Description}[label] + is similar to \begin{description}, but the item labels have at + minimum the size of the (optional) word label. The difference + is visible only in the DVI and PDF-output, not in the troff, + TexInfo or HTML output. + + a |a \begin{description} + + ab |ab + + abc |abc + + + a |a \begin{Description} + + ab |ab + + abc |abc + + + a |a \begin{Description}[aa] + + ab |ab + + abc |abc + + + + ACCEPTED LaTeX ENVIRONMENTS + The following environments are accepted: + + * description + + * enumerate + + * itemize + + * verbatim + + * center + + They may be nested: + + * Itemize and nested center: + A centered line. + Another centered line. + + + * Another item an nested enumerate + + 1. a + + 2. b + + + + PACKAGE SPECIFIC MACROS + The following commands are provided: + + \Opt{option} + Option: \Opt{-o} will be typeset as -o. + + \Arg{argument} + Argument: \Arg{filename} will be typeset as filename. + + \OptArg{option}{argument} + Option with Argument: + \OptArg{-o}{filename} will be typeset as -ofilename. + + \OptoArg{option}{argument} + Option with optional Argument: + \OptoArg{-o}{filename} will be typeset as -o[filename]. + + \oOpt{option} + Optional option, e.g. \oOpt{-o} will be typeset as [-o]. + + \oArg{argument} + Optional argument, e.g. \oArg{filename} will be typeset as + [filename]. + + \oOptArg{option}{argument} + Optional option with argument, e.g. + \oOptArg{-o}{filename} will be typeset as [-ofilename]. + + \oOptoArg{option}{argument} + Optional option with optional argument, e.g. \oOp- + toArg{-o}{filename} will be typeset as [-o[filename]]. + + \File{filename} + used to typeset filenames, e.g. \File{filename} will be typeset + as filename. + + \Prog{prog} + used to typeset program names, e.g. \Prog{latex2man} will be + typeset as latex2man. + + \Cmd{command}{chapter} + used to typeset references to other commands, e.g. + \Cmd{latex2man}{1} will be typeset as latex2man(1). + + \Bar is typeset as |. + + \Bs (BackSlash) is typeset as \. + + \Tilde is typeset as a ~. + + \Dots is typeset as ... + + + \Bullet + us typeset as *. + + \setVersion{..} + set .. as version information. + + \setVersionWord{..} + set .. for the word Version: in the footline. The default is + \setVersionWord{Version:}. + + \Version + returns the version information. + + \setDate{..} + sets .. as date information. + + \Date returns the date information. + + \Email{..} + use to mark an Email address: + \Email{Juergen.Vollmer@informatik-vollmer.de} is typeset as: + Juergen.Vollmer@informatik-vollmer.de. + + \URL{..} + use to mark an URL: \URL{http://www.foo.de/\Tilde vollmer} is + typeset as http://www.foo.de/~vollmer. + + \LatexManEnd + the input file is read and processed until reading end-of-file + or \LatexManEnd (at the beginning of a line). LaTeXignores this + command. + + \Lbr, \Rbr + is typeset as [ and ] (these variants are needed only somtimes + like in item[FooBar\LBr xx \Lbr]. Usually [ ] will work. + + \LBr, \RBr + is typeset as { and } (these variants are needed when using { or + } as arguments to macros. + + \Circum + is typeset as ^. + + \Percent + is typeset as %. + + \TEXbr If processed with LaTeX causes a linebreak (i.e. is equivalent + to \\).In the output of latex2man this macro is ignored. + + \TEXIbr + If TexInfo output is generated, causes a linebreak (i.e. is + equivalent to \\),otherwise ignored. + + \MANbr If Man-Page output is generated, causes a linebreak (i.e. is + equivalent to \\),otherwise ignored. + + \HTMLbr + If HTML output is generated, causes a linebreak (i.e. is equiv- + alent to \\),otherwise ignored. + + \medskip + An empty line. + + \SP Produces some extra space, works also at the beginning of lines. + The code of the second line looks like: \SP abc \SP\SP xx\\: + abc xx + abc xx + abc xx + + Note: Due to some ``problems'' with TexInfo, the lines starting with + \SP have a leading . (dot) in the TexInfo output, see -achar. + + + ACCEPTED MACROS FROM THE RCSINFO PACKAGE + \rcsInfo $Id ...$ + if the LaTeX package rcsinfo is used, this command is used to + extract the date of the Man-page. + + \rcsInfoLongDate + if the LaTeX package rcsinfo is used, this command is used to + typeset the date coded in the $Id ..$ string. + + + ACCEPTED LaTeX MACROS + The following standard LaTeX commands are accepted: + + \section{..} + The 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: Name (special + handling as environment, c.f. above), Synopsis, Description, + Options, Files, See Also, Diagnostics, Return Values, Bugs, + Author, version, etc. + + Synopsis must be the first section after the Name environment. + + Note: Do not use LaTeX-macrosin section names. + + \subsection{..} + works as well as + + \subsubsection{..} + those. + + \emph{..} + \emph{example} is typeset as example. + + \textbf{..} + \textbf{example} is typeset as example. + + \texttt{..} + \textt{example} is typeset as example. + + \underline{..} + \underline{example} is typeset as example of underline . + + \date{..} + uses .. as date. + + \verb+..+ + but only + is allowed as delimiter. + + $<$ is typeset as <. + + $>$ is typeset as >. + + $<=$ is typeset as <=. + + $>=$ is typeset as >=. + + $=$ is typeset as =. + + $<>$ is typeset as <>. + + $\ge$ is typeset as $>=$. + + $\le$ is typeset as $<=$. + + $\leftarrow$ + is typeset as $<--$. + + $\Leftarrow$ + is typeset as $<==$. + + $\rightarrow$ + is typeset as $-->$. + + $\Rightarrow$ + is typeset as $==>$. + + \{ is typeset as {. + + \} is typeset as }. + + \$ is typeset as $. + + \$ is typeset as $,should be used inside macro + arguments. + + \_ is typeset as _. + + \& is typeset as &. + + \# is typeset as #. + + \% is typeset as %. + + \, is typeset as smaller blank - - (between the two -) + + \- is used to mark hyphenation in a word. + + \\ is typeset as a linebreak or marks the end of a column in the + Table environment. + + \ (a \ 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 \SP command). + + ~ is typeset as a blank. + + \copyright + is typeset as (C). + + \noindent + + \hline inside a Table environment. + + \item inside a itemize, enumerate, or description environment. + + \today 11 November 2008(see also the rcsinfo LaTeXpackage). + + \ss,\"a, ... + \ss = ß, \"a= ä, \"o= ö, \"u= ü, \"A= Ä, \"O= Ö, \"U= Ü. It is + allowed to surround these macros in { and } in all places, even + inside other macros, e.g. + \textbf{\"a\"o\"u\"A\"O\"U\ss} + \textbf{\"a}{\"o}{\"u}{\"A}{\"O}{\"U}{\ss}} + \textbf{äöüÄÖÜß} + + + äöüÄÖÜß äöüÄÖÜß äöüÄÖÜß + + 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. Ä becomes Ä in HTML and @"A in texinfo. + + + CONDITIONAL TEXT + latex2man preprocesses the LaTeX input to allow text to be used condi- + tionally. A special sort of LaTeX comment is used for that purpose. + + * %@% IF condition %@% + + * %@% ELSE %@% + + * %@% END-IF %@% + + A line must contain only such a comment and nothing else. condition is + a boolean expression containing ``names'' and operators. The names + given with the -Cname 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 IF/ELSE/END-IF may be + nested. As boolean operators the following are allowed: + + + + ( and ) for grouping are allowed. + + For example: + %@% 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 %@% + + Run this manual page through latex2man with e.g. -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). + abc NOT set + xyz OR !XYZ set + + To check the conditional text feature, when latex2man is called with + + -CHTML the lines 1a, 2b, 3b, and 4b; + + -CTEXI the lines 1b, 2a, 3b, and 4b; + + -CMAN the lines 1b, 2b, 3a, and 4b; + + -CLATEX + the lines 1b, 2b, 3b, and 4a; + + calling LaTeX without preprocessing + all lines + + should be shown: + + 1b. The HTML conditional was not set. + + 2b. The TEXI conditional was not set. + + 3a. This text occurs only when viewing the MAN output + + 4b. The LATEX conditional was not set. + + + TRANSLATION OF USER DEFINED MACROS + The user macro translation file (given by the [-ttransfile]) contains + 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: + + + * Comments start with a # up to the end of the line. + + * For a macro \foo with no arguments, the following code must be + specified: + + Translation to Man-Pages + $manMacro{'foo'} = '...'; + + Translation to HTML + $htmlMacro{'foo'} = '...'; + + Translation to TexInfo + $texiMacro{'foo'} = '...'; + + where ... is the translation. + + + * For a macro \foo{..} with one argument, the following code must + be specified: + + Translation to Man-Pages + $manMacro1a{'foo'} = '...'; + $manMacro1b{'foo'} = '...'; + + Translation to HTML + $htmlMacro1a{'foo'} = '...'; + $htmlMacro1b{'foo'} = '...'; + + + Translation to TexInfo + $texiMacro1a{'foo'} = '...'; + $texiMacro1b{'foo'} = '...'; + + where ... is the translation. The 1a code is used before the + argument, while 1b is typeset after the argument is set. + + + * For a macro \foo{..}{..} with two arguments, the following code + must be specified: + + Translation to Man-Pages + $manMacro2a{'foo'} = '...'; + $manMacro2b{'foo'} = '...'; + $manMacro2c{'foo'} = '...'; + + Translation to HTML + $htmlMacro2a{'foo'} = '...'; + $htmlMacro2b{'foo'} = '...'; + $htmlMacro2c{'foo'} = '...'; + + Translation to TexInfo + $texiMacro2a{'foo'} = '...'; + $texiMacro2b{'foo'} = '...'; + $texiMacro2c{'foo'} = '...'; + + where ... is the translation. The 2a code is used before the + first argument, 2b between the two arguments and 2c is typeset + after the second argument is set. + + * The file latex2man.trans contains some example code. + + + VERBATIM ENVIRONMENT + This + {is} + \texttt{a} + $test$ + _of_ + verbatim + <this is no HTML tag> and no @* TexInfo command + + + + SUBSECTION WORKS + This is a \subsection. + + + Subsubsection works + This is a \subsubsection. + + + Subsubsection still works + This is another \subsubsection. + + + GENERAL REMARKS + 1. Empty lines are typeset as paragraph separators. + + 2. The arguments of the LaTeX commands must not be split over sev- + eral lines. + + 3. Do not nest calls to macros. + + 4. 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. + + 5. latex2man requires Perl version >= 5.0004_03. + + 6. If you want to install the system with the distributed Makefile, + you need GNU-make. If you don't have it, you should execute the + steps shown in the Makefile manually. + + + SOME BUG FIX TESTS + Leading . and ' + Now leading . and ' in generation troff output should work prop- + perly, since a \& is added. Therfore the \Dot macro has been + deleted. + Thanks to Frank.Schilder@Mathematik.Tu-Ilmenau.De. + Testcase 1: + + '\n' ... + + Testcase 2: + .foobar Testcase 3: + ... + + abc ... abc . efg ' 123 + + + %in verbatim + A % in a \verb and verbatim-environment was not emitted cor- + rectly. Thanks to Aleksey Nogin nogin@cs.caltech.edu for the bug + report and bug fix. + + % abc + + % abc % + + + but ignore comments following this: + + +REQUIREMENTS + Perl latex2man requires Perl version >= 5.0004_03. + + Make If you want to install the system with the distributed Makefile, + you need GNU-make. If you don't have it, you should execute the + steps shown in the Makefile manually. + + LaTeX LaTeX2e is required. + + +CHANGES + Please check the file latex2man-CHANGES for the list of changes. + + +VERSION + Version: 1.23 of 2008/11/11. + + +LICENSE AND COPYRIGHT + Copyright + (C)1998, Dr. Jürgen Vollmer, Viktoriastraße 15, D-76133 Karl- + sruhe, Germany, Juergen.Vollmer@informatik-vollmer.de + + The actual version of Latex2man may be found on my homepage + http://www.informatik-vollmer.de/software/latex2man.html. + + + 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. + + + Misc If you find this software useful, please send me a postcard from + the place where you are living. + + +AUTHOR + Dr. Jürgen Vollmer + Viktoriastraße 15 + D-76133 Karlsruhe + Email: Juergen.Vollmer@informatik-vollmer.de + WWW: http://www.informatik-vollmer.de. + + + + +Documentation Tools 2008/11/11 LATEX2MAN(1) diff --git a/Master/texmf-dist/scripts/latex2man/latex2man b/Master/texmf-dist/scripts/latex2man/latex2man new file mode 100755 index 00000000000..45da55fb578 --- /dev/null +++ b/Master/texmf-dist/scripts/latex2man/latex2man @@ -0,0 +1,1817 @@ +#!/usr/bin/env perl +# Project: Documentation Tools +# Descr: Latex --> MAN-page (groff -man), HTML and TexInfo; +# Language: PERL (>= 5.0) +# Author: Dr. Jürgen Vollmer, Juergen.Vollmer@informatik-vollmer.de +# $Id: latex2man,v 1.151 2008/11/11 07:21:14 vollmer Exp $ +# +# Copyright (C) 1998 Dr. Juergen Vollmer +# Viktoriastrasse 15, D-76133 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. + +require 5.0004_03; + +use Getopt::Std; + +# use strict 'vars'; + +$CMD=`basename $0`; chop ($CMD); +$gen_date = `date`; chomp $gen_date; # date when the output was generated + +sub date2str; +$VERSION = "1.23"; +$DATE = date2str ('$Date: 2008/11/11 07:21:14 $' =~ m|(\d+/\d+/\d+)|); + +$tmp = "/tmp/$CMD.$$"; + +################################################################## +# check option and arguments +################################################################## + +getopts('o:t:VhMHTLC:D:a:'); # -D1: write each read line -D2: write each word + +sub usage +{ +print <<'END'; +usage: latex2man [-t transfile] [-HTML] [-C name] [-h] [-V] infile outfile. + A tool to translate UNIX manual pages written with LaTeX into a format + understood by the UNIX man(1)-command. + Reads infile, writes outfile. + + -t transfile: Translation for user defined LaTeX macros. + -M: Produce output suitable for the man(1) command (default). + -H: Instead of producing output suitable for the man(1) command, + HTML code is produced (despite of the name of the command). + -T: Instead of producing output suitable for the man(1) command, + TEXINFO code is produced (despite of the name of the command). + -L: Output the LaTeX source. Useful in conjunctin with the -C + option. + -C name: Enable conditional text \`name\'. + To enable more than one conditional name use quotes: + -C 'name1 name2 ...' + The following names are defined automatically: + -H defines HTML + -T defines TEXI + -M defines MAN + -L defines LATEX + -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 \SP) some character has to be printed + before the additional space. By default this is a . (dot). + The \`char' specifies an alternative for that first character. + Giving a blank (-a" ") supresses the indentation of a line. + Note: only for the first \SP of a series that char is printed. + -h: Help. + -V: Version. + + Copyright (C) 1998 Dr. Jürgen Vollmer, Viktoriastr. 15, D-76133 Karlsruhe + email: 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 from the place + where you are living. +END + print " Version $VERSION, $DATE.\n"; + exit 1; +} + +($opt_h) && usage; +($opt_V) && print "Version: $VERSION, $DATE\n"; + +# check command line arguments +$opt_cnt = 0; +$opt_cnt++ if ($opt_H); +$opt_cnt++ if ($opt_T); +$opt_cnt++ if ($opt_M); +$opt_cnt++ if ($opt_L); +if ($opt_cnt == 0) { + # if no option -H, -T, -M, -L is given, -M is the default + $opt_M = 1; +} +die "$CMD: you may give only one of the -H -T -M -L options\n" if ($opt_cnt > 1); + +(@ARGV == 2) || die "$CMD: Expected two arguments: infile outfile. Try \`$CMD -h'.\n"; + +my %cond_name; +if ($opt_C) { + my $name; + foreach $name ((split (/\s/, $opt_C))) { + $cond_name{$name} = 1; + } +} +$cond_name{MAN} = 1 if ($opt_M); +$cond_name{HTML} = 1 if ($opt_H); +$cond_name{TEXI} = 1 if ($opt_T); +$cond_name{LATEX} = 1 if ($opt_L); + + +$SrcFile = $ARGV[0]; +$DestFile = $ARGV[1]; +open (SRC, "<$SrcFile") || die "$CMD: Can't open file \`$SrcFile' for reading.\n"; +if ($opt_H || $opt_T) { + # DestFile will be written in the postprocess + open (DEST, ">$tmp") || die "$CMD: Can't open file \`$tmp' for writing.\n"; +} else { + open (DEST, ">$DestFile") || die "$CMD: Can't open file \`$DestFile' for writing.\n"; +} + +######################################################################## + +# global variables + +# $Prefix is used to construct procedure and variable names +if ($opt_M) { + $Prefix = "man"; +} +if ($opt_H) { + $Prefix = "html"; +} +if ($opt_T) { + $Prefix = "texi"; +} + +$texiCenterLine = 0; # true, only in TEXI-mode if a line must be centered +$paragraph = 0; # true, if the last output was a paragraph marker +$newline = 0; # true, if the last output was a newline char + +$first_word = 1; # true, if the next word to be processed is the first + # of a new paragraph or after a line break. + +# handling of itemize/enumerate/description environments: +$list_nest = 0; # counts nesting of itemize/enumerate/description envrionments +$cur_list[0] = "";# array, indexed with list_nest, indicates kind of list: + # values are: 'enum' / 'descr' / 'item' +$item_nr[0] = 0; # array, indexed with list_nest, counts the number of \item in the + # list +$manRS = 0; # true, if for Man a .RS was given after a \item + +$inside_verb = 0; # true, if inside a verbatim environment +$inside_table = 0; # true, if inside a table environment +$first_column = 0; # true, if this is the first column in a table row +$columns = 0; # nr of columns in the current table +$enum_nr = 0; # current number of an enumeration +$nesting = 0; # count recursive calls of interpret_word +$section_cnt = 0; # Index into $sections +#$sections[0] # Array of all sections +#$section_kind # Array of section kind (subsection/section) + +# translation of LaTeX macros without, with one and with two arguments +$Macro = \%{$Prefix . "Macro"}; +$Macro1a = \%{$Prefix . "Macro1a"}; +$Macro1b = \%{$Prefix . "Macro1b"}; +$Macro2a = \%{$Prefix . "Macro2a"}; +$Macro2b = \%{$Prefix . "Macro2b"}; +$Macro2c = \%{$Prefix . "Macro2c"}; + +# translations of special characters +$LetterCode = \%{$Prefix . "LetterCode"}; + +######################################################################## + +sub interpret_word; +sub interpret_line; +sub Print; +sub PrintM; +sub NL; + +######################################################################## +# Translation for LaTeX macros for MAN + +# translation of special characters +$manLetterCode{'ä'} = 'ä'; +$manLetterCode{'ö'} = 'ö'; +$manLetterCode{'ü'} = 'ü'; +$manLetterCode{'Ä'} = 'Ä'; +$manLetterCode{'Ö'} = 'Ö'; +$manLetterCode{'Ü'} = 'Ü'; +$manLetterCode{'ß'} = 'ß'; + +# LaTeX macros without arguments +$manMacro{'LaTeX'} = 'LaTeX'; +$manMacro{'LATEX'} = 'LaTeX'; # needed, since \LaTeX is contained in a + # section name (which are transposed + # into uppercase +$manMacro{'itemsep'} = ' '; + +# some math +$manMacro{'rightarrow'} = '-->'; +$manMacro{'Rightarrow'} = '==>'; +$manMacro{'leftarrow'} = '<--'; +$manMacro{'Leftarrow'} = '<=='; +$manMacro{'ge'} = '>='; +$manMacro{'le'} = '<='; + +$manMacro{'Dollar'} = '$'; +$manMacro{'Bar'} = '|'; +$manMacro{'Bs'} = '\\\\'; +$manMacro{'Tilde'} = '~'; +$manMacro{'hline'} = '\n_'; +$manMacro{'noindent'} = ''; +$manMacro{'copyright'} = '(C)'; +$manMacro{'Dots'} = '\&...\n'; +$manMacro{'Circum'} = '^'; +$manMacro{'Lbr'} = '['; +$manMacro{'Rbr'} = ']'; +$manMacro{'LBr'} = '{'; +$manMacro{'RBr'} = '}'; +$manMacro{'Percent'} = '%'; +$manMacro{'Bullet'} = '*'; +$manMacro{'TEXbr'} = ''; +$manMacro{'MANbr'} = '\n.br\n'; +$manMacro{'TEXIbr'} = ''; +$manMacro{'HTMLbr'} = ''; +$manMacro{'medskip'} = '\n'; +$manMacro{'SP'} = '\fB \fP'; # hack hack this works even on + # the beginning of a line +$manMacro{'SPfirst'} = $manMacro{'SP'}; + +$manMacro{'~'} = ' '; +$manMacro{'|'} = '|'; +$manMacro{'<'} = '<'; +$manMacro{'>'} = '>'; +$manMacro{'<='} = '<='; +$manMacro{'>='} = '>='; +$manMacro{'='} = '='; +$manMacro{'<>'} = '<>'; +$manMacro{'{'} = '{'; +$manMacro{'}'} = '}'; +$manMacro{'_'} = '_'; +$manMacro{'$'} = '$'; +$manMacro{'#'} = '#'; +$manMacro{'&'} = '&'; +$manMacro{'%'} = '%'; +$manMacro{'-'} = ''; +$manMacro{','} = ' '; + +$manMacro{'\\'} = '\n.br'; # line break +$manMacro{'\\Tab'} = '\nT}'; # end of column in a table environment + +# LaTeX macros with one argument +$manMacro1a{'emph'} = '\fI'; + $manMacro1b{'emph'} = '\fP'; +$manMacro1a{'textbf'} = '\fB'; + $manMacro1b{'textbf'} = '\fP'; +$manMacro1a{'texttt'} = ''; + $manMacro1b{'texttt'} = ''; +$manMacro1a{'verb'} = ''; + $manMacro1b{'verb'} = ''; +$manMacro1a{'underline'} = '\n.ul\n'; + $manMacro1b{'underline'}= '\n'; +$manMacro1a{'section'} = '\n.SH '; + $manMacro1b{'section'} = '\n'; +$manMacro1a{'subsection'} = '\n.SS '; + $manMacro1b{'subsection'} = ''; +$manMacro1a{'subsubsection'} = '\n.SS '; + $manMacro1b{'subsubsection'} = ''; + +$manMacro1a{'Prog'} = ''; + $manMacro1b{'Prog'} = ''; +$manMacro1a{'File'} = ''; + $manMacro1b{'File'} = ''; +$manMacro1a{'Opt'} = '\fB'; + $manMacro1b{'Opt'} = '\fP'; +$manMacro1a{'oOpt'} = '[\fB'; + $manMacro1b{'oOpt'} = '\fP]'; +$manMacro1a{'Arg'} = '\fI'; + $manMacro1b{'Arg'} = '\fP'; +$manMacro1a{'oArg'} = '[\fI'; + $manMacro1b{'oArg'} = '\fP]'; +$manMacro1a{'Email'} = '\fB'; + $manMacro1b{'Email'} = '\fP'; +$manMacro1a{'URL'} = '\fB'; + $manMacro1b{'URL'} = '\fP'; + +# LaTeX macros with two arguments +$manMacro2a{'Cmd'} = '\fI'; + $manMacro2b{'Cmd'} = '\fP('; + $manMacro2c{'Cmd'} = ')'; +$manMacro2a{'OptArg'} = '\fB'; + $manMacro2b{'OptArg'} = '\fP\fI'; + $manMacro2c{'OptArg'} = '\fP'; +$manMacro2a{'OptoArg'} = '\fB'; + $manMacro2b{'OptoArg'} = '\fP[\fI'; + $manMacro2c{'OptoArg'} = '\fP]'; +$manMacro2a{'oOptArg'} = '[\fB'; + $manMacro2b{'oOptArg'} = '\fP\fI'; + $manMacro2c{'oOptArg'} = '\fP]'; +$manMacro2a{'oOptoArg'} = '[\fB'; + $manMacro2b{'oOptoArg'} = '\fP[\fI'; + $manMacro2c{'oOptoArg'} = '\fP]]'; +$manMacro2a{'setlength'} = ''; + $manMacro2b{'setlength'}= ''; + $manMacro2c{'setlength'}= ''; + +######################################################################## +# Translation for LaTeX macros for HTML + +# translation of special characters +$htmlLetterCode{'ä'} = 'ä'; +$htmlLetterCode{'ö'} = 'ö'; +$htmlLetterCode{'ü'} = 'ü'; +$htmlLetterCode{'Ä'} = 'Ä'; +$htmlLetterCode{'Ö'} = 'Ö'; +$htmlLetterCode{'Ü'} = 'Ü'; +$htmlLetterCode{'ß'} = 'ß'; + +# LaTeX macros without arguments +$htmlMacro{'LaTeX'} = 'LaTeX'; +$htmlMacro{'LATEX'} = 'LaTeX'; # needed, since \LaTeX is contained in a + # section name (which are transposed + # into uppercase +$htmlMacro{'itemsep'} = ''; + +# some math +$htmlMacro{'rightarrow'} = '-->'; +$htmlMacro{'Rightarrow'} = '==>'; +$htmlMacro{'leftarrow'} = '<--'; +$htmlMacro{'Leftarrow'} = '<=='; +$htmlMacro{'ge'} = '>'; +$htmlMacro{'le'} = '<='; + +$htmlMacro{'Dollar'} = '$'; +$htmlMacro{'Bar'} = '|'; +$htmlMacro{'Bs'} = '\\'; +$htmlMacro{'Tilde'} = '~'; +$htmlMacro{'hline'} = ''; +$htmlMacro{'noindent'} = ''; +$htmlMacro{'copyright'} = '©'; +$htmlMacro{'Dots'} = '...'; +$htmlMacro{'Circum'} = '^'; +$htmlMacro{'Lbr'} = '['; +$htmlMacro{'Rbr'} = ']'; +$htmlMacro{'LBr'} = '{'; +$htmlMacro{'RBr'} = '}'; +$htmlMacro{'Percent'} = '%'; +$htmlMacro{'Bullet'} = '*'; +$htmlMacro{'TEXbr'} = ''; +$htmlMacro{'MANbr'} = ''; +$htmlMacro{'TEXIbr'} = ''; +$htmlMacro{'HTMLbr'} = '<br>\n'; +$htmlMacro{'medskip'} = '<br>\n'; +$htmlMacro{'SP'} = ' '; +$htmlMacro{'SPfirst'} = $htmlMacro{'SP'}; + +$htmlMacro{'~'} = ' '; +$htmlMacro{'|'} = '|'; +$htmlMacro{'<'} = '<'; +$htmlMacro{'>'} = '>'; +$htmlMacro{'<='} = '<='; +$htmlMacro{'>='} = '>='; +$htmlMacro{'='} = '='; +$htmlMacro{'<>'} = '<>'; +$htmlMacro{'{'} = '{'; +$htmlMacro{'}'} = '}'; +$htmlMacro{'_'} = '_'; +$htmlMacro{'$'} = '$'; +$htmlMacro{'#'} = '#'; +$htmlMacro{'&'} = '&'; +$htmlMacro{'%'} = '%'; +$htmlMacro{'-'} = ''; +$htmlMacro{','} = ' '; + +$htmlMacro{'\\'} = '<br>\n'; # line break +$htmlMacro{'\\Tab'} = '</td>\n</tr>\n'; # end of column in a table environment + +# LaTeX macros with one argument +$htmlMacro1a{'emph'} = '<em>'; + $htmlMacro1b{'emph'} = '</em>'; +$htmlMacro1a{'textbf'} = '<strong>'; + $htmlMacro1b{'textbf'} = '</strong>'; +$htmlMacro1a{'texttt'} = '<tt>'; + $htmlMacro1b{'texttt'} = '</tt>'; +$htmlMacro1a{'verb'} = '<tt>'; + $htmlMacro1b{'verb'} = '</tt>'; +$htmlMacro1a{'underline'} = '<u>'; + $htmlMacro1b{'underline'} = '</u>'; +$htmlMacro1a{'section'} = '\n<h2>'; + $htmlMacro1b{'section'} = '</h2>\n'; +$htmlMacro1a{'subsection'} = '\n<h4>'; + $htmlMacro1b{'subsection'} = '</h4>\n'; +$htmlMacro1a{'subsubsection'} = '\n<h5>'; + $htmlMacro1b{'subsubsection'} = '</h5>\n'; +$htmlMacro1a{'Email'} = '\n<tt>'; + $htmlMacro1b{'Email'} = '</tt>'; +$htmlMacro1a{'URL'} = '\n<tt>'; + $htmlMacro1b{'URL'} = '</tt>'; + +$htmlMacro1a{'Prog'} = '<tt>'; + $htmlMacro1b{'Prog'} = '</tt>'; +$htmlMacro1a{'File'} = '<tt>'; + $htmlMacro1b{'File'} = '</tt>'; +$htmlMacro1a{'Opt'} = '<b>'; + $htmlMacro1b{'Opt'} = '</b>'; +$htmlMacro1a{'oOpt'} = '[<b>'; + $htmlMacro1b{'oOpt'} = '</b>]'; +$htmlMacro1a{'Arg'} = '<i>'; + $htmlMacro1b{'Arg'} = '</i>'; +$htmlMacro1a{'oArg'} = '[<i>'; + $htmlMacro1b{'oArg'} = '</i>]'; + +# LaTeX macros with two arguments +$htmlMacro2a{'Cmd'} = '<em>'; + $htmlMacro2b{'Cmd'} = '</em>('; + $htmlMacro2c{'Cmd'} = ')'; +$htmlMacro2a{'OptArg'} = '<b>'; + $htmlMacro2b{'OptArg'} = '</b><i>'; + $htmlMacro2c{'OptArg'} = '</i>'; +$htmlMacro2a{'OptoArg'} = '<b>'; + $htmlMacro2b{'OptoArg'} = '</b>[<i>'; + $htmlMacro2c{'OptoArg'} = '</i>]'; +$htmlMacro2a{'oOptArg'} = '[<b>'; + $htmlMacro2b{'oOptArg'} = '</b><i>'; + $htmlMacro2c{'oOptArg'} = '</i>]'; +$htmlMacro2a{'oOptoArg'} = '[<b>'; + $htmlMacro2b{'oOptoArg'} = '</b>[<i>'; + $htmlMacro2c{'oOptoArg'} = '</i>]]'; +$htmlMacro2a{'setlength'} = ''; + $htmlMacro2b{'setlength'} = ''; + $htmlMacro2c{'setlength'} = ''; + +# we handle sections in HTML as having two arguments, 1. the number, 2. the name +$htmlMacro2a{'section'} = '\n<h2><a name="section_'; + $htmlMacro2b{'section'} = '">'; + $htmlMacro2c{'section'} = '</a></h2>\n'; +$htmlMacro2a{'subsection'} = '\n<h4><a name="section_'; + $htmlMacro2b{'subsection'} = '">'; + $htmlMacro2c{'subsection'} = '</a></h4>\n'; +$htmlMacro2a{'subsubsection'} = '\n<h5><a name="section_'; + $htmlMacro2b{'subsubsection'} = '">'; + $htmlMacro2c{'subsubsection'} = '</a></h5>\n'; + +# we handle Email and URL special in HTML, the LaTeX argument is doubled. +$htmlMacro2a{'Email'} = '<a href ="mailto:'; + $htmlMacro2b{'Email'} = '"><tt>'; + $htmlMacro2c{'Email'} = '</tt></a>'; +$htmlMacro2a{'URL'} = '<a href ="'; + $htmlMacro2b{'URL'} = '"><tt>'; + $htmlMacro2c{'URL'} = '</tt></a>'; + +######################################################################## +# Translation for LaTeX macros for TexInfo + +# translation of special characters +$texiLetterCode{'ä'} = '@"a'; +$texiLetterCode{'ö'} = '@"o'; +$texiLetterCode{'ü'} = '@"u'; +$texiLetterCode{'Ä'} = '@"A'; +$texiLetterCode{'Ö'} = '@"O'; +$texiLetterCode{'Ü'} = '@"U'; +$texiLetterCode{'ß'} = '@ss{}'; + +# LaTeX macros without arguments +$texiMacro{'LaTeX'} = 'LaTeX'; +$texiMacro{'LATEX'} = 'LaTeX'; # needed, since \LaTeX is contained in a + # section name (which are transposed + # into uppercase +$texiMacro{'itemsep'} = ''; + +# some math +$texiMacro{'rightarrow'} = '-->'; +$texiMacro{'Rightarrow'} = '==>'; +$texiMacro{'leftarrow'} = '<--'; +$texiMacro{'Leftarrow'} = '<=='; +$texiMacro{'ge'} = '>='; +$texiMacro{'le'} = '<='; + +$texiMacro{'Dollar'} = '$'; +$texiMacro{'Bar'} = '|'; +$texiMacro{'Bs'} = '\\'; +$texiMacro{'Tilde'} = '~'; +$texiMacro{'hline'} = ''; +$texiMacro{'noindent'} = '\n@noindent\n'; +$texiMacro{'copyright'} = '@copyright{}'; +$texiMacro{'Dots'} = '...'; +$texiMacro{'Circum'} = '^'; +$texiMacro{'Lbr'} = '['; +$texiMacro{'Rbr'} = ']'; +$texiMacro{'LBr'} = '@{'; +$texiMacro{'RBr'} = '@}'; +$texiMacro{'Percent'} = '%'; +$texiMacro{'Bullet'} = '*'; +$texiMacro{'TEXbr'} = ''; +$texiMacro{'MANbr'} = ''; +$texiMacro{'TEXIbr'} = '@*\n'; +$texiMacro{'HTMLbr'} = ''; +$texiMacro{'medskip'} = '@sp 2\n'; +$texiMacro{'SP'} = '@ @ '; + +if ($opt_a) { + $texiMacro{'SPfirst'} = $opt_a . '@ '; + } else { + $texiMacro{'SPfirst'} = '.@ '; +} + +$texiMacro{'~'} = ' '; +$texiMacro{'|'} = '|'; +$texiMacro{'<'} = '<'; +$texiMacro{'>'} = '>'; +$texiMacro{'<='} = '<='; +$texiMacro{'>='} = '>='; +$texiMacro{'='} = '='; +$texiMacro{'<>'} = '<>'; +$texiMacro{'{'} = '@{'; +$texiMacro{'}'} = '@}'; +$texiMacro{'_'} = '_'; +$texiMacro{'$'} = '$'; +$texiMacro{'#'} = '#'; +$texiMacro{'&'} = '&'; +$texiMacro{'%'} = '%'; +$texiMacro{'-'} = '@-'; +$texiMacro{','} = ' '; + +$texiMacro{'\\'} = '@*\n'; # line break +$texiMacro{'\\Tab'} = '\n'; # end of column in a table environment + +# LaTeX macros with one argument +$texiMacro1a{'emph'} = '@emph{'; $texiMacro1b{'emph'} = '}'; +$texiMacro1a{'textbf'} = '@strong{'; $texiMacro1b{'textbf'} = '}'; +$texiMacro1a{'texttt'} = '@t{'; $texiMacro1b{'texttt'} = '}'; +$texiMacro1a{'verb'} = '@t{'; $texiMacro1b{'verb'} = '}'; +$texiMacro1a{'underline'} = ''; $texiMacro1b{'underline'} = ''; +$texiMacro1a{'section'} = '\n@section '; $texiMacro1b{'section'} = '\n'; +$texiMacro1a{'subsection'} = '\n@subsection '; $texiMacro1b{'subsection'} = '\n'; +$texiMacro1a{'subsubsection'} = '\n@subsubsection '; $texiMacro1b{'subsubsection'} = '\n'; + +$texiMacro1a{'Prog'} = ''; $texiMacro1b{'Prog'} = ''; +$texiMacro1a{'File'} = '@file{'; $texiMacro1b{'File'} = '}'; +$texiMacro1a{'Opt'} = ''; $texiMacro1b{'Opt'} = ''; +$texiMacro1a{'oOpt'} = '[ '; $texiMacro1b{'oOpt'} = ' ]'; +$texiMacro1a{'Arg'} = '@var{'; $texiMacro1b{'Arg'} = '}'; +$texiMacro1a{'oArg'} = '[ @var{'; $texiMacro1b{'oArg'} = '} ]'; +$texiMacro1a{'Email'} = '@email{'; $texiMacro1b{'Email'} = '}'; +$texiMacro1a{'URL'} = '@url{'; $texiMacro1b{'URL'} = '}'; + +# LaTeX macros with two arguments +$texiMacro2a{'Cmd'} = ''; + $texiMacro2b{'Cmd'} = '('; + $texiMacro2c{'Cmd'} = ')'; +$texiMacro2a{'OptArg'} = ''; + $texiMacro2b{'OptArg'} = '@var{'; + $texiMacro2c{'OptArg'} = '}'; +$texiMacro2a{'OptoArg'} = ''; + $texiMacro2b{'OptoArg'} = '[@var{'; + $texiMacro2c{'OptoArg'} = '}]'; +$texiMacro2a{'oOptArg'} = '[ '; + $texiMacro2b{'oOptArg'} = '@var{'; + $texiMacro2c{'oOptArg'} = '} ]'; +$texiMacro2a{'oOptoArg'} = '[ '; + $texiMacro2b{'oOptoArg'} = '[@var{'; + $texiMacro2c{'oOptoArg'} = '}] ]'; +$texiMacro2a{'setlength'} = ''; + $texiMacro2b{'setlength'} = ''; + $texiMacro2c{'setlength'} = ''; + +######################################################################## +# reading of translations for user macros + +if ($opt_t) { + do $opt_t; +} + +######################################################################## +# processing for MAN + +sub manStart +{ + printf DEST "\'\\\" t\n"; # process with tbl + printf DEST ".\\\" Manual page created with $CMD on $gen_date\n"; + printf DEST ".\\\" NOTE: This file is generated, DO NOT EDIT.\n"; + + # Definitionen von Verbatimbegin and Verbatimend + Print ".de Vb\n.ft CW\n.nf\n..\n.de Ve\n.ft R\n\n.fi\n..\n"; + + Print ".TH \"$Name\" \"$chapter\" \"". $date ."\" \""; + interpret_word "$tool"; + Print "\" \""; interpret_word "$tool"; Print "\""; NL; + # thanks to Andrew Anderson <aja@emulab.ee.mu.oz.au> +} +sub manEnd +{ + NL; printf DEST ".\\\" NOTE: This file is generated, DO NOT EDIT.\n"; +} +sub manSection +{ + my ($cnt, $kind, $section) = @_; + if ($kind ne "subsubsection"){ + $section = uc $section; + } + interpret_line "\\$kind\{$section\}"; +} +sub manParagraph +{ + if (!$paragraph) { + if ($manRS == 0 && $list_nest > 1) { + Print '\n.RS'; + $manRS = 1; + } + Print '\n.PP\n'; + $paragraph = 1; + } +} +sub manVerb +{ + my $arg = $_[0]; + if ($arg =~ /^\./) { print DEST '\\&' }; + Print $arg +} +sub manItemWithArg +{ + my $arg = $_[0]; + if ($manRS == 1) { + Print '\n.RE\n'; + } + $manRS = 0; + Print '\n.TP\n'; + interpret_word $arg; + PrintM ' '; + NL; +} +sub manItem +{ + if ($manRS == 1) { + Print '\n.RE\n'; + } + $manRS = 0; + Print '\n.TP\n'; + if ($cur_list[$list_nest] eq 'item') { + Print '.B *'; + } elsif ($cur_list[$list_nest] eq 'enum') { + Print $item_nr[$list_nest] . '.'; + } + NL; +} +sub manDescriptionStart +{ + if ($list_nest > 1) { + Print '\n.RS\n'; + } +} +sub manDescriptionEnd +{ + if ($manRS) { + Print '\n.RE\n'; + $manRS == 0; + } + if ($list_nest > 1) { + Print '\n.RE\n'; + } + manParagraph; +} +sub manItemStart +{ + if ($list_nest > 1) { + Print '\n.RS\n'; + } +} +sub manItemEnd +{ + if ($manRS) { + Print '\n.RE\n'; + $manRS == 0; + } + if ($list_nest > 1) { + Print '\n.RE\n'; + } + manParagraph; +} +sub manEnumEnd +{ + if ($manRS) { + Print '\n.RE\n'; + $manRS == 0; + } + if ($list_nest > 1) { + Print '\n.RE\n'; + } + manParagraph; +} + +sub manEnumStart +{ + if ($list_nest > 1) { + Print '\n.RS\n'; + } +} +sub manCenterStart +{ + PrintM '\n.ce 100\n'; +} +sub manCenterEnd +{ + PrintM '\n.ce 0\n'; +} +sub manNameStart +{ + interpret_line "\\section\{NAME\}$rest"; +} +sub manNameEnd +{ + # nothing +} +sub manTableStart +{ + my $columns = $_[0]; + my $width = $_[1]; + my $i; + manParagraph; + Print '.TS\n'; + Print 'tab(&);\n'; + for ($i = 1; $i <= $columns; $i++) { + Print " l"; + } + Print "w($width)" if ($width); + Print '.\n'; +} +sub manTableSep +{ + Print '\nT}&T{\n'; +} +sub manTableEnd +{ + Print '\n.TE\n'; + manParagraph; +} + +sub manVerbatimStart +{ + Print '\n.Vb\n'; +} + +sub manVerbatimEnd +{ + Print '.Ve\n'; +} + +sub manVerbatimLine +{ + s/\\/\\\\/g; + s/-/\\-/g; + print DEST "$_"; +} + +########################################################################### +# processing for HTML + +sub htmlStart +{ + Print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">"; NL; + Print "<!-- Manual page created with $CMD on $gen_date --"; NL; + Print " -- Author of $CMD: Juergen.Vollmer\@informatik-vollmer.de --";NL; + Print " -- NOTE: This file is generated, DO NOT EDIT. -->"; NL; + Print "<html>"; NL; + Print "<head><title>$Name</title></head>"; NL; + Print "<body bgcolor=\"white\">"; NL; + Print "<h1 align=center>"; NL; + interpret_line $title; + Print "</h1>"; NL; + Print "<h4 align=center>"; interpret_word $author; Print "</h4>"; NL; + Print "<h4 align=center>$date</h4>"; NL; + Print "<h4 align=center>Version $version</h4>"; NL; +} +sub htmlEnd +{ + Print "</body>"; NL; + Print "</html>"; NL; + Print "<!-- NOTE: This file is generated, DO NOT EDIT. -->"; NL; +} +sub htmlSection +{ + my ($cnt, $kind, $section) = @_; + interpret_line "\\$kind\{$cnt\}\{$section\}"; +} +sub htmlCenterStart +{ + Print '\n<div align=center>\n'; +} +sub htmlCenterEnd +{ + Print '\n</div>\n'; +} +sub htmlNameStart +{ + # nothing +} +sub htmlNameEnd +{ + Print '\n@@INSERTION-POINT@@-TOC@@\n'; +} +sub htmlParagraph +{ + if (!$paragraph) { + NL; Print "<p>"; NL; + $paragraph = 1; + } +} +sub htmlVerb +{ + $arg = $_[0]; + $arg =~ s/&/&/g; + $arg =~ s/>/>/g; + $arg =~ s/</</g; + Print $arg; +} +sub htmlItemWithArg +{ + my $arg = $_[0]; + NL; + if ($item_nr[$list_nest] > 1) { + NL; Print "</dd>"; NL; + } + Print "<dt>"; + interpret_word $arg; Print "</dt>"; NL; + Print "<dd>"; +} +sub htmlItem +{ + if ($item_nr[$list_nest] > 1) { + Print '</li>\n'; + } + if ($cur_list[$list_nest] eq 'item') { + Print '<li>'; + } elsif ($cur_list[$list_nest] eq 'enum') { + Print '<li value =' . $item_nr[$list_nest] .'>'; + } +} +sub htmlDescriptionStart +{ + NL; Print "<dl compact>"; NL; +} +sub htmlDescriptionEnd +{ + NL; Print "</dd>\n</dl>"; NL; +} +sub htmlItemStart +{ + NL; Print "<ul compact>"; NL; +} +sub htmlItemEnd +{ + NL; Print "</li>\n</ul>"; NL; +} +sub htmlEnumStart +{ + NL; Print "<ol compact>"; NL; +} +sub htmlEnumEnd +{ + NL; Print "</li>\n</ol>"; NL; +} +sub htmlTableStart +{ + my $columns = $_[0]; + my $width = $_[1]; + NL; Print "<table>"; NL: +} +sub htmlTableSep +{ + if ($first_column == 0) { + Print '</td>\n'; + } + Print '<td>'; +} +sub htmlTableEnd +{ + NL; Print "</table>"; NL; +} + +sub htmlVerbatimStart +{ + NL; Print '<pre>'; NL; +} + +sub htmlVerbatimEnd +{ + Print '</pre>'; NL; +} + +sub htmlVerbatimLine +{ + s/&/&/g; + s/</</g; + s/>/>/g; + print DEST "$_"; +} + +########################################################################### +# processing for TexInfo + +sub texiStart +{ + Print '\input texinfo @c -*-texinfo-*-'; NL; + Print '@c %**start of header'; NL; + Print '@setfilename ' . "$name.info"; NL; + Print '@settitle ' . "$name"; NL; + Print '@c %**end of header'; NL; + Print '@c Manual page created with' ." $CMD on $gen_date>"; NL; + Print '@c NOTE: This file is generated, DO NOT EDIT.'; NL; +} +sub texiEnd +{ + Print '@bye'; NL; + Print '@c NOTE: This file is generated, DO NOT EDIT.'; NL; +} +sub texiSection +{ + my ($cnt, $kind, $section) = @_; + if (uc $sections[$cnt-1] eq "SYNOPSIS") { + Print '\n@@INSERTION-POINT@@-TOC@@\n'; + $sections[$cnt-1] = "Top"; # The predecessor node is Top and not SYNOPSIS + } + if (uc $sections[$cnt] eq "SYNOPSIS") { + $cnt == 1 || + die "$CMD: The Synopsis section must be the first section after\n" . + "\t the Name environment\n"; + } else { + Print '\n@@INSERTION-POINT@@-TEXI-SEC@@' . " $kind $cnt" . '\n'; + } + interpret_line "\\$kind\{$section\}"; +} +sub texiNameStart +{ + my ($name, $chapter, $author, $tool) = @_; + $sections[0] = "Top"; + # Print '@dircategory ' .$tool; NL; + Print '@dircategory Man-pages'; NL; + Print '@direntry'; NL; + Print "* " . (ucfirst $name) . ": ($name). Its Man-Page "; NL; + Print '@end direntry'; NL; + Print '@titlepage'; NL; + Print '@title ' . "$name"; NL; + Print '@subtitle ' . "$tool"; NL; + Print '@author ' . "$author"; NL; + Print '@end titlepage'; NL; + Print '\n@@INSERTION-POINT@@-TEXI-TOP@@'; NL; + Print '@top ' . "$name"; NL; +} +sub texiNameEnd +{ + # nothing +} +sub texiParagraph +{ + if (!$paragraph) { + NL; print DEST "\n"; + $paragraph = 1; + } +} +sub texiVerb +{ + $arg = $_[0]; + $arg =~ s/({|})/\@$1/g; + Print $arg; +} +sub texiItemWithArg +{ + my $arg = $_[0]; + Print '\n@item '; + interpret_word $arg; + NL; +} +sub texiItem +{ + Print '\n@item\n'; +} +sub texiDescriptionStart +{ + Print '\n@table @samp\n'; +} +sub texiDescriptionEnd +{ + Print '\n@end table\n'; +} +sub texiItemStart +{ + Print '\n@itemize @bullet\n'; +} +sub texiItemEnd +{ + Print '\n@end itemize\n'; +} +sub texiCenterStart +{ + $texiCenterLine = 1; + $newline = 0; + $texiMacro{'\\'} = '@*'; # line break + $texiMacro{'TEXIbr'} = '@*'; + NL; +} +sub texiCenterEnd +{ + $texiCenterLine = 0; + $newline = 0; + $texiMacro{'\\'} = '@*\n'; # line break + $texiMacro{'TEXIbr'} = '@*\n'; + NL; +} + +sub texiEnumStart +{ + Print '\n@enumerate\n'; +} +sub texiEnumEnd +{ + Print '\n@end enumerate\n'; +} +sub texiTableStart +{ + my $columns = $_[0]; + my $width = $_[1]; + my $i; + Print '\n@multitable @columnfractions '; + for ($i = 1; $i <= $columns; $i++) { + Print " " .0.9/$columns ; + } + Print '\n'; +} +sub texiTableSep +{ + Print '@tab '; +} +sub texiTableEnd +{ + Print '\n@end multitable\n'; +} + +sub texiVerbatimStart +{ + NL; + Print '@*'; NL +} + +sub texiVerbatimEnd +{ + NL; +} + +sub texiVerbatimLine +{ + s/({|}|@| )/@\1/g; + chop; + print DEST ".$_\@*\n"; +} + +########################################################################### +########################################################################### +# general processing + +# emit an error message is the given macro does not exists. +sub check_Macro +{ + exists $Macro->{$_[0]} || + die "Error in line $.: no such macro: \\$_[0]\n"; +} +sub check_Macro1 +{ + (exists $Macro1a->{$_[0]} && exists $Macro1b->{$_[0]}) || + die "$CMD: Error in line $.: no such macro: \\$_[0]\n"; +} +sub check_Macro2 +{ + (exists $Macro2a->{$_[0]} && exists $Macro2b->{$_[0]} && exists $Macro2c->{$_[0]}) || + die "$CMD: Error in line $.: no such macro: \\$_[0]\n"; +} + +sub NL +{ + if (!$newline) { + printf DEST "\n"; + if ($texiCenterLine) { + print DEST "\@center "; + } + $newline = 1; + } +} + +sub interpret_word +{ + if (@_ <= 0) { + return; + } + $_ = join " ", @_; + my ($s,$m,$a1,$a2,$r); # start, match/macro, argument1, argument2 + my $add_blank = 1; # if true, add a blank after the word + if ($opt_D == 2) { + if ($nesting == 0) { + print "**** "; + } else { + print " "; + } + print "\`$_'\n"; + } + + if ($opt_H) { + # handling of HTML table rows + if ($inside_table == 1) { + if ($first_column == 1) { + if (/^$/) { + return; + } + if (/^\\hline/) { + Print '\n<tr><td colspan=' . $columns . '><hr></td></tr>\n'; + } + Print '\n<tr>\n<td>'; + } + $first_column = 0; + } + } elsif ($opt_M) { + # handling of troff table rows + if ($inside_table == 1) { + if ($first_column == 1) { + if (/^$/) { + return; + } + Print 'T{\n'; + } + $first_column = 0; + } + } elsif ($opt_T) { + # handling of TexInfo specific stuff + if ($nesting == 0) { + s'@'@@'g; + } + if ($inside_table == 1) { + if ($first_column == 1) { + Print '\n@item '; + } + $first_column = 0; + } + } + + $nesting ++; + + SWITCH: { + /^$/ && do {$add_blank = 0; + last SWITCH; + }; + /\\verb\+([^+]*)\+/ && do {$s=$`;$m=$1;$r=$'; + interpret_word $s; + PrintM $Macro1a->{'verb'}; + &{$Prefix . "Verb"} ($m); + PrintM $Macro1b->{'verb'}; + interpret_word $r; + last SWITCH; + }; + /\\(".|ss)/ && do {$s=$`;$m=$1;$r=$'; #" + interpret_word $s; + check_Macro $m; + PrintM $Macro->{$m}; + interpret_word $r; + last SWITCH; + }; + /\\item\s*\[([^]]*)\]/ && do {$s=$`;$m=$1;$r=$'; + interpret_word $s; + $item_nr[$list_nest] ++; + &{$Prefix . "ItemWithArg"} ($m); + interpret_word $r; + last SWITCH; + }; + /\\item\s*/ && do {$s=$`;$r=$'; + interpret_word $s; + $item_nr[$list_nest] ++; + &{$Prefix . "Item"}; + interpret_word $r; + last SWITCH; + }; + # LaTeX macros with two arguments + /\\([a-zA-Z]+){([^}]*)}{([^}]*)}/ + && do {$s=$`;$m=$1;$a1=$2;$a2=$3;$r=$'; + check_Macro2 $m; + interpret_word $s; + PrintM $Macro2a->{$m}; + interpret_word $a1; + PrintM $Macro2b->{$m}; + interpret_word $a2; + PrintM $Macro2c->{$m}; + interpret_word $r; + NL; + last SWITCH; + }; + # Special Handling of Email and URL LaTeX macros with one argument + /\\(URL|Email){([^}]*)}/ && ($opt_H) + && do {$s=$`;$m=$1;$a1=$2;$r=$'; + interpret_word $s; + PrintM $Macro2a->{$m}; + interpret_word $a1; + PrintM $Macro2b->{$m}; + interpret_word $a1; + PrintM $Macro2c->{$m}; + interpret_word $r; + NL; + last SWITCH; + }; + # LaTeX macros with one argument + /\\([a-zA-Z]+){([^}]*)}/ && do {$s=$`;$m=$1;$a1=$2;$r=$'; + check_Macro1 $m; + interpret_word $s; + PrintM $Macro1a->{$m}; + interpret_word $a1; + PrintM $Macro1b->{$m}; + interpret_word $r; + NL; + last SWITCH; + }; + # Special handling of some LaTeX macros without an argument + /\\SP\s*/ && do {$s=$`;$m=$1;$r=$'; + interpret_word $s; + if ($first_word) { + PrintM $Macro->{"SPfirst"}; + } else { + PrintM $Macro->{"SP"}; + } + interpret_word $r; + $add_blank = 0; + last SWITCH; + }; + /\\(MANbr|TEXIbr|HTMLbr)\s*/ && do {$s=$`;$m=$1;$r=$'; + # set $first_word to true + check_Macro $m; + interpret_word $s; + PrintM $Macro->{$m}; + $first_word = 1; + interpret_word $r; + $add_blank = 0; + last SWITCH; + }; + # LaTeX macros without an argument: + /\\([a-zA-Z]+)\s*/ && do {$s=$`;$m=$1;$r=$'; + check_Macro $m; + interpret_word $s; + PrintM $Macro->{$m}; + interpret_word $r; + $add_blank = 0; + last SWITCH; + }; + /\\({|}|\$|_|#|&|-|%|,|\.|;)/ && do {$s=$`;$m=$1;$r=$'; + interpret_word $s; + PrintM $Macro->{$m}; + interpret_word $r; + last SWITCH; + }; + # LaTeX Math + /\$(<|>|<=|>=|=|<>)\$/ && do {$s=$`;$m=$1;$r=$'; + interpret_word $s; + PrintM $Macro->{$m}; + interpret_word $r; + last SWITCH; + }; + /\$([^\$]*)\$/ && do {$s=$`;$m=$1;$r=$'; + interpret_word $s; + interpret_word $m; + interpret_word $r; + last SWITCH; + }; + /&/ && do {$s=$`;$r=$'; + interpret_word $s; + &{$Prefix . "TableSep"}; + $first_column = 0; + interpret_word $r; + last SWITCH; + }; + /~/ && do {$s=$`;$r=$'; + interpret_word $s; + PrintM $Macro->{'~'}; + interpret_word $r; + last SWITCH; + }; + /\\\\/ && do {$s=$`;$r=$'; + interpret_word $s; + if ($inside_table) { + PrintM $Macro->{'\\Tab'}; + $first_column = 1; + if (length ($r) > 0) { + interpret_word $r; + } + } else { + PrintM $Macro->{'\\'}; + $first_word = 1; + interpret_word $r; + } + $add_blank = 0; + last SWITCH; + }; + /\\$|\\ / && do {$s=$`;$r=$'; + # LaTeX explicit blank \ will be + # represented as a single \ at + # the end of the word + interpret_word $s; + Print " "; + interpret_word $r; + last SWITCH; + }; + /\\/ && do {$s=$`;$r=$'; + interpret_word $s; + interpret_word "\\$r"; + last SWITCH; + }; + ($opt_M == 1) && /((^\.|')+)/ && do {$s=$`;$m=$1;$r=$'; + interpret_word $s; + print DEST "\\&$m"; + $newline = 0; + interpret_word $r; + last SWITCH; + }; + Print "$_"; + }; + $nesting --; + Print " " if ($nesting == 0 && $add_blank); +} + +sub interpret_line +{ + my $line = $_[0]; chomp $line; + my @words = split(/\s+/,$line); + my $max = $#words; + my $i; + my $join = 0; # true, if words must be joined + my $word = ""; # the joined word + my $kind = 0; # 1: item[ .. ], 2: { .. }, 3: \verb+ .. + + if ($max < 0) { + # empty line marks a paragraph + &{$Prefix . "Paragraph"}; + $first_word = 1; + return; + } + for ($i = 0; $i <= $max; $i++) { + $_ = $words[$i]; + # printf "\`$words[$i]'"; + if (/^[\s]*$/) { # skip leading blanks + # nothing + } elsif ((!$join || ($kind != 3)) && /^%+/) { # skip comments + last; + } else { + # if blanks in a { .. }, \item[ .. ], \verb+ .. + then we have to joind words + if ($join) { + # check whether this is the last word to be joined + if ($kind == 1) { # item + $join = index ($_, "]") == -1; + } elsif ($kind == 2) { # braces + my @x = $_ =~ /[^\\]}/g; + $join = $#x == -1; + } elsif ($kind == 3) { # verb + $join = index ($_, "+") == -1; + } + $word .= " " . $words[$i]; + if (!$join) { + interpret_word $word; + $word = ""; + } + } else { + # check whether we have to join some words + if (/\\item/) { + my $cnt1 = tr/[/[/; + my $cnt2 = tr/]/]/; + $join = $cnt1 != $cnt2 | $cnt1 == 0; + $kind = 1; + } elsif (/\\verb/) { + my $cnt = tr/+/+/; + $join = $cnt % 2 != 0; + $kind = 3; + } else { + my @x = $_ =~ /[^\\]{/g; + my @y = $_ =~ /[^\\]}/g; + $join = $#x != $#y; + $kind = 2; + } + if ($join) { + $word = $words[$i]; + } else { + interpret_word $words[$i]; + } + } + } + } + if ($join) { + interpret_word $word; + } + NL; +} + +sub PrintM +# print only for Macro command text +{ + if (@_ <= 0 || length ($_[0]) == 0) { + return; + } + my $l = shift; + my $c; + $l =~ s/\\n/\n/g; + foreach $c (split ("", $l)) { + if ($c eq "\n") { + NL; + $newline = 0; + } else { + print DEST "$c"; + } + } +} + +sub Print +{ + + # printf "\`$_[0]'\n"; + if (@_ <= 0 || length ($_[0]) == 0) { + return; + } + my $x = $_[0]; + + unless ($x =~ /^\s*$/) { + # if other chars than blanks are printed: + $first_word = 0; + } + + if (!$inside_verb) { + # transform special characters + $x =~ s/([äöüÄÖÜß])/$LetterCode->{"$1"}/go; + } + + my @parts = split /\\n/, $x, -1; + # -1: trailing \n generates an empty list element + my $i; + for ($i = 0; $i <= $#parts; $i++) { + if ($newline) { + # skip leading blanks after a newline + $parts[$i] =~ s/^\s+//; + } + if (length($parts[$i]) > 0) { + if ($opt_M) { + $parts[$i] =~ s/\\/\\\\/g; + $parts[$i] =~ s/-/\\-/g; + } + printf DEST "%s", $parts[$i]; + $newline = 0; + } + if ($i < $#parts) { + NL; + } + } + $paragraph = 0; +} +######################################################################### + +sub date2str +{ + @EnglishMonthName = ('','January','February','March','April','May','June','July', + 'August','September','October','November','December'); + # split date + my ($Year,$Month,$Day) = split (/\//,$_[0]); + return $Day . " " . $EnglishMonthName[$Month] . " " . $Year; +} + +$rcs_date=`date '+%Y/%m/%d/'`; # date of the man-page, overwritten + # by \rcsInfo +$date = date2str ($rcs_date); +$Macro->{'today'} = $date; + +######################################################################### +my @skip; # stack of skip-flags, 1: skip, 0: don't skip +push @skip, 0; # synthetic "outer most" IF, don't skip +my $last_cond_clause = ""; + +sub handle_conditional_text +{ + $_ = $_[0]; +# printf "skip-stack: %s;\t top = %s\n", join (", ", @skip), $skip[-1]; + if (/^\s*%@%\s+IF\s+([^%]*)\s+%@%\s*$/) { + # produce a program, which evaluates the condition: + my $prog_cond = $1; + $prog_cond =~ s/(\w+)/\$$1/g; + my $prog = ""; + my $var; + foreach $var (keys %cond_name) { + if ($var ne "") { + $prog .= "my \$$var = 1; " # declare set names, + # undeclared ones get value 0 + } + } + $prog .= "return ($prog_cond) ? 0 : 1;"; +# print "\n**** [$prog]\n"; + my $skip = eval $prog; + ($@ eq "") || die "$CMD: error in line $.: wrong condition of `%@% IF.. ($@)\n"; +# print "**** skip=$skip\n"; + + $last_cond_clause = "IF"; + if ($skip[-1] == 1) { + # skip this text, since outer IF skips + push @skip, 1; + } else { + # outer IF is not skipped, hence consider this IF + push @skip, $skip; + } + } elsif (/^\s*%@%\s+ELSE\s+%@%\s*$/) { + ($last_cond_clause =~ /IF/ && ($#skip > 0)) || + die "$CMD: error in line $.: `%@% ELSE %@%' without an `%@% IF..'\n"; + $last_cond_clause = "ELSE"; + if ($skip[-2] == 0) { + $skip[-1] = $skip[-1]? 0 : 1; + } + } elsif (/^\s*%@%\s+END-IF\s+%@%\s*$/) { + $last_cond_clause = "END-IF"; + ($#skip == 0) && + die "$CMD: error in line $.: `%@% END-IF %@%' without an `%@% IF..'\n"; + pop @skip; + } +# print "$last_cond_clause: skip = $skip[-1]\n"; +} + +############################################################################ +# handle LaTeX output +if ($opt_L) { + while (<SRC>) { + if ($opt_D == 1) { + my $line = $_; chop $line; + print "--- \`$line'\n"; + } + + if (/^\s*%@%\s/) { + my $skip = $skip[-1]; + handle_conditional_text ("$_"); + # write %@% directive + print DEST $_; + next; + } + next if ($skip[-1] == 1); + print DEST $_; + } + close (DEST); + exit (0); +} + +############################################################################ +# handle non-LaTeX output + +# read sections +# Variables: $section name of the section in uppercase letters +# $chapter chapter of the man page +# $name name of the man page +# $Name name of the man page in uppercase +# $author author of the man page +# $tool info about the tool set, $name is part of +# $date date +# $version version info +$started = 0; +while (<SRC>) { + if ($opt_D == 1) { + my $line = $_; chop $line; + print "--- \`$line'\n"; + } + + if ((/^\s*%@%\s/) && ($inside_verb==0)) { + my $skip = $skip[-1]; + handle_conditional_text ("$_"); + } + next if ($skip[-1] == 1); + + if ($inside_verb) { + if (/^\s*\\end{verbatim}/) { + if ($started == 1) { + &{$Prefix . "VerbatimEnd"}; + $inside_verb = 0; + } + } else { + &{$Prefix . "VerbatimLine"} ($_); + } + next; + } + + # remove {, } around Umlaute + s/{(\\".)}/\1/g; # " + s/{(\\ss)}/\1/g; + + # normalize special characters + s/\\"a/ä/g; + s/\\"o/ö/g; + s/\\"u/ü/g; + s/\\"A/Ä/g; + s/\\"O/Ö/g; + s/\\"U/Ü/g; + s/\\ss/ß/g; + + if (/^\s*\\rcsInfo \$(.*)\$/) { + my ($rcs_id,$rcs_file,$rcs_revision, + $rcs_date,$rcs_time,$rcs_owner,$rcs_status,$rcs_locker) = split(/\s/,$1); + $date = date2str ($rcs_date); + $Macro->{'today'} = $date; + } elsif (/^\s*\\setDate{\\rcsInfoLongDate}/) { + $Macro->{'Date'} = $date; + } elsif (/^\s*\\setDate{\\today}/) { + $Macro->{'Date'} = $date; + } elsif (/^\s*\\setDate{([^}]*)}/) { + $date = $1; + $date =~ s/~/$Macro->{'~'}/g; + $Macro->{'Date'} = $date; + } elsif (/^\s*\\setVersion{([^}]*)}/) { + $version = $1; + $versin =~ s/~/$Macro->{'~'}/g; + $Macro->{'Version'} = $version; + } elsif (/^\s*\\begin{Name}{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}{([^}]*)}/) { + $section = "Name"; + $chapter = $1; + $name = $2; + $Name = uc $name; + $author = $3; + $tool = $4; + $title = $5; + $rest = $'; + $started = 1; + $sections[0] = $section; + $section_cnt = 0; + &{$Prefix . "Start"} ($name, $chapter, $author, $tool, $title); + &{$Prefix . "NameStart"} ($name, $chapter, $author, $tool, $title); + } elsif (/^\s*\\end{Name}/) { + &{$Prefix . "NameEnd"} ($name, $chapter, $author, $tool); + } elsif (/^\s*\\begin{Table}(\[([^]]*)\])?{([^}]*)}/) { + # \begin{Table}[width]{columns} + if ($started == 1) { + $columns = $3; + $column = $_[0]; + $inside_table = 1; + $first_column = 1; + &{$Prefix . "TableStart"} ($columns, $2); + } + } elsif (/^\s*\\end{Table}/) { + if ($started == 1) { + $inside_table = 0; + $first_column = 0; + &{$Prefix . "TableEnd"} ($columns); + } + } elsif (/^\s*\\begin{Description}(\[[^]]*\])?/) { + if ($started == 1) { + $list_nest++; + $cur_list[$list_nest] = 'descr'; + $item_nr[$list_nest] = 0; + &{$Prefix . "DescriptionStart"}; + } + } elsif (/^\s*\\end{Description}/) { + if ($started == 1) { + &{$Prefix . "DescriptionEnd"}; + $list_nest--; + } + } elsif (/^\s*\\begin{description}/) { + if ($started == 1) { + $list_nest++; + $cur_list[$list_nest] = 'descr'; + $item_nr[$list_nest] = 0; + &{$Prefix . "DescriptionStart"}; + } + } elsif (/^\s*\\end{description}/) { + if ($started == 1) { + &{$Prefix . "DescriptionEnd"}; + $list_nest--; + } + } elsif (/^\s*\\begin{center}/) { + if ($started == 1) { + &{$Prefix . "CenterStart"}; + } + } elsif (/^\s*\\end{center}/) { + if ($started == 1) { + &{$Prefix . "CenterEnd"}; + } + } elsif (/^\s*\\begin{enumerate}/) { + if ($started == 1) { + $list_nest++; + $cur_list[$list_nest] = 'enum'; + $item_nr[$list_nest] = 0; + &{$Prefix . "EnumStart"} ; + } + } elsif (/^\s*\\end{enumerate}/) { + if ($started == 1) { + &{$Prefix . "EnumEnd"} ; + $list_nest--; + } + } elsif (/^\s*\\begin{itemize}/) { + if ($started == 1) { + $list_nest++; + $cur_list[$list_nest] = 'item'; + $item_nr[$list_nest] = 0; + &{$Prefix . "ItemStart"} ; + } + } elsif (/^\s*\\end{itemize}/) { + if ($started == 1) { + &{$Prefix . "ItemEnd"} ; + $list_nest--; + } + } elsif (/^\s*\\begin{verbatim}/) { + if ($started == 1) { + &{$Prefix . "VerbatimStart"}; + $inside_verb = 1; + } + } elsif (/^\s*\\(subsubsection|subsection|section){([^}]*)}/) { + $kind = $1; + $section = $2; + $section_cnt ++; + $sections[$section_cnt] = $section; + $section_kind[$section_cnt] = $kind; + if ($started == 1) { + &{$Prefix . "Section"} ($section_cnt, $kind, $section); + } + } elsif (/^\s*\\LatexManEnd/) { + last; + } elsif (/^\s*((\\begin{Name|Table|Description})|(\\(sub)?section))/) { + die "$CMD: in line $.\n " . + "Arguments of $1 are not contained in a single " . + "line.\n " . + "Remember: all arguments of a macro must be on the same line.\n"; + } else { + if ($started == 1) { + interpret_line $_; + } + } +} +&{$Prefix . "End"}; + +close DEST; + +if ($opt_H || $opt_T) { + open (TMP, "<$tmp") || die "$CMD: Can't open file \`$tmp' for reading.\n"; + open (DEST, ">$DestFile") || die "$CMD: Can't open file \`$DestFile' for writing.\n"; + while (<TMP>) { + if (/^\@\@INSERTION-POINT\@\@-TOC\@\@$/) { + if ($opt_H) { + # Table of contents for HTML + my $nesting = 0; # nesting of section/subsection/subsubsection + Print '\n<h3>Table of Contents</h3>\n'; + for ($i = 1; $i <= $section_cnt; $i++) { + my $cur_nesting = 0; + if ($section_kind[$i] eq "subsubsection") { + $cur_nesting = 3; + } elsif ($section_kind[$i] eq "subsection") { + $cur_nesting = 2; + } elsif ($section_kind[$i] eq "section") { + $cur_nesting = 1; + } + if ($cur_nesting > $nesting) { + # open a new list + Print '\n<ul>\n' + } + if ($cur_nesting == $nesting) { + # same level, close list item + Print '</li>\n'; + } + if ($cur_nesting < $nesting) { + # close list and list item + for my $i ($cur_nesting .. $nesting-1) { + Print '</li>\n'; + Print '</ul>\n'; + } + } + # print item + Print "<li><a href=\"#section_$i\">"; + interpret_word $sections[$i]; + Print "</a>"; + $nesting = $cur_nesting; + } + # close remaining lists + for my $i (1 .. $nesting) { + Print '</li>\n'; + Print '</ul>\n'; + } + } else { + # Menu of sections for texi + Print '@menu\n'; + for ($i = 2; $i <= $section_cnt; $i++) { + interpret_line "* " . $sections[$i] . "::"; + } + Print '@end menu\n'; + } + } elsif (/\@\@INSERTION-POINT\@\@-TEXI-TOP\@\@/) { + # Texi-top node + Print '@node Top, ' . $sections[2] . ', (dir), (dir)\n'; + } elsif (/\@\@INSERTION-POINT\@\@-TEXI-SEC\@\@ (\w+) (\d+)/) { + # print section header for texi + $kind = $1; + $cnt = $2; + $section = $sections[$cnt]; + Print '@node ' ; + interpret_word "$sections[$cnt], "; + interpret_word "$sections[$cnt+1], "; + interpret_word "$sections[$cnt-1], Top "; + NL; + } else { + print DEST $_; + } + } + close TMP; + close DEST; + unlink $tmp; +} + +######################################################################### + +## Emacs specific: +## Local Variables: *** +## mode: perl *** +## End: *** + diff --git a/Master/texmf-dist/tex/latex/latex2man/latex2man.cfg b/Master/texmf-dist/tex/latex/latex2man/latex2man.cfg new file mode 100644 index 00000000000..0dfce805b8d --- /dev/null +++ b/Master/texmf-dist/tex/latex/latex2man/latex2man.cfg @@ -0,0 +1,12 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Project: Documentation Tools +%% Descr: Latex --> MAN-page (groff -man), LaTeX package +%% Configuration of default options +%% Author: Dr. Jürgen Vollmer, Juergen.Vollmer@acm.org +%% $Id: latex2man.sty,v 1.28 1998/07/23 06:59:13 vollmer Exp vollmer $ +%% VERSION: 1.4 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\ExecuteOptions{fancyhdr} + +\endinput diff --git a/Master/texmf-dist/tex/latex/latex2man/latex2man.sty b/Master/texmf-dist/tex/latex/latex2man/latex2man.sty new file mode 100644 index 00000000000..0b8bb012f90 --- /dev/null +++ b/Master/texmf-dist/tex/latex/latex2man/latex2man.sty @@ -0,0 +1,189 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Project: Documentation Tools +%% Descr: Latex --> MAN-page (groff -man), LaTeX package +%% Author: Dr. Jürgen Vollmer, Juergen.Vollmer@informatik-vollmer.de +%% $Id: latex2man.sty,v 1.84 2008/11/11 07:21:18 vollmer Exp $ +%% VERSION: 1.23 +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% +%% `latex2man' package to use with LaTeX2e. +%% +%% 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 +%% Viktoriastrasse 15, D-76133 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. +%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{latex2man}[2008/11/11 v1.23] +\usepackage{ifthen} + +\newif\if@LM@UseFancy@ +\newif\if@LM@UseFancyHdr@ + +\DeclareOption{fancy}{ + \@LM@UseFancy@true + \@LM@UseFancyHdr@false +} +\DeclareOption{fancyhdr}{ + \@LM@UseFancyHdr@true + \@LM@UseFancy@false +} +\DeclareOption{nofancy}{ + \@LM@UseFancy@false + \@LM@UseFancyHdr@false +} + +\input{latex2man.cfg} +\ProcessOptions +\if@LM@UseFancy@ + \RequirePackage{fancyheadings} +\fi +\if@LM@UseFancyHdr@ + \RequirePackage{fancyhdr} +\fi + +\newcommand{\@LM@Arg}[1]{\textit{#1}} +\newcommand{\@LM@Opt}[1]{\textbf{#1}} + +\newcommand{\Opt}[1]{\@LM@Opt{#1}} % Option +\newcommand{\Arg}[1]{\@LM@Arg{#1}} % Argument +\newcommand{\OptArg}[2]{\Opt{#1}\Arg{#2}} % Option with Argument +\newcommand{\OptoArg}[2]{\Opt{#1}[\Arg{#2}]} % Option with optinal + % Argument + +\newcommand{\oArg}[1]{[\Arg{#1}]} % optional Argument +\newcommand{\oOpt}[1]{[\Opt{#1}]} % optional Option +\newcommand{\oOptArg}[2]{[\OptArg{#1}{#2}]} % optional Option with Argument +\newcommand{\oOptoArg}[2]{[\OptoArg{#1}{#2}]} % optional Option with + % optional Argument + +\newcommand{\Prog}[1]{\textit{#1}} % Program name +\newcommand{\Cmd}[2]{\textit{#1}(#2)} % Command with number + +\newcommand{\@LM@File}[1]{\texttt{#1}} +\newcommand{\File}[1]{\@LM@File{#1}} % File name + +\newcommand{\Bs}{$\mathtt{\backslash}$} +\newcommand{\Bar}{$\mathtt{|}$} +\newcommand{\Tilde}{\ensuremath{\mathtt{\sim}}} +\newcommand{\Dots}{$\dots$} +\newcommand{\Circum}{\^{}} +\newcommand{\Lbr}{[} +\newcommand{\Rbr}{]} +\newcommand{\LBr}{\{} +\newcommand{\RBr}{\}} +\newcommand{\Dollar}{\$} +\newcommand{\Percent}{\%} +\newcommand{\Bullet}{$\bullet$} +\newcommand{\TEXbr}{~\\} +\newcommand{\MANbr}{} +\newcommand{\HTMLbr}{} +\newcommand{\TEXIbr}{} +\newcommand{\SP}{\hspace*{0.5em}} + +\def\@LM@Date{} +\newcommand{\setDate}[1]{\def\@LM@Date{#1}} +\newcommand{\Date}{\@LM@Date} + +\def\@LM@VersionWord{Version:} +\newcommand{\setVersionWord}[1]{\def\@LM@VersionWord{#1}} + +\def\@LM@Version{} +\newcommand{\setVersion}[1]{\def\@LM@Version{#1}} +\newcommand{\Version}{\@LM@Version} + +\newcommand{\Email}[1]{\texttt{#1}} +\newcommand{\URL}[1]{\texttt{#1}} +\newcommand{\LatexManEnd}{} + +\newenvironment{Name}[5]{ +% #1 Chapter +% #2 Name +% #3 Author +% #4 Tool +\if@LM@UseFancy@ +\gdef\@LM@Foot{\emph{\@LM@VersionWord\ \@LM@Version, \@LM@Date}} +\rfoot[\fancyplain{#2 (#1)}{#2 (#1)}]{\fancyplain{\@LM@Foot}{\@LM@Foot}} +\lfoot[\fancyplain{\@LM@Foot}{\@LM@Foot}]{\fancyplain{#2 (#1)}{#2 (#1)}} +\fi +\if@LM@UseFancyHdr@ +\gdef\@LM@Foot{\emph{\@LM@VersionWord\ \@LM@Version, \@LM@Date}} +\rfoot[\fancyplain{#2 (#1)}{#2 (#1)}]{\fancyplain{\@LM@Foot}{\@LM@Foot}} +\lfoot[\fancyplain{\@LM@Foot}{\@LM@Foot}]{\fancyplain{#2 (#1)}{#2 (#1)}} +\fi +\title{#5} +\author{#3} +\date{\@LM@Date\\{\small Version \@LM@Version}} +\maketitle +\begin{abstract} +}{ +\end{abstract} +} + +% first optional argument specifies width of last column +% second argrtment specifies number of columns +\newenvironment{Table}[2][]{ +\def\OPTARG{#1} +\def\COLUMNS{#2} +\def\LASTCOL{} +\def\EMPTY{} +\ifx\OPTARG\EMPTY\else% + \def\COLUMNS{% + \ifcase#2 1\or 1\or 1\or 2\or 3\or 4\or 5\or 6\or 7\or 8\or 9\else 10\fi% + } + \def\LASTCOL{p{#1}} +\fi% +\par +\begin{tabular}{*\COLUMNS{l}\LASTCOL} +}{ +\end{tabular} +\par +} + +\newenvironment{Description}[1][]{ +\begin{list}{}{ + \ifthenelse{\equal{#1}{}}{ + % optional argument not given + \labelwidth\z@ \itemindent-\leftmargin + \let\makelabel\descriptionlabel + \renewcommand{\makelabel}[1]{\hspace\labelsep\normalfont\bfseries##1} + }{ + % optional argument given + \settowidth{\labelwidth}{\normalfont\bfseries#1} + \setlength{\leftmargin}{\labelwidth} + \addtolength{\leftmargin}{\labelsep} + \renewcommand{\makelabel}[1]{\normalfont\bfseries##1\hfil} + }} +}{ +\end{list} +} + +\AtBeginDocument{ +\if@LM@UseFancy@ + \pagestyle{fancyplain} +\fi +\if@LM@UseFancyHdr@ + \pagestyle{fancyplain} +\fi +\setDate{\today} +} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\endinput |