Skip to main content
added 551 characters in body
Source Link
CarLaTeX
  • 66.2k
  • 15
  • 104
  • 308

The third parameter of the macro \titleshading is used for both the main text and the shading; if you color the text there, you'll change it everywhere.

Change only the color of the main text in the macro:

\documentclass{article}
\usepackage{tikz}
\usepackage{xcolor}

\newcommand\titleshading[3]{
    \newcommand\xoffset{0.3}
    \newcommand\yoffset{-0.25}
    % Blur
    \foreach \x in {-0.1,0.1} {
        \foreach \y in {-0.1,0.1} {         
            \node[blue!65!white] at (#1em+\xoffset em+\x em,#2em+\yoffset em+\y em) {
                \scalebox{2}{\Huge\texttt{#3}} 
            };
        }
    }

    % Main Shadow
    \node[blue!40!white] at (#1em+0.3em,#2em-0.2em) {
        \scalebox{2}{\Huge\texttt{#3}} 
    };
    \node[red] at (#1em,#2em) {% <-- here put the color you like 
        \scalebox{2}{\Huge\texttt{#3}} 
    };
}

\begin{document}
\begin{tikzpicture}[remember picture,overlay]   
    \titleshading{8}{0}{Book Title}
\end{tikzpicture} 
\end{document}

enter image description here

A simpler way to do a similar thing may be using the package shadowtext, you do not need to load TikZ here:

\documentclass{article}
\usepackage{xcolor}
\usepackage{graphicx}

\usepackage{shadowtext}
\shadowoffset{2.5pt}
\shadowcolor{blue!65!white}

\newcommand\titleshading[1]{\shadowtext{\color{red}\Huge\ttfamily\scalebox{2}{#1}}}

\begin{document}
\titleshading{Book Title}
\end{document}

enter image description here

The third parameter of the macro \titleshading is used for both the main text and the shading; if you color the text there, you'll change it everywhere.

Change only the color of the main text in the macro:

\documentclass{article}
\usepackage{tikz}
\usepackage{xcolor}

\newcommand\titleshading[3]{
    \newcommand\xoffset{0.3}
    \newcommand\yoffset{-0.25}
    % Blur
    \foreach \x in {-0.1,0.1} {
        \foreach \y in {-0.1,0.1} {         
            \node[blue!65!white] at (#1em+\xoffset em+\x em,#2em+\yoffset em+\y em) {
                \scalebox{2}{\Huge\texttt{#3}} 
            };
        }
    }

    % Main Shadow
    \node[blue!40!white] at (#1em+0.3em,#2em-0.2em) {
        \scalebox{2}{\Huge\texttt{#3}} 
    };
    \node[red] at (#1em,#2em) {% <-- here put the color you like 
        \scalebox{2}{\Huge\texttt{#3}} 
    };
}

\begin{document}
\begin{tikzpicture}[remember picture,overlay]   
    \titleshading{8}{0}{Book Title}
\end{tikzpicture} 
\end{document}

enter image description here

The third parameter of the macro \titleshading is used for both the main text and the shading; if you color the text there, you'll change it everywhere.

Change only the color of the main text in the macro:

\documentclass{article}
\usepackage{tikz}
\usepackage{xcolor}

\newcommand\titleshading[3]{
    \newcommand\xoffset{0.3}
    \newcommand\yoffset{-0.25}
    % Blur
    \foreach \x in {-0.1,0.1} {
        \foreach \y in {-0.1,0.1} {         
            \node[blue!65!white] at (#1em+\xoffset em+\x em,#2em+\yoffset em+\y em) {
                \scalebox{2}{\Huge\texttt{#3}} 
            };
        }
    }

    % Main Shadow
    \node[blue!40!white] at (#1em+0.3em,#2em-0.2em) {
        \scalebox{2}{\Huge\texttt{#3}} 
    };
    \node[red] at (#1em,#2em) {% <-- here put the color you like 
        \scalebox{2}{\Huge\texttt{#3}} 
    };
}

\begin{document}
\begin{tikzpicture}[remember picture,overlay]   
    \titleshading{8}{0}{Book Title}
\end{tikzpicture} 
\end{document}

enter image description here

A simpler way to do a similar thing may be using the package shadowtext, you do not need to load TikZ here:

\documentclass{article}
\usepackage{xcolor}
\usepackage{graphicx}

\usepackage{shadowtext}
\shadowoffset{2.5pt}
\shadowcolor{blue!65!white}

\newcommand\titleshading[1]{\shadowtext{\color{red}\Huge\ttfamily\scalebox{2}{#1}}}

\begin{document}
\titleshading{Book Title}
\end{document}

enter image description here

Source Link
CarLaTeX
  • 66.2k
  • 15
  • 104
  • 308

The third parameter of the macro \titleshading is used for both the main text and the shading; if you color the text there, you'll change it everywhere.

Change only the color of the main text in the macro:

\documentclass{article}
\usepackage{tikz}
\usepackage{xcolor}

\newcommand\titleshading[3]{
    \newcommand\xoffset{0.3}
    \newcommand\yoffset{-0.25}
    % Blur
    \foreach \x in {-0.1,0.1} {
        \foreach \y in {-0.1,0.1} {         
            \node[blue!65!white] at (#1em+\xoffset em+\x em,#2em+\yoffset em+\y em) {
                \scalebox{2}{\Huge\texttt{#3}} 
            };
        }
    }

    % Main Shadow
    \node[blue!40!white] at (#1em+0.3em,#2em-0.2em) {
        \scalebox{2}{\Huge\texttt{#3}} 
    };
    \node[red] at (#1em,#2em) {% <-- here put the color you like 
        \scalebox{2}{\Huge\texttt{#3}} 
    };
}

\begin{document}
\begin{tikzpicture}[remember picture,overlay]   
    \titleshading{8}{0}{Book Title}
\end{tikzpicture} 
\end{document}

enter image description here