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 is an emulsion (stable dispersion) of polymer microparticles in water. Latexes are found in nature, but synthetic latexes are common as well.
In nature, latex is found as a milky fluid found in 10% of all flowering plants (angiosperms ...
and produces a
PostScript
PostScript (PS) is a page description language in the electronic publishing and desktop publishing realm. It is a dynamically typed, concatenative programming language. It was created at Adobe Systems by John Warnock, Charles Geschke, Doug Br ...
file which can be printed on most printers.
Plain text
In computing, plain text is a loose term for data (e.g. file contents) that represent only characters of readable material but not its graphical representation nor other objects (floating-point numbers, images, etc.). It may also include a limit ...
and
PDF
Portable Document Format (PDF), standardized as ISO 32000, is a file format developed by Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, hardware, and operating systems. ...
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 or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, no ...
, distributed under the terms of the
GNU General Public License
The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the Four Freedoms (Free software), four freedoms to run, study, share, and modify the software. The license was th ...
.
Lout copies some of its formatting algorithms from
TeX
Tex may refer to:
People and fictional characters
* Tex (nickname), a list of people and fictional characters with the nickname
* Joe Tex (1933–1982), stage name of American soul singer Joseph Arrington Jr.
Entertainment
* ''Tex'', the Italian ...
but is intended to be much easier to program due to the use of high-level
functional programming
In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declar ...
language, instead of a
macro language
In computer programming, a macro (short for "macro instruction"; ) is a rule or pattern that specifies how a certain input should be mapped to a replacement output. Applying a macro to an input is known as macro expansion. The input and output ...
.
While a typical installation of
LaTeX
Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latexes are found in nature, but synthetic latexes are common as well.
In nature, latex is found as a milky fluid found in 10% of all flowering plants (angiosperms ...
, together with
TeX
Tex may refer to:
People and fictional characters
* Tex (nickname), a list of people and fictional characters with the nickname
* Joe Tex (1933–1982), stage name of American soul singer Joseph Arrington Jr.
Entertainment
* ''Tex'', the Italian ...
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 learned 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 may refer to:
People and fictional characters
* Tex (nickname), a list of people and fictional characters with the nickname
* Joe Tex (1933–1982), stage name of American soul singer Joseph Arrington Jr.
Entertainment
* ''Tex'', the Italian ...
, the packages that come with Basser Lout provide a complete high-level
markup language
Markup language refers to a text-encoding system consisting of a set of symbols inserted in a text document to control its structure, formatting, or the relationship between its parts. Markup is often used to control the display of the document ...
that users may use directly to produce documents, in a way that is similar to
LaTeX
Latex is an emulsion (stable dispersion) of polymer microparticles in water. Latexes are found in nature, but synthetic latexes are common as well.
In nature, latex is found as a milky fluid found in 10% of all flowering plants (angiosperms ...
.
A very simple Lout document may look like this:
# This is a comment.
# Use the `doc' document class and its default style.
@SysInclude
@Document
@InitialFont
//
# Beginning of document contents.
@Text @Begin
@PP
This is a paragraph. One can easily embed @B or
@I text. One can also easily change the style of
text, such as @Font .
@BeginSections
@Section @Title
@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 () is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research and industrial applications, Haskell has pioneered a number of programming lang ...
, notably the fact that Lout expressions are
lazily evaluated. 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
In computer science, a programming language is said to have first-class functions if it treats functions as first-class citizens. This means the language supports passing functions as arguments to other functions, returning them as the values from ...
s.
Security issues
In 2019
Common Vulnerabilities and Exposures
The Common Vulnerabilities and Exposures (CVE) system provides a reference-method for publicly known information-security vulnerabilities and exposures. The United States' National Cybersecurity FFRDC, operated by The MITRE Corporation, maintai ...
listed two
buffer overflow
In information security and programming, a buffer overflow, or buffer overrun, is an anomaly whereby a program, while writing data to a buffer, overruns the buffer's boundary and overwrites adjacent memory locations.
Buffers are areas of memory ...
issues in Lout, which can be exploited if untrusted documents are processed.
Debian
Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of D ...
removed Lout in October 2020 due to these issues not having been patched; the package had had no maintainer since 2013.
The buffer overflow issues have been corrected and the system is now maintained a
https://github.com/william8000/lout
References
External links
Original Home pageCurrent, maintained system
{{Document markup languages
Free typesetting software
Typesetting programming languages