20241011:
Latexmk searches for a variety of commands in .tex files to determine dependencies and compilation requirements. Here are some of the key commands and elements it looks for:
Input and Include Commands:
\input \include \InputIfFileExists
Bibliography Commands:
\bibliography \addbibresource (for biblatex)
Graphics and Figure Commands:
\includegraphics \graphicspath
Index Commands:
\makeindex \printindex
Glossary Commands:
\makeglossaries \printglossaries
Package and Class Loading:
\usepackage \documentclass
External File References:
\externaldocument (from the xr package)
Nomenclature:
\makenomenclature \printnomenclature
Table of Contents, List of Figures, List of Tables:
\tableofcontents \listoffigures \listoftables
Custom Defined Dependencies:
You can define custom dependencies in your latexmkrc file
SyncTeX:
Checks for synctex=1 in the compiler options
Output Directory:
Checks for an output directory specification
LaTeX Engine:
Looks for commands or packages that might require a specific LaTeX engine (e.g., XeLaTeX or LuaLaTeX)
Beamer-specific Commands:
When using the Beamer class for presentations
TikZ Externalization:
If TikZ externalization is used
Multibib Commands:
For documents using multiple bibliographies
This list is not exhaustive, and latexmk's behavior can be further customized through configuration files. The exact set of commands and features it looks for can also depend on the version of latexmk you're using, as newer versions often add support for additional LaTeX features and packages.