.-3[DESCRIPTION]
.-2[OPTIONS]
.-1[FORMATTING ACTIONS]
Top
.+1[LIMITATIONS]
.+2[SEE ALSO]
.+3[AUTHOR]
In order to allow the user to control the formatting of these new features, tex-pretty supports a simple style file mechanism. At startup, it processes a style file in the user's home directory, and another in the current directory. Neither of these need exist. During command-line argument processing, additional style files can be provided with the -s option. These style files support user-specific, directory-specific, and file-specific prettyprinting control.
The default name of the first two style files is system dependent: .texprettyrc (UNIX), texpty.ini (IBM PC DOS), and texpretty.ini (DEC VMS and OpenVMS).
The line length limit in style files is system-dependent, but guaranteed to be at least 1024 characters.
tex-pretty's formatting actions group control sequences into the following style classes:
LaTeX: \appendix \backmatter \chapter \documentclass \documentstyle \frontmatter \mainmatter \paragraph \part \section \subparagraph \subsection \subsubsection
plain TeX: \beginchapter \beginsection \endchapter
LaTeX: \nocite
TeXinfo: @cite
TeXinfo: @c @comment
TeXinfo: @ETC @b @bullet @copyright @dfn @dmn @dots @enddots @equiv @expansion @file @headword @i @math @minus @occur @par @point @print @pxref @r @refill @regularbooksize @result @sc @strong @t @thischapter @thischaptername @thisfile @thispage @thistitle @titlefont @today @value
LaTeX: \begin{displaymath} \end{displaymath} \[ \]
LAmSTeX: \Figure \endFigure \Figurepair \endFigurepair \Figuretriple \endFiguretriple \HL \endHL \Table \endTable \bdmatrix \endbdmatrix \claim \endclaim \heading \endheading \island \endisland \makebib \endmakebib \partition \endpartition
LaTeX (with exceptions given in other classes): \begin{envname} \end{envname}
plain TeX: \begingroup \endgroup \bgroup \egroup
TeXinfo: @cartouche @display @end @flushleft @flushright @format @group @ifinfo @iftex @quotation @smallexample @smalllisp @titlepage
LAmSTeX: \plainfootnote \plainproclaim
LaTeX: \footnote \footnotetext \label \pageref \ref
plain TeX: \vfootnote
TeXinfo: @footnote
LaTeX: \glossary \index
ETeX: \numberedlist \endnumberedlist \orderedlist \endorderedlist \unorderedlist \endunorderedlist
LAmSTeX: \bib \endbib \bullist \endbullist \describe \enddescribe \list \endlist \margins \endmargins
LaTeX: \begin{description} \end{description} \begin{enumerate} \end{enumerate} \begin{itemize} \end{itemize} \begin{list} \end{list} \begin{thebibliography} \end{thebibliography} \begin{trivlist} \end{trivlist}
TeXinfo: @enumerate @ftable @itemize @table @vtable
LaTeX: \bibitem \item
plain TeX: \itemitem
TeXinfo: @item @itemx
LaTeX: \begin{math} \end{math} \( \)
plain TeX: \cr \crcr \endline
TeXinfo: @*
AmSTeX: \adjustfootnotemark \book \bookinfo \bookinquotes \botcaption \by \bysame \captionwidth \define \ed \eds \finalinfo \inbook \issue \jour \lang \moreref \newsymbol \no \noquotes \page \pages \paper \paperinfo \paperinquotes \parshape \preaffil \preauthor \predate \predefine \prepaper \pretitle \publ \publaddr \redefine \shoveleft \shoveright \toappear \topcaption \transl \undefine \vol \widestnumber \yr
ETeX: \defineindex \definecontentsfile \center \columnfill \doublecolumns \edefappend \flushleft \flushright \for \iffileexists \innerdef \innerinnerdef \innernewbox \innernewcount \innernewdimen \innernewfam \innernewhelp \innernewif \innernewinsert \innernewmuskip \innernewread \innernewskip \innernewtoks \innernewwrite \listing \makecolumns \quadcolumns \readindexfile \readtocfile \testfileexistence \tocchapterentry \tocsectionentry \triplecolumns \writenumberedtocentry \writetocentry
LAmSTeX: \Cgaps \Entry \Entryxref \LETTER \Morexref \Noexpand \Nonexpanding \Offset \Page \PageSpan \Pagespan \PostCDSpace \PreCDSpace \Reset \Rgaps \Topage \Xref \cgaps \cleartable \counter \everytable \ex \exs \flushpar \fnote \foottext \hL \hdashed \hl \hls \htablelines \iabbrev \idefine \litbackslash \litdelimiter \mainfile \makepiece \manyby \measuretable \modifyfootnote \nameHL \namehl \newHL \newclaim \newfontstyle \newhl \newisland \newnumstyle \newpost \newpre \newstyle \newword \note \pageorder \postCDspace \postdocstyle \preCDspace \predocstyle \pullin \pullinmore \purge \readaux \rgaps \runningchapter \runningsection \shortenclaim \showstored \sss \storetable \tablewidth \tbldocstyle \tdefine \toclevel \tredefine \tss \unpurge \usetable \vleft \vright \vs \vsolid \vtablelines
LAmSTeX and LaTeX: \author \date \thanks \title
LaTeX: \address \caption \closing \glossaryentry \include \includeonly \indexentry \makeglossary \makeindex \marginpar \markboth \markright \multiput \newblock \newboolean \newcommand \newcounter \newenvironment \newlength \newsavebox \newtheorem \opening \printindex \providecommand \put \renewcommand \renewenvironment \signature \typein \typeout \usepackage \vspace
plain TeX: \centerline \chardef \closein \closeout \countdef \def \dimendef \edef \else \endinput \eqalign \eqalignno \errmessage \fi \futurelet \futurenonspacelet \gdef \global \halign \hang \hoffset \hyphenation \ialign \if \ifcase \ifcat \ifdim \ifeof \iffalse \ifhbox \ifhmode \ifinner \ifmmode \ifnum \ifodd \iftrue \ifundefined \ifvbox \ifvmode \ifvoid \ifx \immediate \input \leftline \leqalignno \let \line \listing \loop \magnifiction \mark \mathchardef \message \narrower \newbox \newcount \newdimen \newfam \newhelp \newif \newinsert \newmuskip \newread \newskip \newtoks \newwrite \noalign \openin \openout \parindent \read \repeat \rightline \show \showbox \showboxbreadth \showdepth \showhyphens \showlists \showthe \skipdef \special \tabalign \textindent \toksdef \tracingall \tracingcommands \tracinglostchars \tracingmacros \tracingonline \tracingoutput \tracingpages \tracingparagraphs \tracingrestores \tracingstats \vadjust \valign \voffset \vskip \write \xdef
TeXinfo: @appendix @appendixsec @appendixsection @appendixsubsec @appendixsubsubsec @asis @inforef @setfilename @vskip
AmSTeX: \BlackBoxes \CenteredTagsOnSplits \ChangeBuffer \LimitsOnInts \LimitsOnNames \LimitsOnSums \Monograph \MultLineGap \NoBlackBoxes \NoPageNumbers \NoRunningHeads \ResetBuffer \Runinitem \TagsAsMath \TagsAsText \TagsOnLeft \TagsOnRight \TopOrBottomTagsOnSplits \UseAMSsymbols \UseBibTeX \captionwidth \endinsert \foldedpar \galleys \hcorrection \ininbook \loadbold \loadeufb \loadeufm \loadeurb \loadeurm \loadeusb \loadeusm \loadmsam \loadmsbm \midinsert \multlinegap \operatorname \pageheight \pageinsert \pagewidth \printoptions \showallocations \spreadlines \spreadmatrixlines \syntax \topinsert \vcorrection
LAmSTeX: \Figureproofing \FlushedFigs \Initialize \NS \NoFlushedFigs \RefWarnings \alldq \boxedtables \columnbreak \continuelist \figureproofing \indexfile \indexproofing \inlevel \keepitem \makelistFigures \makelistTables \makelistfigures \makelisttables \maketoc \newcolumn \noFigureproofing \nocolumnbreak \nofigureproofing \noshowsecondpass \opentables \outlevel \shortlastcolumn \showcolwidths \showsecondpass \sides \ssizeCDlabels \tocfile \tsizeCDlabels
LAmSTeX and LaTeX: \bibliography \bibliographystyle
LaTeX: \bigpagebreak \cleardoublepage \clearpage \definecolor \enlargethispage \flushbottom \fussy \hline \indexspace \linebreak \listfiles \listoffigures \listoftables \maketitle \medpagebreak \newline \newpage \nofiles \nolinebreak \nopagebreak \nopagenumbers \normalbottom \normalmarginpar \onecolumn \onlynotes \onlyslides \pagebreak \pagecolor \pagenumbering \pagestyle \raggedleft \reversemarginpar \sloppy \smallpagebreak \suppressfloats \tableofcontents \thispagestyle \twocolumn
plain TeX: \allowbreak \annotations \batchmode \bigbreak \bigskip \body \break \bye \centering \dosupereject \eject \endletter \errorstopmode \filbreak \frenchspacing \goodbreak \indent \leavevmode \makelabel \medbreak \medskip \noindent \nonfrenchspacing \nonstopmode \par \raggedbottom \raggedcenter \raggedright \removelastskip \scrollmode \smallbreak \smallskip \ttraggedright \vfil \vfilneg \vfill
TeXinfo: @afourpaper @bye @contents @cropmarks @finalout @lowersections @noindent @page @raisesections @shortcontents @smallbook @summarycontents
LAmSTeX: \Lit \lit (\Lit can contain line breaks, but its syntax is that of \lit)
LaTeX: \verb \verb*
any TeX: \path
TeXinfo: @defcv @deffn @defivar @defmac @defmethod @defop @defopt @defspec @deftp @deftypefn @deftypefun @deftypefunx @deftypevar @deftypevr @defun @defunx @defvar @defvr @example @ignore @lisp @menu @tex
The style class default can be used to force a command or environment to revert to the default formatting rules: no special indentation for commands, and normal indentation for environments. You can use this to override earlier style file settings, and most of the built-in ones.
Style class names, like TeX control sequences and LaTeX environments, are case sensitive. All of the ones recognized by tex-pretty must be spelled with lowercase letters.
The style file is expected to contain lines of the form:
Blank lines, leading and trailing whitespace, and text from the TeX comment character (%) to end of line, are ignored. Whitespace separates items, and can be omitted around the colon. There is no significance to the order of items on a line, or lines in the file, except that later settings can override earlier ones. The same style class name may occur on multiple lines.style-class : envname1 envname2 ... \command1 \command2 ...
For example, suppose you have defined new sectional division commands named \Kapitel and \Teil, a new tabular environment named \SuperTabular, and two new display math environments named EasyMath and HardMath. Your style file might then look something like this:
% additional tex-pretty style specifications % [02-Jun-1995] chapter : \Kapitel \Teil tabular : SuperTabular displaymath : EasyMath HardMath
LaTeXinfo is, sadly, less widely used than TeXinfo; it supports most of the standard LaTeX commands, plus a few others: some additional sectioning and indexing commands, two comment-start macros (\c and \comment), a hypertext link macro (\node) and a menu environment in which line breaks are significant. Here is a suitable tex-pretty style file for LaTeXinfo files (there are additional LaTeXinfo control sequences not listed here, but they do not require any particular special formatting):
The \node macro can be handled by the comment class because all of its arguments follow on the same line, up to the end of the line. Menu environments are usually laid out neatly, because their formatting is preserved exactly in the ASCII output used for online info documentation; prettyprinting them in verbatim mode ensures that the layout will be retained. The \* macro will actually not be recognized in the current version of tex-pretty, because macro names definable in style files may contain only letters after the leading backslash. In this case, no harm will arise, since the default formatting of control sequences containing special characters is adequate.% LaTeXinfo style file for tex-pretty % [08-Jun-1995] chapter : \unnumbered \unnumberedsec \unnumberedsubsec chapter : \unnumberedsubsubsec comment : \c \comment \node index : \cindex \cpindexbold \cpsubindex \findex index : \kindex \pindex \tindex \vindex newline-after : \* \br newline-before : \copyright \newindex \setfilename \synindex verbatim : ifinfo ignore menu
There is no built-in support in tex-pretty for LaTeXinfo, because it has not achieved widespread use; however, the style file above should be sufficient for tex-pretty to prettyprint LaTeXinfo files correctly.
The last style class attached to command or environment name is the one that is used, so specifications in a command-line style file can override those in the current directory style file, and those in turn override settings from the home directory style file.
The -d and -t command-line options affect the prettyprinting of all commands in the math and tabular classes.
Don't use the -m math mode translation option if you specify the math class in a style file; if you do, those commands and environments will be renamed. When math mode translation is selected, it may also be advisable to specify the -q option, and avoid -s options, to eliminate all style file input.
For the purposes of matching TeX control words, tex-pretty assumes that they begin with a backslash followed by one or more letters or at-sign; the latter is commonly used inside macro packages to create command names that are supposed to be hidden from the end user. There is no provision in style files for modifying this assumption.
Occasionally, it may be desirable to have a control sequence and its arguments handled together as an indivisible unit. To support this, control sequences in style files may be followed by zero or more of the following patterns, in whatever order is required:
These patterns are ignored for index, verb, and verbatim style classes, because they have their own specialized formatting requirements.
- *
- Match an optional literal asterisk; LaTeX uses this for variant forms.
- []
- Match an optional argument in balanced brackets (LaTeX).
- ""
- Match an optional argument in quotes (AmSTeX and LAmSTeX).
- ()
- Match a required argument in balanced parentheses (LaTeX).
- {}
- Match a required argument in balanced braces (any TeX).
- \
- Match an alphabetic control sequence (LAmSTeX).
Here is a sample style file that illustrates the use of argument patterns:
When argument patterns are processed, whitespace before and between arguments in the input stream is discarded as long as an argument match is found. Arguments themselves are copied verbatim, even if they include line breaks or comments. The only requirement is that braced, bracketed, or parenthesized arguments have balanced delimiters.default : \makebox()[]{} % LaTeX list-item : \item"" % AmSTeX and LAmSTeX standalone : \Reset\ % LAmSTeX: e.g. \Reset \list
Control sequence name matching against style file specifications does not include any argument patterns, so if the same control sequence name is specified more than once in a style file, as in
only the last one will be effective, in this case, a required braced argument. This should not normally be a serious limitation, because TeX control sequence definitions that include argument delimiter characters also have this behavior. However, it is possible with special programming to use one-character lookahead to distinguish between argument types, and LaTeX does this internally for optional bracketed arguments, and asterisked variants.list-item : \myitem"" \myitem() \myitem[] \myitem{}
.-3[DESCRIPTION]
.-2[OPTIONS]
.-1[FORMATTING ACTIONS]
Top
.+1[LIMITATIONS]
.+2[SEE ALSO]
.+3[AUTHOR]