HTML to LaTeX

Nothing you choose here leaves your browser, and nothing is downloaded to make it work — which for LaTeX means something specific, and the next section explains what.

…or drop a file anywhere on this page.

A .htm is the same file as a .html — the short extension is a leftover from MS-DOS, which allowed only three characters after the dot. This page takes either. More about that.

A web page turned into something you can typeset.

Headings, paragraphs, emphasis, lists, quotations, code blocks, links and images all have LaTeX equivalents and are carried across. The result is a complete document with a preamble that loads the packages its own output uses, so it compiles as it stands rather than needing three more lines you have to guess at.

LaTeX is a programming language, and that changes what can be promised

Every other format on this site is markup: the same characters always mean the same thing. LaTeX is a macro processor. A document can say \newcommand{\thing}[1]{\textbf{#1}} and from that line on \thing{x} means bold — a meaning that exists nowhere but in that document. It can pull in other files, redefine \section, or compute.

Nothing short of running TeX knows what an arbitrary document produces, and running TeX in a browser means downloading a TeX distribution: tens of megabytes, which is the one thing this site does not do. So this reads the commands people actually write, lists them below, and counts everything outside that list rather than dropping it quietly. That is a smaller promise than “converts LaTeX” and it is the one that is true.

Three things that are easy to get wrong

The document class decides the section levels. In article there is no \chapter and \section is the top level; in book and report \chapter is the top and \section sits below it. A converter with one fixed table makes every book's chapters and sections the same size. The class is read from \documentclass and the mapping follows it.

A percent sign starts a comment — unless it is \%. And \\% starts one again, because the first backslash escapes the second. Counting the backslashes in front is the only way to tell, and a naive strip takes the rest of the line off every escaped percent in the document — which in a paper full of percentages is most of it.

An accent is a command. \'e is é, \"o is ö, \c{c} is ç. A reader that does not know them prints the backslash and the letter separately, so every French or German document arrives covered in stray apostrophes and quotation marks.

What is read, and what is not

Read: sectioning down to \subparagraph, itemize, enumerate and description lists, quote, verbatim and lstlisting, \emph, \textbf, \texttt and their relatives, \href and \url, \includegraphics, \footnote, \verb, the accent commands, the dashes and quotation-mark ligatures, and the title and author from the preamble.

Not read: mathematics — which is kept as its own source in a marked block rather than rendered or deleted — tables, whose cells are shown but whose structure is not rebuilt, bibliographies and citations, and anything a package defines. A custom macro cannot be expanded without running TeX, so its uses keep their words and the number of definitions is reported. \input and \include cannot be followed: the other files are not here.

And there is no LaTeX to PDF. That is what TeX itself is for, and it is the one job that genuinely needs the whole distribution — fonts, hyphenation patterns, the lot. Overleaf or a local TeX install will do it properly.

Where to go next