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

Uwe Lueck uwe.lueck at web.de
Tue May 19 23:07:26 CEST 2009


And does the \relax produce the wanted leading space? -- As usual, please back your request with an actual application of your macros that seems not to work properly. I expect that it is essential to have some non-blue text within the document environment. -- BTW, I consider \textcolor{blue}{...} safer than {color{blue}#1}, since I observed that vertical alignment with \marginpar{\color{blue}...} is wrong, while \marginpar{\textcolor{blue}{...}} is fine. This may interrelate with the request, I don't know. -- Uwe. 

Philip TAYLOR <P.Taylor at rhul.ac.uk> schrieb am 19.05.2009 18:38:45:
> 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?
> > 
> _______________________________________________
> TeX FAQ: http://www.tex.ac.uk/faq
> Mailing list archives: http://tug.org/pipermail/texhax/
> More links: http://tug.org/begin.html
> 
> Automated subscription management: http://tug.org/mailman/listinfo/texhax
> Human mailing list managers: postmaster at tug.org
> 


More information about the texhax mailing list