Automatically Overlay a Title of a Different Color onto Itself

coloroverlaysshadingshadowstitles

I would like to be able to overlay a title of one color onto the same title of a different color to achieve a different effect; and I would like, if possible, to do this automatically without creating a special environment. (This is easy to do with, say, apspicture with two\rput commands)

Consider

\documentclass{book}
\usepackage{xcolor}
\definecolor{aqua}{RGB}{0, 188, 188}

\begin{document}
\thispagestyle{empty}
\Huge

\begin{center}
\textbf{\color{black}{HOW TO OVERLAY THIS TITLE}}

\textbf{\color{aqua}{HOW TO OVERLAY THIS TITLE}}

\vspace*{45pt}

{\textbf{\color{black}{HOW TO OVERLAY THIS TITLE}}}\\[-30pt]

{\textbf{\color{aqua}{HOW TO OVERLAY THIS TITLE}}}
\end{center}

\vspace*{35pt}

That is, how to do it \underline{\textit{automatically}}.
\end{document}   

which yields

enter image description here

In the MWE, I want to overlay the light aqua title over the black title—which I had accomplished by "trial and error" and inspection using a series of \\[] commands until I determined that \\[-30pt] seems to work.

But, I would like to know if there is a command of some sort that will do this automatically without invoking any special environment like pspicture, tikz, etc.? (Or is, perhaps, trial and error with negative vertical skips the (only) way for the usual document environment?)

Best Answer

This will work if the two versions are the exact same size. Otherwise you would have to overlay each letter separately.

\documentclass{article}
\usepackage{xcolor}
\definecolor{aqua}{RGB}{0, 188, 188}

\newcommand{\mytitle}[1]% #1 = title
{\bgroup
  \Huge
  \sbox0{\parbox{\columnwidth}{\centering\textbf{\color{black}#1}}}%
  \sbox1{\parbox{\columnwidth}{\centering\textbf{\color{aqua}#1}}}%
  \noindent\usebox0\llap{\raisebox{1pt}{\usebox1}}
\egroup}

\begin{document}
\mytitle{HOW TO OVERLAY THIS TITLE}
\end{document}

demo