6

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.

8

Use the color package and do

\color{red} F(s) &\color{red}= - \frac{1 + sR_F C_F}{R_F}
  • So \color{...} does not work across alignment columns? – Kit Feb 28 '14 at 10:34
  • 2
    @Kit No, each cell is a group – daleif Feb 28 '14 at 10:34
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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.