答案1
你可以使用tikzmark
这个:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark}
\begin{document}
\huge
\tikzmark{firststart}john\tikzmark{firstend}.\tikzmark{laststart}doe\tikzmark{lastend}@\tikzmark{domainstart}example.com\tikzmark{domainend}
\begin{tikzpicture}[overlay, remember picture,marking/.style={font=\scriptsize\scshape,fill=white,inner sep=1pt}]
\foreach \part in {first,last,domain}
\draw ([yshift=-5pt]pic cs:\part start) -- ++(0,-5pt) -- node[marking,midway]{\part} ([yshift=-10pt]pic cs:\part end) -- ++(0,5pt);
\end{tikzpicture}
\end{document}