Site Tools


kpsewhich

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
kpsewhich [May 17, 2026 at 15:30] Ivan Janevskikpsewhich [May 17, 2026 at 15:33] (current) Ivan Janevski
Line 1: Line 1:
 # kpsewhich # kpsewhich
-**kpsewhich** is a LaTeX command that's used to look up full path of a file that you know LaTeX compiler would implicitly use. In some way it is similar to the `which` command, which tells you where a command is located if you ran it in the shell (e.g. `which ls` shows `/usr/bin/ls`).+**kpsewhich** is a LaTeX-related command. It's a diagnostic command that's used to look up the full path of a file you know the LaTeX compiler would use implicitly. In some wayit is similar to the `which` command, which shows the full path of a command if you would run it in the shell (e.g. `which ls` shows `/usr/bin/ls`).
  
 For example, when you use `\documentclass{article}` in a TeX document, and you compile the document with `pdflatex`, the compiler is going to load the "document class: article" from `article.cls` file (Note: the `.cls` extension stands for "class") For example, when you use `\documentclass{article}` in a TeX document, and you compile the document with `pdflatex`, the compiler is going to load the "document class: article" from `article.cls` file (Note: the `.cls` extension stands for "class")
Line 12: Line 12:
 ``` ```
  
-Where `article.cls` located? You can find out with `kpsewhich` command.+Where `article.cls` located? You can find out with `kpsewhich` command!
 ``` ```
  $ kpsewhich article.cls  $ kpsewhich article.cls
Line 25: Line 25:
  $ kpsewhich  $ kpsewhich
 Missing argument. Try `kpsewhich --help' for more information. Missing argument. Try `kpsewhich --help' for more information.
 +```
 +
 +### Non-existent file
 +If you put something nonsensical it's just going to return nothing.
 +```
 + $ kpsewhich fdsafdsafdsa
 ``` ```
  
kpsewhich.1779031848.txt.gz · Last modified: by Ivan Janevski