How do I get LaTeX to run a command only if it exists? I need something like:
\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
% \newcommand{\mytitle}{Title Test}
\begin{document}
\if mytitle exists
\mytitle %true
\else
do not run the command
\fi
\end{document}
To prevent the error message appears: 'Undefined control sequence \mytitle' I need to decide this because I will use Boolean operation on multiple files.