7

I want to color only one line of this display equation:

\begin{align*}
  i_{fb} &= - \frac{v_o}{Z_F} \\
  F(s) = \frac{i_{fb}}{v_o} &= - \frac{1}{Z_F} \\
  \color{red} F(s) &= - \frac{1 + sR_F C_F}{R_F}
\end{align*}

How do I do it? The above example only provides color to F(s). Enclosing whole line in {} causes ref to appear at the right side.

Kit
  • 16,430

2 Answers2

8

Use the color package and do

\color{red} F(s) &\color{red}= - \frac{1 + sR_F C_F}{R_F}
Ruben
  • 13,448
Aung
  • 621
6

You can use the hf-tikz package, which was built as a result of Beamer: highlighting aligned math with overlay.

screenshot

Here's a MWE- note that I had to use \tikzmarkin{c}(0.1,-0.4)(-0.1,0.5) to get the boundaries corrected- you might want to adjust them further as you see fit :)

% arara: pdflatex
% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass{article}
\usepackage{amsmath}
\usepackage{hf-tikz}

\begin{document}

\begin{align*}
    i_{fb}                                 & = - \frac{v_o}{Z_F}                         \\
    F(s) = \frac{i_{fb}}{v_o}              & = - \frac{1}{Z_F}                           \\
    \tikzmarkin{c}(0.1,-0.4)(-0.1,0.5)F(s) & = - \frac{1 + sR_F C_F}{R_F}\tikzmarkend{c}
\end{align*}

\end{document}
cmhughes
  • 100,947