Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
Preparing LaTeX documents for the World-Wide Web
[go: Go Back, main page]

Preparing LaTeX documents for the World-Wide Web

Index

Samples

Here is a TOPLAS article, prepared for the web in several different ways. In all cases, LaTeX2e was used, along with the acmtrans2e.cls class file.

LaTeX style files

A number of people have worked to produce LaTeX style files that produce documents formatted appropriately for ACM Transactions. The files avaiable are:

Document formats

In preparing a latex document for distribution on the world-wide web, the first question is the format in which you which to distribute it. You have several options:

HTML
In this case, you probably want to use the tool latex2html. This tool does a fairly good job of converting the content of a latex document to HTML, but the result only has a faint resemblence to the apperence of your original document (which is appropriate, since HTML doesn't describe apperence). A big advantage of this is that is can be read on pretty much any WWW browser (including text-only browsers, such as lynx).
postscript
postscript was developed as a format for sending documents to printers. There are a fair number of issues involved in generating portable postscript, some of which are described in a seperate document. Postscript works fairly well if you just download it in order to print it out. To view postscript on-screen, you need special tools such as ghostview. Ghostview works fairly well once it is set-up, but it a fairly difficult process to set it up on your own personal computer.
PDF - portable document format
PDF is a postscript variant which is designed to allow on-screen viewing. You can print a PDF document from a PDF viewer. There are a number of tools for converting between PDF and postscript, including Adobe's Distiller (part of the full Adobe Acrobat package). PDF can be enriched with a number of additional features, such as thumbnails, bookmarks, hyperlinks, and there are freely available viewers available from Adobe, as well as plug-ins for WWW browsers. The viewing software somewhat more polished than ghostview and easy to install on personal computers.

Font options

When generating postscript from latex, you have several options about how to describe the fonts. Most LaTeX documents use the Computer Modern fonts developed by Donald Knuth. These fonts are rarely used outside of TeX.

Embedded font bitmaps
This is usually the default method of handling fonts. The generated postscript file contains bitmap representation of the fonts used in the document. One critical issue is the resolution of the bitmaps. This is very installation dependent, but is often 300 dots/inch. If your postscript is generated with 300 dots/inch bitmap fonts, then you will see little or no improvement when printing your document on a 600 dots/inch laserprinter, compared with a 300 dot/inch laserprinter. Another problem with bitmap fonts is that when the document is shown on screen, the bitmaps need to be scaled or shrunk by uneven multiples, which often leads to a very poor apperence.
Embedded postscript fonts
You can embed actual postscript fonts in the postscript for your document. This produces the best apperence for both screen and printing. However, there are several drawbacks.
Omitted fonts
You can generate postscript from latex that doesn't contain font descriptions, just font names. Since few tools and no printers come with the computer modern fonts installed, this is strongly discouraged if you are using Computer Modern fonts. If you change the font selection so that you are using fonts such as Times Roman and Helvetica, this is reasonable.

Getting dvips to refrain from embedding bitmap fonts

This document describes how to get dvips to generate postscript files that do not contain embedded bitmap fonts.

A more detailed explaination of this process is given by a document on Adobe's website. This is intended to be a shorter description that doesn't explain the process as much.

The font substitution list

You need to create a font substitution list file for use by dvips. Each line of this file starts with the name of a font as used within TeX, such as cmb10. The rest of the line can contain:

Specifying a font substitution list

If your home directory contains a file .dvipsrc containing a line:

p +fontMapFileName

that font map will be used for all dvips jobs you run. Alternatively, you can create a file such config.embed which contains the same line. Then, when you invoke dvips with the command dvips -P embed ... , it will look for config.embed in the current directory (and perhaps your home directory). How dvips looks for config files is dependent on your installation and can be changed using the TEXCONFIG environment variable as described in the "Environment Variables" section of the dvips documentation.

Font appearence

Font 1x magnification 8x magnification
300 dots/inch bitmap fonts
600 dots/inch bitmap fonts
Type 1 postscript fonts

File size

This table shows the file sizes for a 41 page LaTeX document prepared using the ACM transactions style file.
Font postscript (ps) portable document
format (pdf)
normal gzip'd normal gzip'd
300 dots/inch bitmap fonts 408K 126K 388K 199K
600 dots/inch bitmap fonts 737K 178K 441K 306K
Type 1 postscript fonts 1,782K 879K 425K 326K