FindLATEX: Update documentation

- Added find module docs sections as in other similar find modules.
- Added examples section.
- Added CMake versions that introduced support for components and
  htlatex, pdftops, Biber, xindy, XeLaTeX, LuaLaTeX separately.
This commit is contained in:
Peter Kokot
2025-04-06 21:00:17 +02:00
parent 8d034572fd
commit 2f54621c62

View File

@@ -5,58 +5,162 @@
FindLATEX
---------
Find LaTeX
Finds LaTeX compiler and Latex-related software like BibTeX. LaTeX is a
typesetting system for the production of technical and scientific documentation.
This module finds an installed LaTeX and determines the location
of the compiler. Additionally the module looks for Latex-related
software like BibTeX.
Components
^^^^^^^^^^
.. versionadded:: 3.2
Component processing; support for htlatex, pdftops, Biber, xindy, XeLaTeX,
LuaLaTeX.
This module sets the following result variables::
Components can be optionally specified using a standard CMake syntax:
LATEX_FOUND: whether found Latex and requested components
LATEX_<component>_FOUND: whether found <component>
LATEX_COMPILER: path to the LaTeX compiler
PDFLATEX_COMPILER: path to the PdfLaTeX compiler
XELATEX_COMPILER: path to the XeLaTeX compiler
LUALATEX_COMPILER: path to the LuaLaTeX compiler
BIBTEX_COMPILER: path to the BibTeX compiler
BIBER_COMPILER: path to the Biber compiler
MAKEINDEX_COMPILER: path to the MakeIndex compiler
XINDY_COMPILER: path to the xindy compiler
DVIPS_CONVERTER: path to the DVIPS converter
DVIPDF_CONVERTER: path to the DVIPDF converter
PS2PDF_CONVERTER: path to the PS2PDF converter
PDFTOPS_CONVERTER: path to the pdftops converter
LATEX2HTML_CONVERTER: path to the LaTeX2Html converter
HTLATEX_COMPILER: path to the htlatex compiler
.. code-block:: cmake
Possible components are::
find_package(LATEX [COMPONENTS <component>...])
PDFLATEX
XELATEX
LUALATEX
BIBTEX
BIBER
MAKEINDEX
XINDY
DVIPS
DVIPDF
PS2PDF
PDFTOPS
LATEX2HTML
HTLATEX
Supported components are:
Example Usages:
``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``
Find the xindy compiler.
``DVIPS``
Finds the DVI-to-PostScript (DVIPS) converter.
``DVIPDF``
Finds the DVIPDF converter.
``PS2PDF``
Finds the 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
are found.
``LATEX_<component>_FOUND``
Boolean indicating whether the LaTeX ``<component>`` is 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``
.. versionadded: 3.2
The path to the XeLaTeX compiler.
``LUALATEX_COMPILER``
.. versionadded: 3.2
The path to the LuaLaTeX compiler.
``BIBTEX_COMPILER``
The path to the BibTeX compiler.
``BIBER_COMPILER``
.. versionadded: 3.2
The path to the Biber compiler.
``MAKEINDEX_COMPILER``
The path to the MakeIndex compiler.
``XINDY_COMPILER``
.. versionadded: 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``
.. versionadded: 3.2
The path to the pdftops converter.
``LATEX2HTML_CONVERTER``
The path to the LaTeX2Html converter.
``HTLATEX_COMPILER``
.. versionadded: 3.2
The path to the htlatex compiler.
Examples
^^^^^^^^
Finding LaTeX in a project:
.. code-block:: cmake
find_package(LATEX)
Finding LaTeX compiler and specifying which additional LaTeX components are
required for LaTeX to be considered found:
.. code-block:: cmake
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:
.. code-block:: cmake
find_package(LATEX COMPONENTS BIBTEX PS2PDF)
if(LATEXT_FOUND)
# ...
endif()
#]=======================================================================]
if (WIN32)