Penguin

The following, while perhaps technically correct, is ALL superceded by the pdflatex(1) command. Use it! It is so much better. It will generate thumbnails, bookmarks, correctly embed fonts etc, all with one simple command line (two if you're a stickler for correctness; run it once to generate the indexes and again to fill it in.) Only read what is below if for some reason you can't use pdflatex(1).

pdflatex filename.tex; pdflatex filename.tex

Done


I think you are being a bit over zealous there, not all things are solved by using pdflatex(1). Infact there are a number of problems introduced by using it.

The first on is if you are a normal LaTeX user, you create all your figures as .eps which pdflatex cannot include. The proposed suggestion aparently is to convert all figures to a .pdf using epstopdf.

You then loose the ability to build a .ps file directly from latex using the normal dvips stuff as all of your figures are now .pdf's. This is a big deal if all of the printers speak native .ps, but require the use of acroread or xpdf to print .pdfs. I know that can be fixed using print filters but thats just another pdf2ps extra layer comming in.

Contary to the above comment all the documentation I have found, and with the play around I had with pdflatex(1) the only way to add thumnails requires the use of an extra external command (thumpdf), and can be achieved in exactly the same way with the divps -> ps2pfd system as well.

Adding bookmarks to the final .pdf can also be achieved with no extra complexity using the dvips method. Both methods of adding bookmarks require extra support in your document, and will not be included at no extra cost by pdflatex(1) as suggested.

A good page documenting both methods, as well as providing an example document that can be build with both latex and pdflatex is here. The example document uses condidional statements to detect the build enviroment and change the options depending on this, as well as changing the default extension so that it includes the .eps if it's being built with latex and .pdf if being built with pdflatex.

Obviously this still requires you to use epstopdf on all of your figures after saving them unless your figure editor supports exporting to both .eps and .pdf for you.

Personally due to the number of documents I have, I'll stick with the way that doesn't require me to alter the headers and figure includes in all documents. Maybe I will try to look into doing it the "proper" way for new docs.


Additionally (not already mentioned above), using PDFLaTeX makes it impossible to use PostScript tricks like psfrag (for relabelling EPS files) without irritating workarounds like writing a LaTeX wrapper for every EPS file.


This came from here

PDF Output from LaTeX

Introduction

I've found out how to make beautiful PDFs in LaTeX, even using Computer Modern fonts (the default). No more jagged letters (or crashed acroreads). The instructions given here are aimed at Linux (specifically RedHat 6.2), but should work for all other up-to-date LaTeX/ghostscript platforms.

The secrets are buried here (the guidelines of the National Science Foundation).

The story is that the AMS paid people to convert Don Knuth's Computer Modern fonts (which are generated as high quality bitmaps) into proper "Type 1" PostScript fonts, which are infinitely scaleable outline fonts. These can be embedded into PDFs to give the same quality as the built-in fonts. These fonts are freely-redistributable.

Requirements

You must use ghostscript 6 - this cannot be distributed commercially, but is free (with source) for any other use (every time a new version comes out, the second-latest version is rereleased under GNU GPL). This version knows how to embed fonts into PDFs.

You must also have a recent LaTeX to get the fonts and a version of dvips which knows about them (i.e. that distributed with RedHat 6.2).

Step by step

Example: Write myfile.tex (an a4paper document).

latex myfile latex myfile dvips -Ppdf -G0 myfile.dvi -o myfile.ps ps2pdf -sPAPERSIZE=a4 -dMaxSubsetPct=100 -dCompatibilityLevel=1.2 \

  • dSubsetFonts=true -dEmbedAllFonts=true myfile.ps

The ps2pdf command is one line (that's what the backslash means).

The first step is to make PostScript in which all nonstandard (e.g. Computer Modern) fonts are embedded. This is what the dvips command does. The -Dpdf is a fake printer device which is set up to embed all fonts, in preparation for PDF distillation. The -G0 option turns off dvips default bad behaviour (which breaks ligatures in many fonts). This may produce PDFs which crash very, very old and buggy versions of acroread (like version 2 on the Mac) - should be nothing to worry about.

The next step is to distill, using the ps2pdf command . The -sPAPERSIZE option is necessary to prevent ps2pdf setting the wrong MediaBox? size (ps2pdf bad default behaviour). If you used the geometry package in LaTeX, this switch may be unnecessary (as the paper size can be encoded in the PostScript). The other options are for compatibility, and embedding all fonts (but only those parts needed). Note that is you stick to Times Roman, Helvetica, and Courier, none of this is necessary, as these fonts are standard and never embedded. However, this is essential for other fonts.

Now open your PDF in acrobat or acroread, and use Document Info - Fonts to check that all fonts are Type 1 (no Type 3 [bitmapped? fonts). Zoom in to 1600% and enjoy your beautiful fonts! Try it under Windows!

Printer warning

Some printers may not be able to handle the embedded fonts in the PDF-ready postscript (written by dvips -Ppdf), and we are warned not to distribute such files, but I think we may get even higher resolution out of our printer using the embedded fonts, or by printing from acroread.

Acroread bug

Under Linux, before printing from acroread, always select Page Setup - A4. acroread always forgets between sessions, and will display a notional paper size of A4, together with the wrong margins (those for US Letter). This is an acroread bug which will ruin your margins.

PDF Features

The hyperref package allows various PDF features to be employed. See the documentation in your LaTeX distribution for details.

  • Hyperlinks for table-of-contents items, cross-references, and citations. These are all generated automatically.
  • PDF bookmarks, which allow easy navigation, are generated for all table-of-contents items. It is also possible to add more bookmarks, and to adjust the way in which they are displayed.
  • PageLabels? allow pages to be numbered with their logical number (such as ii), not their sequence number (such as 2 for the second page of the preface). !PageLabel? support requires a newer hyperref package than that distributed with Red Hat 6.2 - I used hyperref 6.70y. Strictly, !PageLabels? are a PDF 1.3 feature, but as they are only an extra entry in the Catalog, they should not confuse older viewers.

Colour can be added with the color package. See grfguide.ps in your LaTeX distribution for more information.


Embedding Type1 fonts works only for (surprise) existing fonts. Type 1 Extended Computer Modern (ecmr) is not in the default TeTeX package (as of Debian Woody). If you want to use accented characters and Computer Modern, you might find the CM Super package handy. This was really the important step for me after reading the original of the two step-many option dvips/ps2pdf procedure.

For what it's worth, Debian sid has the "lmodern" package which appears to be a good substitute and Works For Me. I don't know why they don't include cm-super as it is apparently under GPL. The lmodern package can be installed on Woody if you also install backports of tetex-bin and tetex-base version 2, available at Backports.org.


Another possible Acrobat Reader bug:

When you view the font information with "Document Info - Fonts" or "File -> Document Properties -> Fonts", and select to list all fonts, it may not show all the fonts as being embedded in the document. It appears that it first needs to encounter the font in the document by you viewing the pages where those particular fonts are used, so you should quickly skim through all the pages and then all fonts will show up as embedded. Just another one of those things that might catch you out and make you think that the fonts aren't actually embedded when they are!

The following authors of this page have not agreed to the WlugWikiLicense. As such copyright to all content on this page is retained by the original authors. The following authors of this page have agreed to the WlugWikiLicense.

lib/plugin/WlugLicense.php:99: Warning: Invalid argument supplied for foreach()

lib/plugin/WlugLicense.php:111: Notice: Undefined variable: ignore_authors

lib/plugin/WlugLicense.php:111: Notice: Undefined variable: ignore_authors

lib/plugin/WlugLicense.php:111: Notice: Undefined variable: ignore_authors