PDFTEX(1)

๐Ÿ’– PDFTEX(1) โ€” the pdftex manual, but make it make sense ๐Ÿ’–

General Commands Manual ยท pdftex ยท PDF output from TeX

okay bestie sit DOWN because we're learning pdfTeX today and honestly? it's iconic. it's the TeX engine that can spit out PDF files and DVI files, it's been carrying academia on its back for decades, and you're about to understand it fr fr. let's go ๐Ÿฆ‹


โœจ NAME โœจ

pdftex โ€” PDF output from TeX. that's the whole vibe. it takes your TeX and it gives you PDF. ๐Ÿ’…


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

pdftex [options] [&format] [file|\commands]

๐ŸŒธ DESCRIPTION ๐ŸŒธ

So you run the pdfTeX typesetter on file, and it usually creates file.pdf. if your file argument has no extension, .tex gets appended to it โ€” automatic, no notes, slay.

Instead of a filename, you can hand it a whole set of pdfTeX commands, but the first one has to start with a backslash. and if you pass a &format argument, pdfTeX uses a different set of precompiled commands living inside format.fmt โ€” though honestly it's usually better to use the -fmt format option instead. lowkey the move. ๐Ÿ™ˆ

pdfTeX is a version of TeX, with the e-TeX extensions, that can create PDF files as well as DVI files. periodt.

In DVI mode, pdfTeX can be used as a complete replacement for the TeX engine. no cap.

The typical use of pdfTeX is with pregenerated formats that have PDF output enabled. the pdftex command uses the equivalent of the plain TeX format, and the pdflatex command uses the equivalent of the LaTeX format. to generate formats, use the -ini switch โ€” that's your format-dumping era. โœจ

The pdfinitex and pdfvirtex commands are pdfTeX's analogues to the initex and virtex commands. in this installation, if the links exist, they're symbolic links to the pdftex executable. ๐Ÿซถ

In PDF mode, pdfTeX can natively handle the PDF, JPG, JBIG2, and PNG graphics formats. ๐Ÿ’–

โš ๏ธ but here's the thing bestie: pdfTeX cannot include PostScript or Encapsulated PostScript (EPS) graphics files. first convert them to PDF using epstopdf(1). that's the rule, no exceptions.

pdfTeX's handling of its command-line arguments is similar to that of the other TeX programs in the web2c implementation.

Starting with version 1.40, pdfTeX incorporates the e-TeX extensions, and pdfeTeX is just a copy of pdfTeX. see etex(1).


๐Ÿ’… OPTIONS ๐Ÿ’…

This version of pdfTeX understands the following command line options. and yes, we're doing ALL of them, every single one, because we don't skip. ๐ŸŽ€

  • -cnf-line string โ€” parse string as a texmf.cnf configuration line. see the Kpathsea manual for the deets.
  • -draftmode โ€” sets \pdfdraftmode, so pdfTeX doesn't write a PDF and doesn't read any included images, which speeds up execution. speedrun mode fr.
  • -enc โ€” enable the encTeX extensions. โš ๏ธ this option is only effective in combination with -ini. for documentation of the encTeX extensions see http://www.olsak.net/enctex.html.
  • -etex โ€” enable the e-TeX extensions. this option is only effective in combination with -ini. see etex(1).
  • -file-line-error โ€” print error messages in the form file:line:error, which is similar to the way many compilers format them.
  • -no-file-line-error โ€” disable printing error messages in the file:line:error style.
  • -file-line-error-style โ€” this is the old name of the -file-line-error option. vintage ๐Ÿ’€
  • -fmt format โ€” use format as the name of the format to be used, instead of the name by which pdfTeX was called or a %& line.
  • -halt-on-error โ€” exit with an error code when an error is encountered during processing. it simply refuses to continue, and honestly? valid.
  • -help โ€” print help message and exit.
  • -ini โ€” start in INI mode, which is used to dump formats. INI mode can be used for typesetting, but no format is preloaded, and basic initializations like setting catcodes may be required. raw. unfiltered. main character energy.
  • -interaction mode โ€” sets the interaction mode. mode can be either batchmode, nonstopmode, scrollmode, and errorstopmode. the meaning of these modes is the same as that of the corresponding \commands.
  • -ipc โ€” send DVI or PDF output to a socket as well as the usual output file. whether this option is available is the choice of the installer. ๐Ÿ™ˆ
  • -ipc-start โ€” as -ipc, and starts the server at the other end as well. whether this option is available is the choice of the installer.
  • -jobname name โ€” use name for the job name, instead of deriving it from the name of the input file.
  • -kpathsea-debug bitmask โ€” sets path searching debugging flags according to the bitmask. see the Kpathsea manual for details.
  • -mktex fmt โ€” enable mktexfmt, where fmt must be either tex or tfm.
  • -mltex โ€” enable MLTeX extensions. only effective in combination with -ini.
  • -no-mktex fmt โ€” disable mktexfmt, where fmt must be either tex or tfm.
  • -output-comment string โ€” in DVI mode, use string for the DVI file comment instead of the date. โš ๏ธ this option is ignored in PDF mode.
  • -output-directory directory โ€” write output files in directory instead of the current directory. look up input files in directory first, then along the normal search path.
  • -output-format format โ€” set the output format mode, where format must be either pdf or dvi. this also influences the set of graphics formats understood by pdfTeX. ๐Ÿ‘‘
  • -parse-first-line โ€” if the first line of the main input file begins with %& parse it to look for a dump name or a -translate-file option.
  • -no-parse-first-line โ€” disable parsing of the first line of the main input file.
  • -progname name โ€” pretend to be program name. this affects both the format used and the search paths. cosplay but make it compilers ๐Ÿ’…
  • -recorder โ€” enable the filename recorder. this leaves a trace of the files opened for input and output in a file with extension .fls.
  • -shell-escape โ€” enable the \write18{command} construct. the command can be any shell command. โš ๏ธ this construct is normally disallowed for security reasons. not me enabling arbitrary shell execution ๐Ÿ˜ญ be careful bestie.
  • -no-shell-escape โ€” disable the \write18{command} construct, even if it is enabled in the texmf.cnf file.
  • -shell-restricted โ€” enable restricted \write18{}, as explained in the ``Shell escapes'' section of the Web2c Texinfo manual.
  • -src-specials โ€” in DVI mode, insert source specials into the DVI file. โš ๏ธ this option is ignored in PDF mode.
  • -src-specials where โ€” in DVI mode, insert source specials in certain places of the DVI file. the where argument is a comma-separated value list: cr, display, hbox, math, par, parent, or vbox. this option is ignored in PDF mode.
  • -synctex NUMBER โ€” generate SyncTeX data for previewers according to bits of NUMBER. see the synctex manual page for details.
  • -translate-file tcxname โ€” use the tcxname translation table to set the mapping of input characters and re-mapping of output characters.
  • -default-translate-file tcxname โ€” like -translate-file except that a %& line can overrule this setting.
  • -version โ€” print version information and exit.
  • -8bit โ€” make all characters printable by default.

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

see the Kpathsea library documentation (e.g., the ``Path specifications'' node) for precise details of how the environment variables are used. the kpsewhich utility can be used to query the values of the variables โ€” very handy, love that for us. ๐Ÿ’œ

โš ๏ธ one caveat: in most pdfTeX formats, you cannot use ~ in a filename you give directly to pdfTeX, because ~ is an active character in TeX, and hence is expanded, not taken as part of the filename. other programs, such as Metafont, do not have this problem. so no ~/myfile.tex shenanigans here bestie, it will not work ๐Ÿ˜ญ
  • TEXMFOUTPUT โ€” normally, pdfTeX puts its output files in the current directory. if any output file cannot be opened there, it tries to open it in the directory specified in the environment variable TEXMFOUTPUT. there is no default value for that variable. for example, if you say pdftex paper and the current directory is not writable and TEXMFOUTPUT has the value /tmp, pdfTeX attempts to create /tmp/paper.log (and /tmp/paper.pdf, if any output is produced.) TEXMFOUTPUT is also checked for input files, as TeX often generates files that need to be subsequently read; for input, no suffixes (such as ``.tex'') are added by default, the input name is simply checked as given.
  • TEXINPUTS โ€” search path for \input and \openin files. this normally starts with .'', so that user files are found before system files. an empty path component will be replaced with the paths defined in the `texmf.cnf` file. for example, set `TEXINPUTS` to `".:/home/user/tex:"` to prepend the current directory and /home/user/tex'' to the standard search path.
  • TEXFORMATS โ€” search path for format files.
  • TEXEDIT โ€” command template for switching to editor. the default, usually vi, is set when pdfTeX is compiled.
  • TFMFONTS โ€” search path for font metric (.tfm) files.
  • SOURCE_DATE_EPOCH โ€” if set, its value, taken to be in epoch-seconds, will be used for the timestamps in the PDF output, such as the CreationDate and ModDate keys. this is useful for making reproducible builds. ๐ŸŽ€
  • FORCE_SOURCE_DATE โ€” if set to the value "1", the time-related TeX primitives (\year, \month, \day, \time) are also initialized from the value of SOURCE_DATE_EPOCH. โš ๏ธ this is not recommended if there is any viable alternative. pdfTeX also has several primitives to support reproducible builds, which are preferable to setting these environment variables; see the main manual.

Many, many more environment variables may be consulted related to path searching. see the Kpathsea manual. (yes, many many. it's a whole ecosystem.) ๐Ÿฆ‹


๐ŸŽ€ FILES ๐ŸŽ€

The location of the files mentioned below varies from system to system. use the kpsewhich utility to find their locations.

  • pdftex.map โ€” font name mapping definitions.
  • *.tfm โ€” metric files for pdfTeX's fonts.
  • *.fmt โ€” predigested pdfTeX format (.fmt) files.

๐Ÿ’ญ NOTES ๐Ÿ’ญ

(this section is just vibes. nothing here. moving on.) ๐Ÿ™ˆ


๐Ÿ’€ BUGS ๐Ÿ’€

This version of pdfTeX fails to trap arithmetic overflow when dimensions are added or subtracted. cases where this occurs are rare, but when it does the generated DVI or PDF file will be invalid. so like... rare but catastrophic. noted. ๐Ÿ˜ญ


๐Ÿ‘‘ AVAILABILITY ๐Ÿ‘‘

pdfTeX is available for a large variety of machine architectures and operating systems. pdfTeX is part of all major TeX distributions. it's everywhere. it's the moment.


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

This manual page is not meant to be exhaustive. the complete documentation for this version of pdfTeX can be found in the pdfTeX user manual and the Texinfo manuals Kpathsea library, Web2C: A TeX implementation. these manuals, and more, can be accessed from the pdfTeX or CTAN web pages given above.

Some related programs: epstopdf(1), etex(1), latex(1), luatex(1), mptopdf(1), tex(1), mf(1).

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

okay bestie, gather round, it's credits time and we're giving every single icon their flowers ๐Ÿ’

pdfTeX was brought into this world by its primary author, Han The Thanh โ€” main character energy, no notes ๐Ÿ’…. And he did not do it alone, because collaboration is the vibe: Petr Sojka, Jiri Zlatuska, and Peter Breitenlohner (that's the eTeX one, iykyk) all showed up with major contributions ๐Ÿซถ.


Now let's go back, way back, because the lore is immaculate โœจ

TeX was designed by Donald E. Knuth, and he implemented it using his Web system for Pascal programs. Like. He built the whole thing. Obsessed honestly ๐Ÿ˜ญ.

Then it went on tour ๐ŸŒˆ:

  • It got ported to Unix at Stanford by Howard Trickey.
  • And at Cornell by Pavel Curtis.

The version that's now offered with the Unix TeX distribution is the one generated by the Web to C system (web2c), which was originally written by Tomas Rokicki and Tim Morgan ๐Ÿ”ฅ.

And last but absolutely not least: the encTeX extensions? Those were written by Petr Olsak ๐ŸŽ€.

ngl, that's a whole lineage of legends and we are literally standing on their shoulders fr fr ๐Ÿ’œ

<div style="text-align:center">๐Ÿ’– โœจ ๐Ÿฆ‹ ๐ŸŒธ ๐Ÿ’… ๐Ÿซถ ๐Ÿ‘‘ ๐ŸŒˆ โญ ๐Ÿ’€ ๐Ÿ“ ๐Ÿงš ๐Ÿ’œ</div>

And that's a wrap on this page, bestie!! This one's from Web2C 2025, dated 2 March 2024, and it lives at PDFTEX(1) ๐ŸŽ€ โ€” go forth and typeset something iconic, you absolute queen ๐Ÿ‘‘โœจ

๐Ÿ“ฆ where this page comes from