我有这个代码:
\documentclass[twoside,fleqn]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[italian]{babel}
\usepackage[most]{tcolorbox}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{fadings,decorations.text}
\usetikzlibrary{patterns}
\begin{document}
\begin{tcolorbox}
\begin{tikzfadingfrompicture}[name=tikz]
\node[text width=15cm,text=transparent!20]{\fontsize{35}{60}\bfseries My title\\};\end{tikzfadingfrompicture}
\begin{tikzpicture}
\node[text width=15cm-3mm,text opacity=0,shade, path fading=tikz,
fit fading=false,
top color=red,
bottom color=yellow]{\fontsize{35}{40}\sffamily\bfseries My title\\};
\end{tikzpicture}
\end{tcolorbox}
\end{document}
答案1
\documentclass{article}
\usepackage{tikz}
\usepackage{pdfrender}
\usepackage{xcolor}
\begin{document}
\begin{tikzpicture}
\node[opacity=.2] at (0.1,-0.1) {
\scalebox{2}{\texttt{%
\textpdfrender{%
TextRenderingMode=2,
LineWidth=.1ex,
StrokeColor=darkgray!50,
FillColor=darkgray!50,
}{\Huge Hello World}}}
};
\node at (0,0) {
\scalebox{2}{\texttt{%
\textpdfrender{%
TextRenderingMode=2,
LineWidth=.1ex,
StrokeColor=blue!30!black,
FillColor=orange!90,
}{\Huge Hello World}}}
};
\end{tikzpicture}
\end{document}