How I can highlight equation as given below:
Asked
Active
Viewed 2,522 times
2
new_born
- 680
-
3Which part do you consider the highlight in the image? – Werner Feb 16 '18 at 17:51
-
1Like this? – Ignasi Feb 16 '18 at 17:52
-
1colored part of the above – new_born Feb 16 '18 at 17:53
-
1@ Ignasi Like above – new_born Feb 16 '18 at 17:55
-
Like here? – Feb 16 '18 at 17:58
-
How are you producing the image? – egreg Feb 16 '18 at 18:02
1 Answers
6
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.
Werner
- 603,163
-
-
-
@new_born: You can replace the
\struts with%. That should shrink things vertically. – Werner Feb 16 '18 at 18:12 -
missing $ error is showing. [
\colorbox{orange} { \strut (ht)^t = h^tg^tc }
]
– new_born Feb 17 '18 at 06:37 -
@new_born: As mentioned at the end of the answer,
<stuff>inside\colorboxis 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 '18 at 07:02

