Lout
Encyclopedia
Lout is a batch document formatter invented by Jeffrey H. Kingston. It reads a high-level description of a document similar in style to LaTeX
LaTeX
LaTeX is a document markup language and document preparation system for the TeX typesetting program. Within the typesetting system, its name is styled as . The term LaTeX refers only to the language in which documents are written, not to the editor used to write those documents. In order to...

 and produces a PostScript
PostScript
PostScript is a dynamically typed concatenative programming language created by John Warnock and Charles Geschke in 1982. It is best known for its use as a page description language in the electronic and desktop publishing areas. Adobe PostScript 3 is also the worldwide printing and imaging...

 file which can be printed on most printers. Plain text
Plain text
In computing, plain text is the contents of an ordinary sequential file readable as textual material without much processing, usually opposed to formatted text....

 and PDF output are also available. The term Lout primarily designates a document formatting programming language, while the (only) implementation of the language (by Jeffrey H. Kingston) is sometimes referred to as Basser Lout. Basser Lout is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

, distributed under the terms of the GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

.

Lout copies some of its formatting algorithms from TeX
TeX
TeX is a typesetting system designed and mostly written by Donald Knuth and released in 1978. Within the typesetting system, its name is formatted as ....

 but is intended to be much easier to program due to the use of high-level functional programming
Functional programming
In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast to the imperative programming style, which emphasizes changes in state...

 language, instead of a macro language.

While a typical installation of LaTeX
LaTeX
LaTeX is a document markup language and document preparation system for the TeX typesetting program. Within the typesetting system, its name is styled as . The term LaTeX refers only to the language in which documents are written, not to the editor used to write those documents. In order to...

, together with TeX
TeX
TeX is a typesetting system designed and mostly written by Donald Knuth and released in 1978. Within the typesetting system, its name is formatted as ....

 binaries takes from 50 to 300 MB, Lout is about 1 MB. This is mainly due to fewer packages and tools, but might also be attributed to a C implementation instead of macro language source code.

Lout comes with an easy-to-read user guide, and the basics can be learnt in a couple of hours.
It includes packages for creating tables, charts, equations, and diagrams, everything in one package "out of the box". Lout is useful for creating
reports and books and gives very precise control over typesetting.

Document formatting with Lout

While the core of the Lout programming language provides only low-level operations, similar to that of TeX
TeX
TeX is a typesetting system designed and mostly written by Donald Knuth and released in 1978. Within the typesetting system, its name is formatted as ....

, the packages that come with Basser Lout provide a complete high-level markup language
Markup language
A markup language is a modern system for annotating a text in a way that is syntactically distinguishable from that text. The idea and terminology evolved from the "marking up" of manuscripts, i.e. the revision instructions by editors, traditionally written with a blue pencil on authors' manuscripts...

 that users may use directly to produce documents, in a way that is similar to LaTeX
LaTeX
LaTeX is a document markup language and document preparation system for the TeX typesetting program. Within the typesetting system, its name is styled as . The term LaTeX refers only to the language in which documents are written, not to the editor used to write those documents. In order to...

.

A very simple Lout document may look like this:

# This is a comment.

# Use the `doc' document class and its default style.
@SysInclude { doc }

@Document
@InitialFont { Times Base 10p }
//

# Beginning of document contents.
@Text @Begin

@PP
This is a paragraph. One can easily embed @B { bold } or
@I { italic } text. One can also easily change the style of
text, such as { Helvetica Base } @Font { changing the font
being used }.

@BeginSections
@Section @Title { The First Section }
@Begin

@PP
This is the content of a section.

@End @Section
@EndSections

@End @Text
# End of the document.

Different document types are available: doc, report, book, but also slides (for overhead transparencies) and illustration (for stand-alone illustrations). Customizing a document style is usually relatively easy, even to the non-programmer.

Programming language features

The Lout programming language is similar to other functional languages. The core programming language consists of less than 30 primitive operators. Some features make it particularly close to Haskell
Haskell (programming language)
Haskell is a standardized, general-purpose purely functional programming language, with non-strict semantics and strong static typing. It is named after logician Haskell Curry. In Haskell, "a function is a first-class citizen" of the programming language. As a functional programming language, the...

, notably the fact that Lout expressions are lazily evaluated
Lazy evaluation
In programming language theory, lazy evaluation or call-by-need is an evaluation strategy which delays the evaluation of an expression until the value of this is actually required and which also avoids repeated evaluations...

. Lout also provides constructs needed for the implementation of document formatting that are not commonly found in other programming languages, such as galleys. Unlike most other functional programming languages, Lout does not provide, for instance, first-class function
First-class function
In computer science, a programming language is said to have first-class functions if it treats functions as first-class objects. Specifically, this means that the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning...

s.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK