0

I have enclosed the sample code of a Routh Array Table. I wish to highlight the first column of the Table.

One way to do is to run the LaTeX, get a PDF output, save as image, highlight the first column using Paint or such software, and call the image using the Figure environment in LaTeX. This seems to be quite a long route!

I'd like to know if there is a direct way to mark the first column of the Routh Array in LaTeX.

\documentclass[12pt]{report}

\begin{document} The Routh array is:

\begin{tabular}{c|cc} $s^3$ & $1$ & $2$ \[2mm] $s^2$ & $1$ & $24$ \[2mm] $s^1$ & $-22$ & $0$ \[2mm] $s^0$ & $24$ & $0$ \[2mm] \end{tabular}

\end{document}

Desired Output of Routh Array Table

Ingmar
  • 6,690
  • 5
  • 26
  • 47

1 Answers1

2

I used the packages xcolor and colortbl to define a color Higlight and a new column type h. This produces:

enter image description here

Here is the code:

\documentclass[12pt]{report}

\usepackage{xcolor,colortbl} \definecolor{Highlight}{HTML}{FFF59C} \newcolumntype{h}{>{\columncolor{Highlight}}c}

\begin{document} The Routh array is:

\begin{tabular}{c|hc} $s^3$ & $1$ & $2$ \[2mm] $s^2$ & $1$ & $24$ \[2mm] $s^1$ & $-22$ & $0$ \[2mm] $s^0$ & $24$ & $0$ \[2mm] \end{tabular}

\end{document}


You can change the color by defining your own color with \definecolor{name}{type}{value} where type can be RGB, rgb, cmyk or HTML (hex). Here is how to provide values for them:

  • RGB: 3 numbers between 0 and 255: {1,18,240}
  • rgb 3 numbers between 0 and 1: {0.5,0.1,0}
  • cmyk 3 numbers between 0 and 1: {0.5,0.1,0}
  • HTML same as Hex code (1 value, 6 digits): {006600}
Vebjorn
  • 1,778