TEXPROF(1) | General Commands Manual | TEXPROF(1) |
NAME
texprof - A profiler for TeX source files
SYNOPSIS
texprof [options] [&format] [file|\commands]
DESCRIPTION
Run the TeX profiler on file, usually creating file.dvi and file.tprof. If the file argument has no extension, ".tex" will be appended to it. Instead of a file name, a list of TeX commands can be given, the first of which must start with a backslash. With a &format argument, the TeX profiler uses a different set of precompiled commands, contained in format.fmt; it is usually better to use the -fmt format option instead.
The TeX profiler is a version of TeX that measures the time TeX needs to execute individual input lines or macros. It writes the collected data to a file with extension .tprof. A separate program, texprofile (see texprofile(1)), is used to display the content of a .tprof file in a readable form.
The typical use of the TeX profiler is with pre generated formats. The texprof command uses the equivalent of the plain TeX format, and the latexprof command uses the equivalent of the LaTeX format. To investigate the timing of macros targeted to pdftex or pdflatex, you can use pdftexprof or pdflatexprof.
The TeX profiler's handling of its command-line arguments is similar to that of the other TeX programs in the web2c implementation.
OPTIONS
This version of the TeX profiler understands the following command line options.
- -cnf-line string
- Parse string as a texmf.cnf configuration line. See the Kpathsea manual.
- -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.
- -fmt format
- Use format as the name of the format to be used, instead of the name by which the TeX profiler was called or a %& line.
- -help
- Print help message and exit.
- -ini
- Start in INI mode, which is used to dump formats. The INI mode can be used for typesetting, but no format is preloaded, and basic initializations like setting catcodes may be required.
- -interaction mode
- Sets the interaction mode. The mode can be either batchmode, nonstopmode, scrollmode, and errorstopmode. The meaning of these modes is the same as that of the corresponding \commands.
- -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.
- -ltx
- Enable the LaTeX extensions. This option is only effective in combination with -ini. See latex(1).
- -mktex fmt
- Enable mktexfmt, where fmt must be either tex, tfm, fmt, or pk.
- -no-mktex fmt
- Disable mktexfmt, where fmt must be either tex, tfm, fmt, or pk.
- -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.
- -parse-first-line
- If the first line of the main input file begins with %& parse it to look for a dump name.
- -no-parse-first-line
- Disable parsing of the first line of the main input file.
- Enable the simulation of common pdftex primitives. This option requires the -ini option and implies the -ltx option. See pdftex(1).
- -prof
- Enable profiling as soon as TeX enters the main loop. If tis option it not used, profiling needs to switched on using the \profileon primitive. Profiling can be switched of with the \profileoff primitive.
- -progname name
- Pretend to be program name. This affects both the format used and the search paths.
- -version
- Print version information and exit.
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.
- TEXMFOUTPUT
- Normally, TeX 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 texprof paper and the current directory is not writable and TEXMFOUTPUT has the value /tmp, TeX attempts to create /tmp/paper.log , /tmp/paper.dvi , and /tmp/paper.tprof . 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.
- 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 creation date and as the reference moment for the time related primitives of LaTeX. 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.
Many, many more environment variables may be consulted related to path searching. See the Kpathsea manual.
FILES
The location of the files mentioned below varies from system to system. Use the kpsewhich utility to find their locations.
- *.tfm
- Metric files for TeX's fonts.
- *.fmt
- Predigested TeX format files.
- *.pk *.pfb
- Font files used by TeX.
NOTES
This manual page is not meant to be exhaustive. The complete documentation for the TeX profiler can be found in texprof.pdf. Further information can be found in the manual of the Kpathsea library.
BUGS
This version of the TeX profiler does not implement all of the primitives that pdftex provides, and further, it will not produce the same side effects.
AVAILABILITY
The TeX profiler should compile on a large variety of machine architectures and operating systems. The function to obtain timing information id POSIX specific.
The sources of the TeX profiler are hosted at https://github.com/ruckertm/HINT
SEE ALSO
texprofiler(1), tex(1), latex(1), pdftex(1), pdflatex(1),and kpsewhich(1).
AUTHORS
The primary author of the TeX profiler is Martin Ruckert, with eTeX extensions by Peter Breitenlohner, LaTeX extensions by Thierry Laronde, and the kpathsearch library by Karl Berry.
TeX was designed by Donald E. Knuth, who implemented it using his Web system for Pascal programs.
Many, many more contributed to the typesetting system now known as TeX; far too many to name all of them here.
2 September 2024 | Version 1.0 |