# Lout AFT 5.0 rules

ID	LOUT


######################################################################
# COPYRIGHTS	
#
# Almost Free Text (AFT) 
# Todd A. Coram (todd@digicool.com)
# http://www.maplefish.com/todd/
#
# Basser Lout 
# Jeffrey H. Kingston (jeff@cs.usyd.edu.au)
# http://snark.ptc.spbu.ru/~uwe/lout/
#
# THANKS 
#
# Todd Coram for modifying AFT to support Lout structure and for his
# help and kindness!
#
# DISCLAIMER 
#
# This file's a user contribution. Neither copyrights nor
# warranties. Use at your own risk --it doesn't look dangerous
# though--. If you like the ease of AFT and the power of Lout feel
# free to hack it and please send me your work or ideas.
#
# Enjoy!
#		 	Abel Morabito (amorabito@funescoop.com.ar)
#
# April, 2001
#
######################################################################


######################################################################
# 			Preamble and postamble
######################################################################

Preamble{
# Basser Lout Version 3.24 output generated by AFT 
######################################################################
#@SysInclude {tbl}		# Table formatting
#@SysInclude {eq}		# Equations
#@SysInclude {graph}		# Graphs
#@SysInclude {diag}		# Diagrams
#@SysInclude {cprint}		# C, C++
#@SysInclude {eiffel}		# Eiffel
#@SysInclude {blue}		# Blue
#@SysInclude {perl}		# Perl
#@SysInclude {pod}		# POD
#@SysInclude {python}		# Python
@SysInclude {report}		# @SysInclude (system) @Include (local)
@Report 
@Title {%title%}
@Author {%author%}
#@Institution { }
#@DateLine {No}			# Date, Yes (present), No
#@AtEnd { } 			# To include a back cover
#@CoverSheet {No}		# Make a cover sheet
#@ContentsSeparate {No}		# Make a TOC on a separate page
#@InitialFont {Times Base 12p}	# Courier Helvetica Palatino Times ...
#@InitialBreak {hyphen adjust 1.2fx} # hyphen nohyphen; adjust ragged ...
@InitialSpace {tex}		# lout tex troff
#@InitialLanguage {English}	# English  French German Spanish ...
#@PageOrientation {Portrait}	# Portrait Landscape
#@PageHeaders {Simple} 		# None Simple Titles NoTitles
#@ColumnNumber {1}
#@FirstPageNumber {1}
@OptimizePages {Yes}		# Use TeX optimal paragraph breaking
#@AbstractDisplay {No}		# Show the abstract
#@AbstractTitle {Abstract}	# Type whatever abstract title you want
#@Abstract { }			# Type your abstract between braces

//

}Preamble

Postamble{

}Postamble

######################################################################
# 			Pre and postfilters
######################################################################

# MANUAL FORM FEED
prefilter	\014		@NP 

# SPECIAL CHARACTERS 
#
#	Plain	Literal		Plain	Literal
#
#	"	"\""		@	"@"		
#	|	"|"		#	"#"		
#	\	"\\"		}	"}"
#	&	"&"		^	"^"		
#	~	"~"		/	"/"		
#	{	"{"			" "	(blank space)
#							

## Protect backslashes, then escape quotation marks and backslashes.
## They mess each other if you don't do it this way.

preFilter	\\		-BSlAsH-
preFilter	\"		\"\\\"\"
preFilter	-BSlAsH-	\"\\\\"

## Protect targets, references and links. Escape braces and 'at'.

preFilter	\{\-([^\}]+)\@([^\}]+)\-\}	%LeFtB%NeG$1-AtChAr-$2%NeG%RiGhTB

preFilter 	\{\+([^\}]+)\+\}	%LeFtB%PlUs$1%PlUs%RiGhTB
preFilter	\}\+([^\}]+)\+\{	%RiGhTB%PlUs$1%PlUs%LeFtB
preFilter	\{\-([^\}]+)\-\}	%LeFtB%NeG$1%NeG%RiGhTB
preFilter	\}\-([^\}]+)\-\{	%RiGhTB%NeG$1%NeG%LeFtB

preFilter	[\{\}\@]	\"$&\"

preFilter	%LeFtB		{
preFilter	%RiGhTB		}
preFilter	%PlUs		+
preFilter	%NeG		-
preFilter	-AtChAr-	@

### This is to type loutish typographic quotes directly ``like this'' 
### instead of ``like this'''' --both work anyway.

preFilter	\`\`([^\']+)\'\'\'\'	``$1-4QuOtEs-
preFilter	\`\`([^\']+)\'\'	``$1-2QuOtEs-
preFilter	-4QuOtEs-		''''
preFilter	-2QuOtEs-		''''

## Escape some other special characters.

preFilter	[\#\&\^\/]	\"$&\"

## Escape tildes not used to make small caps. Double tildes are replaced
## by single ones to get protected spaces.

preFilter	\~\~		-DTiLdE-
postFilter	\~		\"~\"
postFilter	-DTiLdE-	~

### Escape vertical bars not used to make teletype.

postFilter	\|		\"|\"


######################################################################
# 				Elements
######################################################################

# There are lots of newlines '\n' you could delete if you dislike so 
# many blank spaces in your code.


#REFERENCES TARGETS and URLs --no hyperlinks in lout files.

URL			@F {<%target%>} 
InternalReference	%text% (p. @PageOf {%target%}) 
Target			%text% @PageMark {%target%}  


# TITLE and AUTHOR: see 'Preamble' 

#OutputTitle	
#Title		
#Author		

# TABLE OF CONTENTS 

TOC	# TOC must be made from your lout file. 


## IMAGES 

Image		@IncludeGraphic %image%
Image-center	\n@CD @IncludeGraphic %image% 
Image-left	\n@LD @IncludeGraphic %image% 
Image-right	\n@RightDisplay @IncludeGraphic %image% 


## NUMBERED STRUCTURES 

*		\n@Section @Title {%section%} @Tag {%section%} @Begin 
**		\n@SubSection @Title {%section%} @Tag {%section%} @Begin 
***		\n@SubSubSection @Title {%section%} @Tag {%section%} @Begin 
****		
EndSect1	\n@End @Section 
EndSect2	\n@End @SubSection 
EndSect3	\n@End @SubSubSection 
EndSect4	
#BeginSectLevel1	\n@BeginSections 
#EndSectLevel1		\n@EndSections 
BeginSectLevel2		\n@BeginSubSections 
EndSectLevel2		\n@EndSubSections 
BeginSectLevel3		\n@BeginSubSubSections 
EndSectLevel3		\n@EndSubSubSections 


# SECTIONS REFERENCING TOC are not needed.
#
#^*		
#^**		
#^***		
#^****		


# MISC

LineBreak	\n@LLP 
StartParagraph	\n@PP\n 
EndParagraph	
ParagraphBreak	
NoteRef		@Sup {%ref%} 
Superscript	@Sup {%stuff%} 
Subscript	@Sub {%stuff%} 
Center		\n@CD {%center%} 
HorizontalLine	\n@D @FullWidthRule 


## TABLES are not supported. Just make them in your Lout file.

StartTable	### WARNING: AFT doesn't support Lout tables yet! ###
#TableCaption		
#TableHeader		
#TableElement		
#TableRowStart		
#TableRowEnd		
#EndTable		


## LISTS 

StartBulletList		\n@BL 
BulletListElement	\n@LI {\n
EndBulletListElement	\n}
EndBulletList		\n@EndList 

StartNamedList		\n@TL 
NamedListElement	\n@DTI {%name%} {\n
EndNamedListElement	\n}
EndNamedList		\n@EndList 

StartNumberedList	\n@PNL 
NumberedListElement	\n@LI {\n
EndNumberedListElement	\n}
EndNumberedList		\n@EndList 


## QUOTED TEXT

StartQuote		\n@QD { 
EndQuote		} 


## FONT FACES 

### Lout's verbatim mode doesn't process lout markup so
PreFilterVerbatim?		No

### Full filtering is needed mainly by AFTWEB --not by Lout, so
FullFilterFilteredVerbatim?	No

### Verbatim modes now
StartVerbatim		\n@ID @F @Verbatim {
EndVerbatim		}
StartBlockedVerbatim	\n@ID @F @Verbatim @Begin
EndBlockedVerbatim	\n@End @Verbatim 

### Filtered verbatim is messy in Lout so 
StartFilteredVerbatim  \n@ID @F @Verbatim @Begin
EndFilteredVerbatim    \n@End @Verbatim 

### Remaining font faces
StartTeletype		@F {
EndTeletype		} 

StartSmall		@S {
EndSmall		}

StartEmphasis		@I {
EndEmphasis		}

StartStrong		@B {
EndStrong		}


## OTHER 

CommentLine		# %line% 
StrikeLine		# %line% 

NBSPACE			\" \"











