Linux Text Processing
Groff
GNU's version of nroff and troff. Groff produces output both for printing and plain ASC text. Macro packages are provided for different types of documents.
Macros:
- mgs - Writing papers
- man - For writing man pages
To make a man page from a created file(see the section on how to make a man page) type:
groff -t -man -Tascii viewmod.txt > viewmod.1
-Tascii Procuces ASCII text
-Tps Produces postscript
-Tdvi Output similar to TeX (DVI - Device Independent)
TEX and LaTeX
LaTeX is a set of macros on top of TEX that is concerned with the structure of a document such as chapters, footnotes and sections.
TEX Commands:
| \documentstyle{letter} | | Choices: article, report, book, letter. They specify global macros |
| \begin | | Begin document |
| \End | | End document |
| \\ | | Line break |
| \ | | Starts a command, If backslach is trailing, a space is forced |
| ~ | | Forces a space between tow words or characters without a line break |
| {\em } | | Text within brackets is emphasized |
| \bf | | Boldfaced |
| \tt | | Typwriter text |
|
|
Example:
\documentstyle{letter}
\address{123 Desert Rd \\Unit 2B\\Wayside, AZ 08821}
\signature{John Smith}
\begin{document}
\begin{letter}{Mr.~George~Lunuxuser\\
1100 N East Street \\
California, MD 20190}
\opening{Dear George,}
I would like to inform you that I have just discovered \LaTex\ and it is the greatest
thing since sliced bread. You should use it for all your text processing needs.
\closing{Most Sincerely,}
\end{letter}
\end{document}
Save as tolinux.tex
Type "latex tolinux"
Results are output in tolinux.dvi
Use "dvips" to make a postscript file from the dvi file, Ex: dvips –o tolinux.ps tolinux.dvi
To see the output, you can use "xdvi" from X windows.
The program "dvilj" will print dvi files on Laserjet printers.
The program "eps" will print dvi files on epson printers.
LaTeX user's Guide and Reference Manual
The TEXbook
Making TEX Work
Texinfo
Used to produce hypertext info pages and printed manuals.
- @ - Begins a command
- @c or @comment - Begins a comment
- @setfilename - Name of output file
- @settitle - The title of the document
- @setchapternewpage - Tells where to start new chapters. Choices: odd, even
- @code - Specifies text to be emphasized
- @ifinfo - Specified text to show up only in info file
- @enumerate
- @end - Way to end things like ifinfo, titlepage, menu, enumerate
- @table
- @var - Indicates a metavariable
- @xref - Cross reference to another node
- @cindex - Makes entries in the concept index at the end of the document
Example file:
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename test.info
@settitle An example texinfo file
@c %**end of header
@titlepage
@sp 10
@comment This is to be in large font
@center @titlefont(This Test Title)
@end titlepage
@c Node, Next , Previous, Up
@node Top , First Chapter , (dir), (dir)
@ifinfo
This is a test info file. There is no worthwhile text here.
This is only a test.
@end ifinfo
@menu
* First Chapter:: The only chapter
* Concept Index:: Index of Concepts
@end menu
@c Node , Next ,previous, up
@node First Chapter, Concept Index, Top, Top
@chapter First Chapter
@cindex Sample index entry
@c A numbered list
@enumerate
@item
The first one
@item
The second one
@end enumerate
The @code{makeinfo} and @code{texinfo-format-buffer}
commands transform a Texinfo file into an Info file. @TeX{}
typesets it for a printed manual.
@c Node ,next , previous , up
@node Concept Index, , First Chapter, Top
@unnumbered Concept Index
@printindex cp
@contents
@bye
If the file is called test.texi, type "makeinfo test.texi" to make an info file called test.info.
|