Penguin
Blame: PdfLatexNotes
EditPageHistoryDiffInfoLikePages
Annotated edit history of PdfLatexNotes version 10, including all changes. View license author blame.
Rev Author # Line
4 IanShields 1 These are some hints to make your use of pdflatex(1) more productive...
8 JohnMcPherson 2
4 IanShields 3
4 !!! Version
5 As you may be aware, the version numbers for [Τεχ] are converging towards Pi, and pdflatex does the same.
6 Although it may not look like much, there is quite a bit of difference between pdflatex version "3.14159-13d (Web2C 7.3.1)" (the "old stable" version) and version "Version 3.14159-1.10b (Web2C 7.4.5)" (the more recent version). This fixes a number of bugs. I copied a binary of the newer version from [Debian] [Woody] onto a [Slackware] 8 box, and the binary worked, but I needed to use the newer pdflatex.fmt file as well (you can merely copy this into your document directory).
9 MaartenSneep 7
8 At this moment (Fall 2006), 1.10b is considered "antique", pdfeTeX 3.141592-1.30.4-2.2 (Web2C 7.5.5) is recent, but the pdfΤεχ extensions are up to 1.40 already (though I don't think there is a distribution that includes it at this moment. The version numbers break down to: [Τεχ] version (3.141592) - pdfΤεχ extension (1.30.4) - ε-Τεχ extensions (2.2) and Web2C translator release (7.5.5). If you use the [Τεχ] system installed with your linux distribution, you should probably update it, for example with http://www.tug.org/texlive
4 IanShields 9
10 !!! Using the ''graphicx'' Package
11
9 MaartenSneep 12 ''graphicx'' can take an option specifying __pdftex__ or __dvips__, depending on which you are planning on using. You can use a conditional macro to include the right option depending on which processor is being used. Current (La)TeX installations are capable of detecting whether __pdftex__ or __dvips__ is used, and you are better off loading the ''graphicx'' package without options. If you <em>must</em> detect the flavour of the engine, use the ''ifpdf'' package, the old way doesn't work correctly, because pdflatex is used to produce dvi, causing the conditional to be false even for dvips-latex.
13
4 IanShields 14 Put this in the header of the main .tex file:
15
16 <verbatim>
9 MaartenSneep 17 \usepackage{ifpdf}
18 \ifpdf
4 IanShields 19 \usepackage[dvips]{graphicx}
20 \else
21 \usepackage[pdftex]{graphicx}
22 \pdfcompresslevel=9
23 \fi
9 MaartenSneep 24 </verbatim>
25
26 but you're probably better off using:
27
28 <verbatim>
29 \usepackage{graphicx}
4 IanShields 30 </verbatim>
31
32 pdflatex can import images in PNG, TIF, PDF, GIF, or JPG image formats, but not PS.
33 Now, by default, normal latex uses .ps or .eps for including images. However, you can get your images to work with both latex and pdflatex with little modification to your .tex source files.
34
35 1. (This assumes you already have .ps or .eps figures for use with latex). Use the ps2pdf(1) command (which is part of the gs-common package in [Debian]) to convert each .ps or .eps image into a .pdf image:
36 $ for f in *.{ps,eps} ; do ps2pdf $f ${f%.*}.pdf ; done
5 JohnMcPherson 37 There is also an epstopdf(1) command that is part of latex (debian tetex-bin package) that might be better to use on .eps figures.
4 IanShields 38
39 Now, if you do
40 <verbatim>
41 \includegraphics[width=\textwidth]{figure}
42 </verbatim>
43 then latex will look for "figure.ps" or "figure.eps", and pdflatex will look for "figure.pdf", "figure.gif", or "figure.jpg". If you have one of each list then both latex and pdflatex will work with the same input file.
44
9 MaartenSneep 45 There is an epstopdf package, which will use shell callouts to translate eps to pdf on the fly, see below.
4 IanShields 46
47 !!! Using pdflatex to make slides
48 You can make slides by using the ''seminar'' package:
49 <verbatim>
50 \documentclass[a4, landscape]{seminar}
51 </verbatim>
9 MaartenSneep 52 However, pdftex and seminar don't play nicely together (your text appears in only a quarter of the page), so there is a little trick you can do to force the correct page dimensions. In the header of your file, try the following (this example is in combination with the above hints). Apparently loading the color package is sufficient, as is using the geometry package.
4 IanShields 53
54 <verbatim>
9 MaartenSneep 55 \usepackage{ifpdf}
56 \usepackage{graphicx}
57 \ifpdf\else
4 IanShields 58 %%%%%%%%
59 % to fix problems making landscape seminar pdfs
60 % Letter...
61 %\pdfpagewidth=11truein
62 %\pdfpageheight=8.5truein
63 % A4
64 \pdfpagewidth=297truemm % your milage may vary....
65 \pdfpageheight=210truemm
66 \pdfhorigin=1truein % default value(?), but doesn't work without
67 \pdfvorigin=1truein % default value(?), but doesn't work without
68 \fi
69 </verbatim>
7 JohnMcPherson 70
71 !!! The 'hyperref' package
72 If you use the hyperref package, then your pdf file will have have active links for all labels and citations, which you can use for quickly navigating. This is incredibly useful - eg for browsing your bibliography and seeing where a reference was cited. In addition, bookmarks will be generated. See the section below on using hyperref with pdflatex.
4 IanShields 73
74 !!! [PDF] metadata
75 Inside a block that is only read for pdflatex (and not normal latex), you can put a block to set the metadata inside the PDF file:
76
77 <verbatim>
78 \pdfinfo
79 { /Title (My Masterpiece)
10 JustPassing 80 /Author (YourName)
4 IanShields 81 /CreationDate (D:YYYYMMDDhhmmss) % this is the format used by pdf for date/time
82 /Subject (...)
83 /Keywords (...)
84 }
6 ChrisPoulton 85 </verbatim>
86
87 However, if you are using the hyperref package (which uses your Table of Contents to create bookmarks and a
88 contents pane in your PDF - very pretty) you will find your pdfinfo block is ignored.
7 JohnMcPherson 89 The solution:
6 ChrisPoulton 90
91 <verbatim>
92 \usepackage[pdftex,
93 pdfauthor={Your Name},
94 pdftitle={The Title},
95 pdfsubject={The Subject},
96 pdfkeywords={Some Keywords},
97 pdfproducer={Latex with hyperref, or other system},
98 pdfcreator={pdflatex, or other tool}]{hyperref}
4 IanShields 99 </verbatim>
100
101 !!! epstopdf package and command
102
103 There is an epstopdf command to convert eps images to pdf for use with pdflatex. Threre is also an epstopdf package which will automate this for you.
104
105 <verbatim>
106 \usepackage{graphicx}
107 \usepackage{epstopdf}
108 </verbatim>
109
110 See http://www.tug.org/pipermail/latex2html/2001-March/001062.html

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()