# LaTeX configuration file for WP2X.
#
# Written 12/15/89 by Raymond Chen '89.
# Updated 7/05/91 by Raymond Chen.
#
# If you change this file, please make a note of it below
# and in the BEGIN string.  (And probably also in the typeout
# string.)
#
# Version 0.0:  Initial version.
# Version 0.2:  Add new tags, reorder existing tags for easier comparison.
# Version 0.3:  Tab markers, improved(?) header/footer
# Version 0.4:  Fix percent signs.
# Version 0.5:  Add \begin{document}, discuss { } \
# Version 0.6:  New output scheme.

typeout="LaTeX descriptor file for WP2X by Raymond Chen\n"

# At the beginning of the file, we claim to be using article style.

BEGIN="%% This file was created by the WP2X program, using a LaTeX
%% descriptor file (Version 0.6) written by Raymond Chen.
%% Do not expect everything to be converted perfectly.
%%
\\documentstyle{article}
\\begin{document}
%%
"

# At the end of the file, we end the document.
END="\\end{document}
%% That's all, folks.
"

# How to make a one-line comment in LaTeX.
Comment="%\n"
comment="\n"

# Protect percent signs and other magic symbols.
'%'="\\%%"
'$'="\\$"
'#'="\\#"
'&'="\\&"
'^'="\\^{}"
'_'="\\_"
'~'="\\~{}"

# Curly braces and backslashes are intentionally left untranslated.
# If you want them to be converted, uncomment these three lines.
#
#   '{'="$\\{$"
#   '}'="$\\}$"
#   '\\'="$\\backslash$"
#
# These characters are left untranslated because they do not exist
# in the TeX font tables.  I.e., they won't be printed in boldface
# or italic or whatever font you selected; they always come from
# the math font.

# Now the actual code expansions.

# Many of these tags emit comments, since there is an official LaTeX way
# of doing them.

PageNo="\\folio{}"           # insert page number
RomanPage="%\n%% Set roman page number %1\n"    # set roman numerals
ArabicPage="%\n%% Set arabic page number %1\n"  # set arabic numerals

HSpace="~"                   # Unbreakable space

Tab="\\indent "              # Tabs mean to indent and start a new para.
HPg="%\n\\vfill\\eject\n"    # Hard page is just a \vfill\eject
CondEOP="%\n%% Conditional end-of-page for %1 lines\n"

HRt="%\n\n"                  # Hard return becomes a blank line
SRt="%\n"                    # Soft return is a newline

-="-"                        # Hyphens are hyphens
--="-%%\n"                   # Hyphen at the end of a line gets a %
=="{-}"                      # Nonbreaking hyphen
\-="\\-"                     # Discretionary hyphen
\--="\\-%%\n"                # Discretionary hyphen at the end of the line
NoHyphWord="\\mbox{}"        # Inhibit hyphenation of this word

# Margins are left as comments, since you shouldn't change margins
# willy-nilly in LaTeX.
Marg="%%\n%% left margin %1, right margin %2\n"
TopMarg="%%\n%% top margin %1\n"
PageLength="%%\n%% page length %1\n"

# Line spacing changes are treated by setting \baselinestretch and then
# calling \normalbaselines to let the change take effect.

SS="\\def\\baselinestretch{1}\\normalbaselines\n"
1.5S="\\def\\baselinestretch{1.5}\\normalbaselines\n"
DS="\\def\\baselinestretch{2}\\normalbaselines\n"
TS="\\def\\baselinestretch{3}\\normalbaselines\n"
LS="{\\count0=%1 \\count1=\\count0 \\divide\\count1 by 2
\\global\\edef\\baselinestretch{\\number\\count1\\ifodd\\count0.5\\fi}}
\\normalbaselines}
"
LPI="%\n%% Change to %1 lines per inch\n"

Bold="{\\bf "                # Boldface
bold="}"
Und="{\\em "                 # Underlining is in "emphasized"
und="\\/}"                   # with italic correction stuck in always.
Red="{\\redline "            # Redline
red="}"
Strike="{\\strikeout "       # Strikeout
strike="}"
Rev="{\\reverse "            # Reverse video
rev="}"
Over="\\llap{"               # Overprinting is faked with \llap
over="}"
Sup="\\raise.5ex\\hbox{"     # fake superscript
sup="}"
Sub="\\lower.5ex\\hbox{"     # fake subscript
sub="}"

# UpHalfLine, DownHalfLine, AdvanceToHalf -- undefined

Indent="{\\narrower "        # Indented paragraphs use \narrower; this
DIndent="{\\narrower "       # is not a perfect solution, but it's a start.
indent="\\par}\n"
MarginRelease="%\n%% Margin release, move back %1 characters\n"

Center="%\n\\begin{center}\n"   # enter centering environment
center="%\n\\end{center}"
CenterHere="%\n\\begin{centerhere}\n" # Not supported
centerhere="%\n\\end{centerhere}"

Align="%\n\\begin{align}\n"             # Not supported
align="%\n\\end{align}"
FlushRight="%\n\\begin{flushright}\n"
flushright="%\n\\end{flushright}"

# Math, math, MathCalc, MathCalcColumn, SubTtl, IsSubTtl, Ttl, IsTtl, GrandTtl
# Col, col -- undefined

Fn="%\n\\begin{footnote}\n"     # begin footnote
fn="%\n\\end{footnote}\n"
SetFn#="%\n%% Set Footnote number to %1\n" # don't do this in LaTeX
En="%\n\\begin{endnote}\n"      # You'll have to write your own endnote environ.
en="%\n\\end{endnote}\n"
FNote#=""                          # Note numbers are automatically generated.
ENote#=""                          # Note numbers are automatically generated.

# TableMarker -- undefined

BeginTabs="%\n%% Set tabs at"
SetTab=" %1"
SetTabCenter=" %1c"
SetTabRight=" %1r"
SetTabDecimal=" %1d"
EndTabs="\n"

Hyph="\\hyphenpenalty=50\n"        # Allow hyphenation
hyph="\\hyphenpenalty=10000\n"     # Disable hyphenation
Just="\\rightskip=0pt\n"           # Right justify
just="\\raggedright\n"             # Ragged right
Wid="\\clubpenalty=150 \\widowpenalty=150\n" # Widow protection
wid="\\clubpenalty=0 \\widowpenalty=0\n" # Allow widows

# HZone, DAlign -- undefined

# These guys are left as comments, since you're not supposed to do
# them in LaTeX.
Header="%\n%% Change header to\n\\toks0={"
header="}\n"
Footer="%\n%% Change footer to\n\\toks0={"
footer="}\n"
Supp="%\n%% Suppress headers and footers on this page\n"
CtrPg="%\n%% Center this page vertically\n"
SetFont="%\n%% Change to %1 pitch, font %2\n"
SetBin="%\n%% Change to paper bin %1\n"

# Same reason for these.
PN0="%\n%% no page numbers\n"
PN1="%\n%% page numbers in upper left corner\n"
PN2="%\n%% page numbers top center\n"
PN3="%\n%% page numbers in upper right corner\n"
PN4="%\n%% page numbers in alternating even/odd upper corners\n"
PN5="%\n%% page numbers in bottom left corner\n"
PN6="%\n%% page numbers bottom center\n"
PN7="%\n%% page numbers in bottom right corner\n"
PN8="%\n%% page numbers in alternating even/odd bottom corners\n"
