[texhax] Preserve space at end of expression enclosed in braces

Philip TAYLOR P.Taylor at Rhul.Ac.Uk
Tue May 19 18:34:40 CEST 2009


Try \relaxing a little more :-)

     \documentclass {article}
     \usepackage {color}
     \definecolor{LBBlue}{rgb}{0.4,0.3,1.0}
     \newcommand{\morerefadd}[1]{{\color{LBBlue}\relax #1}}
     \begin {document}
     \morerefadd{some text}%
     \morerefadd{ some more text }%
     \morerefadd{and that's it}%
     \end {document}

Philip TAYLOR
--------
Dan Hatton wrote:
> Dear All,
> 
> I've defined commands as follows:
> 
> \definecolor{LBRed}{rgb}{0.9,0.1,0.2}
> \definecolor{LBBlue}{rgb}{0.4,0.3,1.0}
> 
> \newcommand{\morerefadd}[1]{{\color{LBBlue}#1}}
> \newcommand{\morerefchange}[2]{{\color{LBRed}#1}{\color{LBBlue}#2}}
> \newcommand{\morerefdel}[1]{{\color{LBRed}#1}}
> 
> to do revision tracking and highlighting on a document.
> 
> Now, I want to put a space between two words (because words should
> have spaces between!) with something like
> 
> \morerefadd{ }
> 
> but the space doesn't appear in the output of LaTeX.  In fact, even
> when I put
> 
> \morerefadd{ some other text}
> 
> the initial space doesn't appear.  Any ideas please?
> 


More information about the texhax mailing list