1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219
|
# LaTeX AFT 5.0 rules (version 2.0)
#
# History:
# Original Version - Todd Coram
# 2.0 4/03 - Substantial clean up by Guido Gonzato
# 2.1 1/04 - Corrections and clean up by Guido Gonzato
# 2.2 8/09 - Additional sectioning support by Todd Coram
#
#
ID LaTeX
EXT tex
# Should AFT interpolate strings? (i.e. perform backslash substitutions, etc)
# For TeX: No! TeX uses backslashes for commands!
#
interpolate yes
Preamble{
%
%LaTeX 2.e output generated byt AFT
%
\documentclass[11pt]{article}
\usepackage{ae}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc} % latin1 encoding
\usepackage{graphicx} % graphic files
\usepackage{alltt} % filtered verbatim
\usepackage[margin=2.5cm]{geometry} % page layout
\usepackage[colorlinks,urlcolor=blue]{hyperref} % URLs an hrefs
%
\setlength{\parindent}{0pt}
\setlength{\parskip}{3pt}
\pagestyle{headings}
%
\begin{document}
}Preamble
Postamble{
\end{document}
}Postamble
# Pre-Filters....
#
preFilter \$ \\\$
# Allow TeX style linebreaks
#
#preFilter \\\\ %LiNeBrEaK%
preFilter \\([^\$\~\[\|\_]) \\(\\backslash\\)$1
# Yes, hyperlinks... so make references where applicable
#
#URL \\url{%text%}
URL %_text% \\url{%target%}
InternalReference %text% (\$\S%TiLdE%\$\ref{%target%})
Target %text%\\label{%target%}
# Protect the AFT hypertext braces
#
preFilter \{\+(.*?)\+\} %LeFtB%PlUs$1%PlUs%RiGhTB
preFilter \}\+(.*?)\+\{ %RiGhTB%PlUs$1%PlUs%LeFtB
preFilter \{\-(.*?)\-\} %LeFtB%NeG$1%NeG%RiGhTB
preFilter \}\-(.*?)\-\{ %RiGhTB%NeG$1%NeG%LeFtB
# Escape TeX braces
#
preFilter [\{\}] \\(\\$&\\)
preFilter %LeFtB {
preFilter %RiGhTB }
preFilter %PlUs +
preFilter %NeG -
postFilter LaTeX \\LaTeX{}
postFilter ([^a]|^)TeX $1\\TeX{}
postFilter "(.*?)" ``$1''
# Formfeeds will force a new page
#
postFilter \014 \\newpage
# Do the complex escaping that TeX likes
#
# Handle tildes inside of url references. They are not to be quoted by TeX.
#
sub escapeTildes {local($_) = @_; s/\~/\%TiLdE\%/g; return $_}
postFilter/e (\\url\{.*?\}) &escapeTildes($1)
postFilter [\^\~] \\$&\{\}
postFilter %TiLdE% ~
postFilter \[ \\lbrack{}
postFilter \] \\rbrack{}
postFilter \| \\textbar{}
postFilter %lbrack% {
# AFT pragmas uses % which is mangled by postFilter before AFT can expand 'em
#
postFilter \%(\w+)?\% AfTSeT-$1-TeSTfA
# Escape characters TeX doesn't like.
#
postFilter [\#\%\_\&] \\$&
postFilter AfTSeT-(\w+)-TeSTfA %$1%
postFilter [\<\>] \$$&\$
#preFilter %LiNeBrEaK% \\\\
Title \\title{%title%}
Author \\author{%author%}\n\\maketitle
TOC \\tableofcontents
Image \\includegraphics{%image%}
Image-center \\begin{center}\n\\includegraphics{%image%}\n\\end{center}
Image-left \\begin{flushleft}\n\\includegraphics{%image%}\n\\end{flushleft}
Image-right \\begin{flushright}\n\\includegraphics{%image%}\n\\end{flushright}
* \\section{%text%}\n\\label{%section%}
** \\subsection{%text%}\n\\label{%section%}
*** \\subsubsection{%text%}\n\\label{%section%}
**** \\paragraph{%text%}\n\\label{%section%}
***** \\subparagraph{%text%}\n\\label{%section%}
****** \\addtolength{\\oddsidemargin}{1in}%text%\n\\label{%section%}
******* \\addtolength{\\oddsidemargin}{1in}%text%\n\\label{%section%}
^* \\section*{%text%}\n\\addcontentsline{toc}{section}{%text%}\n\\label{%section%}
^** \\subsection*{%text%}\n\\addcontentsline{toc}{subsection}{%text%}\n\\label{%section%}
^*** \\subsubsection*{%text%}\n\\addcontentsline{toc}{subsubsection}{%text%}\n\\label{%section%}
^**** \\paragraph*{%text%}\n\\label{%section%}
^***** \\subparagraph{%text%}\n\\label{%section%}
EndSect1
EndSect2
EndSect3
EndSect4
EndSect5
EndSect6 \\addtolength{\\oddsidemargin}{-1in}
EndSect7 \\addtolength{\\oddsidemargin}{-1in}
LineBreak \\\\
StartParagraph
EndParagraph
Center \\begin{center}\n%center%\n\\end{center}
Note \\footnote{%note%}
NotesAtEnd? no
HorizontalLine \\rule{\\linewidth}{1pt}
sub columns { my $ccnt = shift; return "".("l" x $ccnt)."" }
# deprecated LaTeX tabular style
# sub columns { my $ccnt = shift; return "||".("l|" x $ccnt)."|" }
# TableRowEnd \\\\ \\hline
StartTable \n\\begin{center}\n%caption%\\\\\n\\medskip\n\\begin{tabular}{%columns%}\n\\hline
TableHeader %stuff%
TableElement %stuff%
TableElementSep \&
TableRowStart
TableRowEnd \\\\
EndTable \n\\hline\n\\end{tabular}\n\\end{center}
#StartTable \\rule{\\linewidth}{1pt}\n\\begin{tabbing}
#TableCaption {\\textbf{%caption%}} \\\\
#TableHeader %stuff%\\=\\=
#TableElement %stuff%\\>\\>
#TableRowStart
#TableRowEnd \\\\
#EndTable \\rule{\\linewidth}{1pt}\n\\end{tabbing}
StartBulletList \\begin{itemize}
BulletListElement \\item[$\\bullet$]
EndBulletListElement
EndBulletList \\end{itemize}
StartNamedList \\begin{description}
NamedListElement \\item[%name%]
EndNamedListElement
EndNamedList \\end{description}
StartNumberedList \\begin{enumerate}
NumberedListElement \\item
EndNumberedListElement
EndNumberedList \\end{enumerate}
StartQuote \\begin{quotation}
EndQuote \\end{quotation}
PreFilterVerbatim? No
FullFilterFilteredVerbatim? Yes
StartVerbatim \\begin{verbatim}
EndVerbatim \\end{verbatim}
StartBlockedVerbatim \\begin{verbatim}
EndBlockedVerbatim \\end{verbatim}
StartFilteredVerbatim \\begin{alltt}
EndFilteredVerbatim \\end{alltt}
StartTeletype \\texttt%lbrack%
EndTeletype }
StartSmall {\\small%lbrack%
EndSmall }}
StartEmphasis \\emph%lbrack%
EndEmphasis }
StartStrong \\textbf%lbrack%
EndStrong }
CommentLine %%--- %line%
StrikeLine %%--- %line%
NBSPACE
|