KPSEWHICH(1)
π KPSEWHICH β ok so hear me out bestie
So this is a page from the General Commands Manual, bestie β it's kpsewhich, and it's genuinely lowkey iconic. Sit down, grab a boba, we're gonna get into it. π§β¨
Also, real talk before we start: the page itself says it isn't the whole story. The full documentation for this version of TeX lives in the info file / manual Kpathsea: A library for path searching. So like, this is the snack-size version, not the whole buffet. π
β¨ NAME β¨
kpsewhich β standalone path lookup and expansion for kpathsea. That's the whole vibe. π
π SYNOPSIS π
kpsewhich [options] [filenames]
Short, sweet, slays. π
π¦ DESCRIPTION π¦
Okay so first thing, bestie, and I need you to hear me: this manual page is not meant to be exhaustive. It's giving "highlight reel," not "director's cut." The complete documentation for this version of TeX is in the info file or the manual Kpathsea: A library for path searching β go there if you want the full lore. π
So what is kpsewhich? It's a standalone front-end of the kpathsea library, and it does two main character things: it examines variables and it finds files. Obsessed. π«Ά
Now here's the detail that matters, so don't skip it: when you don't pass the -format option, the search path it uses when looking for a file is inferred from the name you gave it, by looking for a known extension. And if there's no known extension in sight? Not a problem β it just falls back to using the search path for TeX source files. The way it just figures it out for you, no cap. π
π OPTIONS π
kpsewhich accepts the following options β buckle up, there's a whole lineup:
-debug numβ Sets the debugging flags, bestie.numsays how loud. π-D numβ Uses a base resolution ofnum. The default is set by the installer and is typically600. Iconic.-dpi numβ Literally the same thing as-D. Same energy, different spelling. β¨-engine stringβ Sets$enginein the environment, which gets used in some search paths. π§-expand-braces stringβ Prints the variable and brace expansion ofstring. Two-for-one. π-expand-path stringβ Prints the complete path expansion ofstring. π£οΈ-expand-var stringβ Prints the variable expansion ofstring. Just the variable one. π-format nameβ Uses file typename. For the list of valid names, check the info manual β or just hit-helpand it'll print the list for you. So helpful fr fr. π-helpβ Prints the help message and exits. Your "hey what's up" button. π-interactiveβ Asks for additional filenames to look up. It literally keeps the convo going. π¬-mktex fmtβ Enablesmktexfmtgeneration, wherefmt=pk/mf/tex/tfm. Turn it on. π₯-mode stringβ Sets the device name for$MAKETEX_MODEtostring. And no, there is no default β you gotta supply it yourself. π-must-existβ Searches the disk as well asls-Rif necessary. Thorough queen behavior. π-no-mktex fmtβ Disablesmktexfmtgeneration, wherefmt=pk/mf/tex/tfm. The opposite of-mktex. β-path stringβ Searches in the pathstring. Point it where you want it. π§-progname stringβ Sets the program name tostring. Main character rebrand. β-show-path nameβ Outputs the search path for file typename. Same deal as-format: valid names are in the info manual, or use-helpto print the list. πΈ-var-value variableβ Prints the expansion ofvariable. (The flag has-var-value, the argument is avariableβ careful, bestie, don't mix those up.) π-versionβ Prints version information and exits. Then it's out. π¦
Reminder for real: for both-formatand-show-path, the list of validnamevalues lives in the info manual, or you can run-helpto print it. Don't come for me, I'm just relaying the facts. π
π SEE ALSO π
Go be nosy about these too: mktexlsr(1), mktexmf(1), mktexpk(1), mktextfm(1). The whole friend group. π«Ά
And that's the page, bestie! π This version of the docs comes from Kpathsea 6.4.2, dated 1 March 2011 β yes, she's vintage, and she still eats. Periodt. πβ¨
π¦ where this page comes from
- alpine 3.24: texmf-dist-doc 2026.0-r0 Β· LPPL-1.0 AND LPPL-1.1 AND LPPL-1.2 AND LPPL-1.3a AND LPPL-1.3c AND GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms