# 10.1. C2LaTeX (Other tools - Literate Programming)

## Description

This article is from the Literate Programming FAQ, by David B. Thompson thompson@shelob.ce.ttu.edu with numerous contributions by others.

# 10.1. C2LaTeX (Other tools - Literate Programming)

Developer:
John D. Ramsdell

Version:
Unknown

Hardware:
Unix

Languages:
C

Formatter:
LaTeX but it's easy to change the formatter.

Availability:
Anonymous ftp from ftp://omnigate.clarkson.edu/pub/tex/
programs/c2latex.

Readme:
Absent. Documentation is in the C source for c2latex.

Description:
C2latex provides simple support for literate programming in C.
Given a C source file in which the comments have been written in
LaTeX, c2latex converts the C source file into a LaTeX source
file. It can be used to produce typeset listings of C programs
and/or documentation associated with the program.

C2latex produces LaTeX source by implementing a small number of
rules. A C comment that starts at the beginning of a line is
copied unmodified into the LaTeX source file. Otherwise, non-
blank lines are surrounded by a pair of formatting commands
(\begin{flushleft} and \end{flushleft}), and the lines are
separated by \\*. Each non-blank line is formatted using LaTeX's
\verb command, except comments within the line are formatted in
an \mbox.

Support:
Send bug reports to ramsdell@mitre.org.

Continue to: