I use this code to batch modify the title color of a large number of latex files
\renewcommand{\title}[1]{\renewcommand{\@title}{\color{\@titlecolor}#1}}
\newcommand{\@titlecolor}{black}
\newcommand{\titlecolor}[1]{\renewcommand{\@titlecolor}{#1}}
\makeatother
But I found that the program will get wrong results when the title has optional parameters.
\documentclass[reqno]{amsart}
\usepackage{xcolor}
\makeatletter
\renewcommand{\title}[1]{\renewcommand{\@title}{\color{\@titlecolor}#1}}
\newcommand{\@titlecolor}{black}
\newcommand{\titlecolor}[1]{\renewcommand{\@titlecolor}{#1}}
\makeatother
\begin{document}
\title[Boundary layer ansatz for the steady MHD equations]{Verification of Prandtl boundary layer ansatz for the steady electrically conducting fluids with a moving physical boundary}
\email{[email protected]}
\maketitle
\end{document}
I hope to modify this code to adapt to the situation where there are optional parameters. Every help and its description is highly welcome.
\title
end up in your title? Is it a subtitle? Can you provide a complete minimal document that we can use to replicate your current setup? It should start with\documentclass
and end with\end{document}
. Can you do that?\title
is defined by the document class so you have not provided any indication of the original definition. The definitions in the standard classes such asarticle
do not have an optional argument.\title
works inamsart
you have just killed\shorttitle