summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-ifpdf.html
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-22 23:51:44 +0000
committerKarl Berry <karl@freefriends.org>2009-05-22 23:51:44 +0000
commit566f5207d7e3cafb0633d31277067336ccd9cca7 (patch)
tree7af53e7ac405185168bc1dc38c4e820f442b78d0 /Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-ifpdf.html
parentb0beea26ffffd915bb6d9b82f2d65a0a05b7e23b (diff)
move generic english documents out of texmf-doc
git-svn-id: svn://tug.org/texlive/trunk@13396 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-ifpdf.html')
-rw-r--r--Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-ifpdf.html80
1 files changed, 80 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-ifpdf.html b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-ifpdf.html
new file mode 100644
index 00000000000..7f26397e5c5
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-ifpdf.html
@@ -0,0 +1,80 @@
+<head>
+<title>UK TeX FAQ -- question label ifpdf</title>
+</head><body>
+<h3>Am I using PDFTeX?</h3>
+<p/>It&rsquo;s often useful to know whether your macros are operating within
+PDFTeX or within (&ldquo;normal&rdquo;) TeX; getting the right answer is
+surprisingly tricky.
+<p/>Suppose you need to test whether your output will be PDF or
+DVI. The natural thing is to check whether you have access to
+some PDFTeX-only primitive; a good one to try (not least because it
+was present in the very first releases of PDFTeX) is
+<code>\</code><code>pdfoutput</code>. So you try
+<blockquote>
+<pre>
+\ifx\pdfoutput\undefined
+ &lt;not running PDFTeX&gt;
+\else
+ &lt;running PDFTeX&gt;
+\fi
+</pre>
+</blockquote><p>
+Except that neither branch of this conditional is rock-solid. The
+first branch can be misleading, since the &ldquo;awkward&rdquo; user could have
+written:
+<blockquote>
+<pre>
+\let\pdfoutput\undefined
+</pre>
+</blockquote><p>
+so that your test will falsely choose the first alternative. While
+this is a theoretical problem, it is unlikely to be a major one.
+<p/>More important is the user who loads a package that uses
+LaTeX-style testing for the command name&rsquo;s existence (for example,
+the LaTeX <i>graphics</i> package, which is useful even to the
+Plain TeX user). Such a package may have gone ahead of you, so the
+test may need to be elaborated:
+<blockquote>
+<pre>
+\ifx\pdfoutput\undefined
+ &lt;not running PDFTeX&gt;
+\else
+ \ifx\pdfoutput\relax
+ &lt;not running PDFTeX&gt;
+ \else
+ &lt;running PDFTeX&gt;
+ \fi
+\fi
+</pre>
+</blockquote><p>
+If you only want to know whether some PDFTeX extension (such as
+marginal kerning) is present, you can stop at this point: you know as
+much as you need.
+<p/>However, if you need to know whether you&rsquo;re creating PDF
+output, you also need to know about the value of <code>\</code><code>pdfoutput</code>:
+<blockquote>
+<pre>
+\ifx\pdfoutput\undefined
+ &lt;not running PDFTeX&gt;
+\else
+ \ifx\pdfoutput\relax
+ &lt;not running PDFTeX&gt;
+ \else
+ &lt;running PDFTeX, with...&gt;
+ \ifnum\pdfoutput&gt;0
+ &lt;...PDF output&gt;
+ \else
+ &lt;...DVI output&gt;
+ \fi
+ \fi
+\fi
+</pre>
+</blockquote><p>
+The above is, in essence, what Heiko Oberdiek&rsquo;s <i>ifpdf</i>
+package does; the reasoning is the FAQ&rsquo;s interpretation of
+Heiko&rsquo;s explanation.
+<dl>
+<dt><tt><i>ifpdf.sty</i></tt><dd>Distributed with Heiko Oberdiek&rsquo;s packages <a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/oberdiek.zip">macros/latex/contrib/oberdiek</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/contrib/oberdiek.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/contrib/oberdiek/">browse</a>)
+</dl>
+<p/><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ifpdf">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=ifpdf</a>
+</body>