# Converting structured LaTeX to other formats

## David W. Farmer

## American Institute of Mathematics

# AIM collected works

## Late 1990s-now: binders with an online catalog

# Math papers online

## Convert *math papers* to an online format

## Papers traditionally available in PDF

## Now: convert to html with knowls

# SL2X: Structured LaTeX to XML

View LaTeX as just a markup language, and exploit the simple structure of math papers.
## Separate the header, preamble, and bibliography

## Pull out the macros, and expand some of them

## Separate the sections, subsections, and subsubsections

## In each (sub/subsub)section extract the environments

### verbatim

### equations

### figures

### lists and tables

### theorems/definitions/equations/proofs

### paragraphs

## Find all the \label{...}s

## Number everything

## Reassemble the pieces

### convert remaining markup: \emph{...} to < em >...< /em>, etc.

### wrap each environment in appropriate tags

### make a separate file for each \label{...}ed object

### convert \ref{...} and \cite{...} to appropriate links/knowls

# Next steps

## Convert to XML

## Merge with an existing LaTeX to (HT/X)ML conversion program?

## Handle a wider variety of LaTeX. How much?

### Images, tables, macros,...

image and table in MathJax.
table in html