# Command to gray words

I would like to create a macro in LaTeX to have the following effect (gray parts) on some text:

I would like to have something like \gray{Hello} which puts brackets and grays the text. Can someone help me?

-
With the xcolor package, \textcolor{gray}{Hello}. If you want parens about the gray text, then \textcolor{gray}{(Hello)}. This can be placed in a macro of course. Here is a full MWE: \documentclass{article} \usepackage{xcolor} \def\gray#1{\textcolor{gray}{(#1)}} \begin{document} All writers \gray{will have to} edit their prose, but \gray{the} great. \end{document}  –  Steven B. Segletes Jul 15 '14 at 16:39
And to put brackets, simply load the xcolor package, and edit @StevenB.Segletes macro as \textcolor{gray}{(Hello)}. You can even put in your preamble \newcommand{\gray}[1]{\textcolor{gray}{(#1)}} and in your document use \gray{Hello}. –  Clément Jul 15 '14 at 16:41
@Clément We both had the same idea... I was editing my comment as you posted. –  Steven B. Segletes Jul 15 '14 at 16:42
In any case, I would strongly recommend using a more telling command name than simply \grey; perhaps \newcommand\Edit[1]{\textcolor{grey}{(#1)}}. –  Sean Allred Jul 15 '14 at 17:02
The downside of \grey, as suggested by Sean Allred, is that, in case you later decide that the color is red while you could redefine the command, it woul look/feel much worse to see that \gray{hello} gives you red color. –  Manuel Jul 15 '14 at 21:29

Showing three possibilities: The first as you desired, the second with better semantic and the third without an extra macro, as it is not that much to type.

\documentclass{article}
\usepackage{xcolor}
\newcommand{\gray}[1]{\textcolor{gray}{#1}}
\newcommand\Edit[1]{\textcolor{gray}{(#1)}}

\begin{document}
All writers \gray{(will have to)} edit their prose, but \gray{(the)} great

All writers \Edit{will have to} edit their prose, but \Edit{the} great

All writers \textcolor{gray}{(will have to)} edit their prose, but \textcolor{gray}{(the)} great
\end{document}


-
Thanks a lot for your time. –  minidiable Jul 18 '14 at 11:50