Skip to content

Instantly share code, notes, and snippets.

@avatar-lavventura
Last active February 21, 2018 10:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
\begin{figure}[H]
\centering
\begin{tikzpicture}[
MyStyle/.style={draw, minimum width=2em, minimum height=2em, outer sep=0pt, node distance = 0.01cm },
]
\matrix (A) [matrix of math nodes, nodes = {draw,align=center}, nodes={MyStyle, anchor=center, }, column sep=-\pgflinewidth]
{10\\ 10 & 20\\ 20 & 33\\ 15 \\};
\begin{scope}[-{Stealth[length = 5.0pt]}]
\end{scope}
\end{tikzpicture}
\end{figure}
@TorbjornT
Copy link

\documentclass[a4paper]{article}    
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}[
    MyStyle/.style={draw, minimum width=2em, minimum height=2em, outer sep=0pt, node distance = 0.01cm },
  ]
\matrix (A) [
   matrix of nodes, % removed math
   nodes = {
    draw,
    text width=5mm, % added
    align=center,
    MyStyle,
    anchor=center
  },
  column sep=-\pgflinewidth
]
{ {10\\ 10} & {20\\ 20} & {33\\ 15} \\};
\end{tikzpicture}
\end{document}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment