4

I'm trying to place a matrix beside a tikz picture and I put isomorphism between them but it doesn't work. Can anyone advise me?

This is my attempt:

 \documentclass[10pt]{article}
 \usepackage{geometry}% <-- added, 
 \usepackage{tikz}
  \usetikzlibrary{arrows}
  \usepackage{mathrsfs,array}
  \begin{document}
  \definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}

  \tikzset{graph-1/.style = {
  line cap = round,
   line join = round,
     > = triangle 45,
     x=0.7cm, y=0.7cm,
      every node/.append style = {inner ysep=2mm}
                        }
    }% end of tikzset

  \begin{figure}[h]
  \centering
  $\displaystyle
  \alpha=
   \begin{pmatrix}
    0 & 0 & 0 \\
    1 & 0 & 0 \\
    0 & 1 & 0 
\end{pmatrix}
 \cong
 \begin{tikzpicture}[graph-1] 
 \draw (0, 1.5) -- + (2,0);
  \draw (0,-1.5) -- + (2,0);
   %%%
 \foreach \x in {0, 1}
  \draw  (\x,1.5) -- (\x+1,-1.5);

   \foreach \x/\label in {0/\scriptstyle1, 1/\scriptstyle2, 2/\scriptstyle3}
    \draw[fill=uuuuuu]  (\x,1.5) circle (1.3pt) node[above] {$\label$};
     %
        \foreach \x/\label in {0/\scriptstyle1, 1/\scriptstyle2,   2/\scriptstyle3}
    \draw[fill=uuuuuu]  (\x,-1.5) circle (1.3pt) node[below] {$\label$};
      \end{tikzpicture}
     $
  \caption{Caption}
  \label{ex}
   \end{figure}
    \end{document} 
2

After loading the amsmath package and some minor adjustments it works, I think.

\documentclass[10pt]{article}
 \usepackage{amsmath}%<-- added, 
 \usepackage{geometry}% 
 \usepackage{tikz}
  \usetikzlibrary{arrows}
  \usepackage{mathrsfs,array}
  \begin{document}
  \definecolor{uuuuuu}{rgb}{0.26666666666666666,0.26666666666666666,0.26666666666666666}

  \tikzset{graph-1/.style = {
  line cap = round,
   line join = round,
     > = triangle 45,
     x=0.7cm, y=0.7cm,
      every node/.append style = {inner ysep=2mm}
                        }
    }% end of tikzset

  \begin{figure}[h]
\[  \alpha=
   \begin{pmatrix}
    0 & 0 & 0 \\
    1 & 0 & 0 \\
    0 & 1 & 0 \\
\end{pmatrix}
 \cong
 \begin{tikzpicture}[graph-1,baseline={(fakebase.base)}] 
 \node[draw=none] (fakebase){\strut};
 \draw (0, 1.5) -- + (2,0);
  \draw (0,-1.5) -- + (2,0);
   %%%
 \foreach \x in {0, 1}
  \draw  (\x,1.5) -- (\x+1,-1.5);

   \foreach \x/\label in {0/\scriptstyle1, 1/\scriptstyle2, 2/\scriptstyle3}
    \draw[fill=uuuuuu]  (\x,1.5) circle (1.3pt) node[above] {$\label$};
     %
        \foreach \x/\label in {0/\scriptstyle1, 1/\scriptstyle2,   2/\scriptstyle3}
    \draw[fill=uuuuuu]  (\x,-1.5) circle (1.3pt) node[below] {$\label$};
      \end{tikzpicture}
\]
  \caption{Caption}
  \label{ex}
   \end{figure}
\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.