skip to content
 

Putting TeX/LaTeX on the Web

While TeX is a great way of writing and printing mathematics, most computers don't speak TeX/LaTeX. If you wish to make your latest research paper available to your colleagues or the professional mathematical community, putting a .tex or .dvi file on your web page is OK, but if you want your students to be able to read your lecture notes and example sheets, you will need to convert your document into something that most computers in the world can be expected to understand.

Recommendations

Each of these will publish your document as an Adobe Acrobat PDF (Portable Document Format) file, which by convention has a filename ending in .pdf. This is a sufficiently standard document format that if someone else's computer can't read it you can consider it their problem and not yours.

Generating a .pdf file from TeX

The easiest way is to use pdftex or pdflatex to generate the pdf file directly. We believe that with modern versions of tex/latex this will include eps graphics (and several other formats) automatically. If this is incorrect please email help@maths with the details and try the alternative approach below.

Generate your .dvi file by running TeX or LaTeX in the usual way. Build a PostScript file with dvips, but say that you want it to be optimized for a PDF printer:

dvips -Ppdf filename.dvi -o filename.ps

Now use ps2pdf to generate a PDF file from the PostScript file (if you don't specify the paper size, it may produce a PDF file for American LETTER paper).

ps2pdf -sPAPERSIZE=a4 filename.ps filename.pdf

You now have a file filename.pdf which is an Adobe Acrobat file.

Publishing your .pdf file

Put this file into your web directory ~/public_html (or a sub-directory) and make a link to it from your personal home page ~/public_html/index.html. And you may also need to run chmod a+r filename so that everyone can read your file.

Other ways of putting TeX files on the web

PostScript

After building a PostScript file with dvips you can put it on the web as you would any other file. While PostScript files are more portable than TeX files (the reader need not have all the same TeX/LaTeX packages installed on his/her computer as you do on yours), they are not as universally understandable as PDF files, particularly in Windows environments.

HTML

The latex2html command can be used to convert LaTeX (not plain TeX) into HTML. Mathematics will be converted to images. This is more commonly used for HOWTOs and other documents where the ability to follow links from one section to another is useful.

MathML

MathML is the standard for publishing mathematics on the internet. Firefox has support for MathML and a MathML plugin for Internet Explorer is available at http://www.dessci.com/webmath/mathplayer/. Although these require different sorts of document (one uses XHTML, the other uses MathML islands in an HTML document), people can now read MathML if you put it on the web, so you can start to think about making your work available as a MathML document.

Google Chrome does not natively support MathML but it is possible to use the MathJax JavaScript display engine to publish mathematical formulae which will display in all browsers.

The Mozilla MathML project have links to MathML samples, and tools for generating it from TeX (you aren't expected to write directly in MathML, as it is very verbose).

MathML is considered the best way of making mathematical formulae accessible to blind and partially sighted people.

Other ways of producing PDF files

dvipdf
Converts dvi files to PDF.
ps2pdf
Converts PostScript files to PDF.