KPSEWHICH(1)

πŸ“¦ version 2026.0, in alpine 3.24

πŸ’… 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. num says how loud. πŸ”
  • -D num β€” Uses a base resolution of num. The default is set by the installer and is typically 600. Iconic.
  • -dpi num β€” Literally the same thing as -D. Same energy, different spelling. ✨
  • -engine string β€” Sets $engine in the environment, which gets used in some search paths. 🧚
  • -expand-braces string β€” Prints the variable and brace expansion of string. Two-for-one. πŸ’–
  • -expand-path string β€” Prints the complete path expansion of string. πŸ›£οΈ
  • -expand-var string β€” Prints the variable expansion of string. Just the variable one. πŸ’œ
  • -format name β€” Uses file type name. For the list of valid names, check the info manual β€” or just hit -help and 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 β€” Enables mktexfmt generation, where fmt=pk/mf/tex/tfm. Turn it on. πŸ”₯
  • -mode string β€” Sets the device name for $MAKETEX_MODE to string. And no, there is no default β€” you gotta supply it yourself. πŸ™ˆ
  • -must-exist β€” Searches the disk as well as ls-R if necessary. Thorough queen behavior. πŸ‘‘
  • -no-mktex fmt β€” Disables mktexfmt generation, where fmt=pk/mf/tex/tfm. The opposite of -mktex. β›”
  • -path string β€” Searches in the path string. Point it where you want it. 🧭
  • -progname string β€” Sets the program name to string. Main character rebrand. ⭐
  • -show-path name β€” Outputs the search path for file type name. Same deal as -format: valid names are in the info manual, or use -help to print the list. 🌸
  • -var-value variable β€” Prints the expansion of variable. (The flag has -var-value, the argument is a variable β€” careful, bestie, don't mix those up.) πŸ’…
  • -version β€” Prints version information and exits. Then it's out. πŸ¦‹
Reminder for real: for both -format and -show-path, the list of valid name values lives in the info manual, or you can run -help to 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