15

How could I achieve with LaTeX a trendy text reflection effect as the following one? enter image description here

Denis Bitouzé
  • 9,652
  • 4
  • 27
  • 85

1 Answers1

22

Here is a solution:

\documentclass[tikz,margin=2mm]{standalone}
\usetikzlibrary{fadings}
\begin{document}
\begin{tikzpicture}
  \def\mytext{Reflec\textcolor{red}{t}ion}
  \tikzset{mynode/.style={anchor=south,inner sep=0,font=\ttfamily\Huge}}
  \node[mynode]{\mytext};
  \node[scope fading=south,opacity=0.4,yscale=-1,mynode]{\mytext};
\end{tikzpicture}
\end{document}

enter image description here

Note: To remove the gap between the node and its reflection, you may use anchor=base or line width=0.

Note 2: Unlike Inkscape, TikZ does not know the true bounding box of glyphs:

enter image description here

Paul Gaborit
  • 70,770
  • 10
  • 176
  • 283