0

I have the following matrix

\begin{pmatrix} 
  1 & 3 & 2 & 6 \\ 
  4 & 1 & 8 & 2 \\ 
  3 & 9 & 4 & 12 \\ 
  12 & 3 & 16 & 4 
\end{pmatrix}

And I want the '1' and '6' from the first row and '12' and '4' from the last row to be marked in some way. Either in bold lettering or inside a small 'box' or some other way (not a different color though). I want it to be clear to the reader, these are the Komponents to pay attention to. Does anyone know how to do this?

4

Code

\documentclass[]{article}

\usepackage{amsmath}
\usepackage{bm}

\begin{document}

% https://tex.stackexchange.com/questions/595

\begin{equation}
\begin{pmatrix} 
  \bm{1} & 3 & 2 & \bm{6} \\ 
  4 & 1 & 8 & 2 \\ 
  3 & 9 & 4 & 12 \\ 
  \bm{12} & 3 & 16 & \bm{4} 
\end{pmatrix}
\end{equation}

\end{document}

Output

enter image description here

4

Three other possibilities:

\documentclass[]{article}
\usepackage[svgnames]{xcolor}
\usepackage{mathtools}
\usepackage{bm}
\newcommand\ub[1]{\underbracket[0.4pt][1.5pt]{\mkern1mu#1\mkern1mu}}
\newcommand\hl[1]{\color{DarkGrey}{\bm{#1}}}

\begin{document}

\begin{equation}\setlength\fboxsep{2pt}
  \begin{pmatrix}
    \boxed{1} & 3 & 2 & \boxed{6} \\
    4 & 1 & 8 & 2 \\
    3 & 9 & 4 & 12 \\
    \boxed{12} & 3 & 16 & \boxed{4}
  \end{pmatrix}
  \qquad
  \begin{pmatrix}
    \ub{1} & 3 & 2 & \ub{6} \\
    4 & 1 & 8 & 2 \\
    3 & 9 & 4 & 12 \\
    \ub{12} & 3 & 16 & \ub{4}
  \end{pmatrix}
  \qquad
  \begin{pmatrix}
    \hl{1} & 3 & 2 & \hl{6} \\
    4 & 1 & 8 & 2 \\
    3 & 9 & 4 & 12 \\
    \hl{12} & 3 & 16 & \hl{4}
  \end{pmatrix}
\end{equation}

\end{document} 

enter image description here

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.