FindLATEX
Finds LaTeX compiler and Latex-related software like BibTeX:
find_package(LATEX [...])
LaTeX is a typesetting system for the production of technical and scientific documentation.
Components
Added in version 3.2.
Components can be optionally specified using a standard CMake syntax:
find_package(LATEX [COMPONENTS <component>...])
Supported components are:
-
PDFLATEX -
Finds the PdfLaTeX compiler.
-
XELATEX -
Finds the XeLaTeX compiler.
-
LUALATEX -
Finds the LuaLaTeX compiler.
-
BIBTEX -
Finds the BibTeX compiler.
-
BIBER -
Finds the Biber compiler.
-
MAKEINDEX -
Finds the MakeIndex compiler.
-
XINDY -
Finds the xindy compiler.
-
DVIPS -
Finds the DVI-to-PostScript (DVIPS) converter.
-
DVIPDF -
Finds the DVIPDF converter.
-
PS2PDF -
Finds the PS2PDF converter.
-
PDFTOPS -
Finds the PDF-to-PostScript converter.
-
LATEX2HTML -
Finds the converter for converting LaTeX documents to HTML.
-
HTLATEX -
Finds htlatex compiler.
Result Variables
This module defines the following variables:
-
LATEX_FOUND -
Boolean indicating whether the LaTex compiler and all its required components were found.
-
LATEX_<component>_FOUND -
Boolean indicating whether the LaTeX
<component>was found.
Cache Variables
The following cache variables may also be set:
-
LATEX_COMPILER -
The path to the LaTeX compiler.
-
PDFLATEX_COMPILER -
The path to the PdfLaTeX compiler.
-
XELATEX_COMPILER -
Added in version 3.2.
The path to the XeLaTeX compiler.
-
LUALATEX_COMPILER -
Added in version 3.2.
The path to the LuaLaTeX compiler.
-
BIBTEX_COMPILER -
The path to the BibTeX compiler.
-
BIBER_COMPILER -
Added in version 3.2.
The path to the Biber compiler.
-
MAKEINDEX_COMPILER -
The path to the MakeIndex compiler.
-
XINDY_COMPILER -
Added in version 3.2.
The path to the xindy compiler.
-
DVIPS_CONVERTER -
The path to the DVIPS converter.
-
DVIPDF_CONVERTER -
The path to the DVIPDF converter.
-
PS2PDF_CONVERTER -
The path to the PS2PDF converter.
-
PDFTOPS_CONVERTER -
Added in version 3.2.
The path to the pdftops converter.
-
LATEX2HTML_CONVERTER -
The path to the LaTeX2Html converter.
-
HTLATEX_COMPILER -
Added in version 3.2.
The path to the htlatex compiler.
Examples
Finding LaTeX in a project:
find_package(LATEX)
Finding LaTeX compiler and specifying which additional LaTeX components are required for LaTeX to be considered found:
find_package(LATEX COMPONENTS PDFLATEX)
if(LATEX_FOUND)
execute_process(COMMAND ${LATEX_COMPILER} ...)
execute_process(COMMAND ${PDFLATEX_COMPILER} ...)
endif()
Or finding LaTeX compiler and specifying multiple components:
find_package(LATEX COMPONENTS BIBTEX PS2PDF) if(LATEXT_FOUND) # ... endif()
© 2000–2026 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/latest/module/FindLATEX.html