I would like to mark portions of my text that requires special attention during the review process. This marking won't be in the final document, so would like to be able to add these marks without affecting the spacing or alignment of the text. I don't want to change the color of the text, or add highlighting as that would be too distracting.
The MWE below results in additional spacing which I want to avoid. I attempted to use \kern-\widthof{} but could not get that to work.
I am not stuck on this approach so if someone has an alternative way to do this that is fine.
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathabx}
\usepackage{xcolor}
\usepackage{calc}
\DeclareRobustCommand{\MarkStart}{\textcolor{green}{\raisebox{5pt}[0pt][0pt]{$\Rsh$}}}%
\DeclareRobustCommand{\MarkEnd}{\textcolor{green}{\raisebox{5pt}[0pt][0pt]{$\Lsh$}}}%
\newcommand*{\KernMarkStart}{\kern-\widthof{\MarkStart}}%
\newcommand*{\KernMarkEnd}{\kern-\widthof{\MarkEnd}}%
\newcommand*{\MarkStartWithKern}{\MarkStart\KernMarkStart}%
\newcommand*{\MarkEndWithKern}{\MarkEnd\KernMarkEnd}%
\newcommand*{\Mark}[1]{\MarkStart#1\MarkEnd}%
%\newcommand*{\Mark}[1]{\MarkStartWithKern#1\MarkEndWithKern}%
\begin{document}
Without changing the spacing, I want to mark
this word.
Without changing the spacing, I want to mark
\Mark{this} word.
\bigskip
Similary with inline math, I want to mark the $y^2$ term:
$x^2 + y^2 = z^2$.
$x^2 + \Mark{y^2} = z^2$.
\bigskip
With display mode math things should also be marked similarily:
\begin{align*}
a &= b\\
x^2 + y^2 &= z^2\\
x^2 + \Mark{y^2} &= z^2\\
c &= d
\end{align*}
and should be able to mark entire equation as:
\begin{align*}
a &= b\\
\Mark{x^2 + y^2 &= z^2}\\
c &= d
\end{align*}
The above should align with:
\begin{align*}
a &= b\\
x^2 + y^2 &= z^2\\
c &= d
\end{align*}
\end{document}
I am using the solution from Changbars to indicate location of conditional text so that the location of these markings is easy to locate so the fact that these markings don't stand out is ok.
\kern-6pt? Is that just trial and error? It seems that that'll have to be adjusted if the symbol is changed? – Peter Grill Jul 26 '11 at 21:10\sin\Mark{(x+y)}, where the Ord takes the place of an Open atom. – egreg Jul 26 '11 at 21:18\Mark{\sin(x+y)}. Any idea why\kern-\widthof{}didn't work? I guess that should probably be a separate question. – Peter Grill Jul 26 '11 at 22:04\MarkStartand\MarkEndhave width zero. The two objects should stay next to an ordinary symbol, in order not to affect math spacing. Even if they had width the\kernwould have the same problem. – egreg Jul 26 '11 at 22:13\sinis an operator (Op) and(is an opening (Open). TeX inserts no space between an Op and an Open; instead it inserts a thin space between an Op and an Ord. There are also Rel (<) and Bin (+) atoms. I wouldn't worry too much of some slightly incorrect space: when the paper will be final, the commands will be deleted. – egreg Jul 26 '11 at 22:34