TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have what's below and I do not know why the term m_{n+1,k} is not horizontally centered in its cell?

\begin{tikzpicture}[baseline=(current  bounding  box.center)]
\tikzset{square matrix/.style={outer sep=-6pt,matrix of nodes,
minimum height=0.7cm,
text width=0.7cm,
outer sep=-6pt}}}
\matrix(mymatrix)[square matrix,left delimiter={[},right delimiter={]}]{
1 & 0\\
0 & $-m_{n+1,k}$\\};
share|improve this question
Because you specified text width, so the cell can't become large enough to accommodate the whole text. Try minimum width instead. Side question: Do you actually want the node borders to be drawn, or is this just for testing purposes? – Jake Feb 9 '12 at 22:01
borders are here for testing purposes. I'll give the minimum width option a try. Thank you – pluton Feb 10 '12 at 1:53
Just remove the text width=0.7cm and it will center automatically anyway or reduce the font size with \scriptscriptstyle. Otherwise you will be overprinting. – percusse Feb 10 '12 at 15:29
up vote 2 down vote accepted

ok, the minimum width option helps but I am now using a \makebox[0pt][c]{$-m_{k+1,n}$} to get the desired matrix.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.