Does tikz provide a way to draw text at a particular coordinate location? I am trying to fill the contents of a grid with fractions.


1 Answer 1


You can use a matrix of math nodes. One has to account for the line width at some places.

 \node[matrix of math nodes,anchor=south west,inner sep=0pt,
    nodes={draw,minimum size=1cm,anchor=center},
    column sep=-\pgflinewidth,row sep=-\pgflinewidth]
    {\frac{1}{2} & \frac{1}{3} \\
    \frac{1}{4} & \frac{1}{5}\\};
 \draw[red,dashed] (0,0) grid (2,2);    

enter image description here

The dashed grid is just to illustrate that the node boundaries really line up with a grid.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .