2

This is my code:

\documentclass{article}
\usepackage{fdsymbol}
\begin{document}
$\stackrel{hello}{\overlinesegment{world}}!$
\end{document}

How do I change the color of the horizontal line the stays between the "hello" and the "world"? I want it to be red.

yegor256
  • 12,021

1 Answers1

3

Depending on what exactly you need colored...

\documentclass{article}
\usepackage{fdsymbol,xcolor}
\begin{document}
$\stackrel{hello}{\overlinesegment{world}}!$
%
$\stackrel{hello}{\textcolor{red}{\overlinesegment{world}}}!$
%
$\stackrel{hello}{\textcolor{red}{\overlinesegment{\textcolor{black}{world}}}}!$
%
$\stackrel{\textcolor{red}{hello}}{\textcolor{red}{\overlinesegment{\textcolor{black}{world}}}}!$
\end{document}

enter image description here