How I can highlight equation as given below:
-
3Which part do you consider the highlight in the image?– Werner ♦Feb 16, 2018 at 17:51
-
1Like this?– IgnasiFeb 16, 2018 at 17:52
-
1colored part of the above– new_bornFeb 16, 2018 at 17:53
-
1@ Ignasi Like above– new_bornFeb 16, 2018 at 17:55
-
Like here?– user121799Feb 16, 2018 at 17:58
1 Answer
You can play around with the spacing:
\documentclass{article}
\usepackage{xcolor,amsmath}
\DeclareMathOperator{\suc}{Suc}
\begin{document}
By applying rule~2 (\texttt{apply\_rupple\_step}), the left hand side of the step-case is rippled to:
\[
\colorbox{orange}{\strut
case $b'$ of $0 \Rightarrow (\suc a) \mid (\suc z) \Rightarrow \suc(\colorbox{white}{$\max a \lfloor z \rfloor$})$%
}
{} = \max \lfloor b' \rfloor
\colorbox{orange}{\strut
$\suc \colorbox{white}{a}$%
}
\]
\end{document}
Ultimately you can just use \colorbox{<color>}{<stuff>}
to highlight content. I've added \strut
to ensure a consistent baseline height of the resulting coloured box, as well as using text where it seemed necessary. Note that <stuff>
inside a \colorbox
is set in text mode.
-
-
-
@new_born: You can replace the
\strut
s with%
. That should shrink things vertically.– Werner ♦Feb 16, 2018 at 18:12 -
missing $ error is showing. [ \colorbox{orange} { \strut (ht)^t = h^tg^tc } ]– new_bornFeb 17, 2018 at 6:37
-
@new_born: As mentioned at the end of the answer,
<stuff>
inside\colorbox
is set in text mode. If you want to use math - like your use of superscripts - you need to surround it with$
s.– Werner ♦Feb 17, 2018 at 7:02