1# AFT rules for Lout books 2 3# COPYRIGHTS 4# Almost Free Text (AFT) 5# Todd A. Coram (todd@maplefish.com) 6# http://www.maplefish.com/todd/ 7# 8# Basser Lout 9# Jeffrey H. Kingston (jeff@cs.usyd.edu.au) 10# http://snark.ptc.spbu.ru/~uwe/lout/ 11# 12# THANKS 13# Todd Coram for modifying AFT to support Lout structure and for his 14# help and kindness! 15# 16# DISCLAIMER 17# This file's a user contribution. Neither copyrights nor 18# warranties. Use at your own risk --it doesn't look dangerous 19# though--. If you like the ease of AFT and the power of Lout feel 20# free to hack it and please send me your work or ideas. Enjoy! 21# 22# Abel Morabito (amorabito@funescoop.com.ar) 23# April, 2001 24 25ID LOUTBOOK 26# Preamble and postamble 27###################################################################### 28Preamble{ 29# Basser Lout Version 3.25 - Book - Output generated by AFT 5.08 30@SysInclude { book } 31@Book 32@Title {%title%} 33@Author {%author%} 34@Edition {} 35@Publisher {} 36@BeforeTitlePage {} 37@OnTitlePage {} 38@AfterTitlePage {} 39@AtEnd {} 40@InitialFont { Times Base 12p } 41@InitialBreak { adjust 1.2fx hyphen } 42@InitialSpace { tex } 43@InitialLanguage { Spanish } 44@PageOrientation { Portrait } 45@PageHeaders { Titles } 46@ColumnNumber { 1 } 47@FirstPageNumber { 1 } 48@IntroFirstPageNumber { 1 } 49@OptimizePages { Yes } 50// 51}Preamble 52Postamble{ 53}Postamble 54 55# Pre and postfilters 56###################################################################### 57# MANUAL FORM FEED 58prefilter \014 @NP 59 60# SPECIAL CHARACTERS 61# 62# Plain Literal Plain Literal 63# 64# " "\"" @ "@" 65# | "|" # "#" 66# \ "\\" } "}" 67# & "&" ^ "^" 68# ~ "~" / "/" 69# { "{" " " (blank space) 70# 71 72## Protect backslashes, then escape quotation marks and backslashes. 73## They mess each other if you don't do it this way. 74preFilter \\ -BSlAsH- 75preFilter \" \"\\\"\" 76preFilter -BSlAsH- \"\\\\" 77 78## Protect targets, references and links. Escape braces and 'at'. 79preFilter \{\-([^\}]+)\@([^\}]+)\-\} %LeFtB%NeG$1-AtChAr-$2%NeG%RiGhTB 80 81preFilter \{\+([^\}]+)\+\} %LeFtB%PlUs$1%PlUs%RiGhTB 82preFilter \}\+([^\}]+)\+\{ %RiGhTB%PlUs$1%PlUs%LeFtB 83preFilter \{\-([^\}]+)\-\} %LeFtB%NeG$1%NeG%RiGhTB 84preFilter \}\-([^\}]+)\-\{ %RiGhTB%NeG$1%NeG%LeFtB 85 86preFilter [\{\}\@] \"$&\" 87 88preFilter %LeFtB { 89preFilter %RiGhTB } 90preFilter %PlUs + 91preFilter %NeG - 92preFilter -AtChAr- @ 93 94### This is to type loutish typographic quotes directly ``like this'' 95### instead of ``like this'''' --both work anyway. 96preFilter \`\`([^\']+)\'\'\'\' ``$1-4QuOtEs- 97preFilter \`\`([^\']+)\'\' ``$1-2QuOtEs- 98preFilter -4QuOtEs- '''' 99preFilter -2QuOtEs- '''' 100 101## Escape some other special characters. 102preFilter [\#\&\^\/] \"$&\" 103 104## Escape tildes not used to make small caps. Double tildes are replaced 105## by single ones to get protected spaces. 106preFilter \~\~ -DTiLdE- 107postFilter \~ \"~\" 108postFilter -DTiLdE- ~ 109 110### Escape vertical bars not used to make teletype. 111postFilter \| \"|\" 112 113 114# Elements 115###################################################################### 116 117#REFERENCES TARGETS and URLs --no hyperlinks in lout files. 118URL @F {<%target%>} 119InternalReference %text% (p. @PageOf {%target%}) 120Target %text% @PageMark {%target%} 121 122 123# TITLE and AUTHOR: see 'Preamble' 124#OutputTitle 125#Title 126#Author 127 128# TABLE OF CONTENTS 129TOC # TOC should be made from your lout file. 130 131 132## IMAGES 133Image \n@IncludeGraphic %image% 134Image-center \n@CD @IncludeGraphic %image% 135Image-left \n@LD @IncludeGraphic %image% 136Image-right \n@RightDisplay @IncludeGraphic %image% 137 138 139## NUMBERED STRUCTURES 140* \n@Chapter @Title {%section%} @Tag {%section%} @Begin 141** \n@Section @Title {%section%} @Tag {%section%} @Begin 142*** \n@SubSection @Title {%section%} @Tag {%section%} @Begin 143**** \n@SubSubSection @Title {%section%} @Tag {%section%} @Begin 144EndSect1 \n@End @Chapter 145EndSect2 \n@End @Section 146EndSect3 \n@End @SubSection 147EndSect4 \n@End @SubSubSection 148BeginSectLevel1 149EndSectLevel1 150BeginSectLevel2 \n@BeginSections 151EndSectLevel2 \n@EndSections 152BeginSectLevel3 \n@BeginSubSections 153EndSectLevel3 \n@EndSubSections 154BeginSectLevel4 \n@BeginSubSubSections 155EndSectLevel4 \n@EndSubSubSections 156 157# SECTIONS REFERENCING TOC are not needed in Lout 158# 159#^* 160#^** 161#^*** 162#^**** 163 164 165# MISC 166LineBreak \n@LLP 167StartParagraph \n@PP\n 168EndParagraph 169ParagraphBreak 170NoteRef @Sup {%ref%} 171Superscript @Sup {%stuff%} 172Subscript @Sub {%stuff%} 173Center \n@CD {%center%} 174HorizontalLine \n@D @FullWidthRule 175 176 177## TABLES are not supported. Just make them in your Lout file. 178StartTable ######## WARNING: AFT doesn't support Lout tables yet! ######## 179#TableCaption 180#TableHeader 181#TableElement 182#TableRowStart 183#TableRowEnd 184#EndTable 185 186 187## LISTS 188StartBulletList \n@BL 189BulletListElement \n@LI {\n 190EndBulletListElement \n} 191EndBulletList \n@EndList 192 193StartNamedList \n@TL 194NamedListElement \n@DTI {%name%} {\n 195EndNamedListElement \n} 196EndNamedList \n@EndList 197 198StartNumberedList \n@PNL 199NumberedListElement \n@LI {\n 200EndNumberedListElement \n} 201EndNumberedList \n@EndList 202 203 204## QUOTED TEXT 205StartQuote \n@QD { 206EndQuote } 207 208 209## FONT FACES 210### Lout's verbatim mode doesn't process lout markup so 211PreFilterVerbatim? No 212 213### Full filtering is needed mainly by AFTWEB --not by Lout, so 214FullFilterFilteredVerbatim? No 215 216### Verbatim modes now 217StartVerbatim \n@ID @F @Verbatim { 218EndVerbatim } 219StartBlockedVerbatim \n@ID @F @Verbatim @Begin 220EndBlockedVerbatim \n@End @Verbatim 221 222### Filtered verbatim is messy in Lout so 223StartFilteredVerbatim \n@ID @F @Verbatim @Begin 224EndFilteredVerbatim \n@End @Verbatim 225 226### Remaining font faces 227StartTeletype @F { 228EndTeletype } 229 230StartSmall @S { 231EndSmall } 232 233StartEmphasis @I { 234EndEmphasis } 235 236StartStrong @B { 237EndStrong } 238 239## OTHER 240CommentLine # %line% 241StrikeLine # %line% 242NBSPACE \" \" 243 244 245 246 247 248 249 250 251 252 253 254