I am using tikz for creating commutative diagram in a mathematical text. However, diagrams are part of text/sentences, hence I sometimes would like to end them with a comma or full stop.

A standard layout I use would look like this:

\documentclass[a4paper, reqno, 14pt]{amsart}
\tikzset{join/.code=\tikzset{after node path={%
edge[every join]#1(\tikzchaincurrent)\fi}}}
\tikzset{>=stealth',every on chain/.append style={join},
         every join/.style={->}}
\tikzstyle{labeled}=[execute at begin node=$\scriptstyle,
   execute at end node=$]
 \matrix (m) [matrix of math nodes, row sep=3em, column sep=3em]
    { 0 & M  & M  & M/fM  & 0 \\
      0 & M_B & M_B & (M/fM)_B & 0 \\ };
  { [start chain] \chainin (m-1-1);
    \chainin (m-1-2);
    { [start branch=A] \chainin (m-2-2)
        [join={node[right,labeled] {}}];}
    \chainin (m-1-3) [join={node[above,labeled] {\cdot f}}];
    { [start branch=B] \chainin (m-2-3)
        [join={node[right,labeled] {}}];}
    \chainin (m-1-4) [join={node[above,labeled] {}}];
    { [start branch=C] \chainin (m-2-4)
        [join={node[right,labeled] {}}];}
    \chainin (m-1-5); }
  { [start chain] \chainin (m-2-1);
    \chainin (m-2-2);
    \chainin (m-2-3) [join={node[above,labeled] {\cdot f \otimes \operatorname{id}}}];
    \chainin (m-2-4) [join={node[above,labeled] {}}];
    \chainin (m-2-5); } 
        \hspace{\fill} \\

If I just write (in the example above) "0." for the last entry of the second row, the last arrow of the second row will be shorter - which looks horribly. What is the intended way to end this diagram with a full stop?

  • 2
    Welcome to TeX.SX! Would you add the necessary code to make the example compilable? On the other hand, 0\makebox[0pt][l]{.} should work (it would be 0\rlap{.} for the macho TeX programmer).
    – egreg
    Commented Jul 1, 2014 at 10:52

1 Answer 1


You can use a period that doesn't take any physical space. Add


to your document preamble and type


where you want punctuation. You may want to have the same for other punctuations, so maybe a different command is better:


and you'd type


or \nospacepunct{,} for a comma.

There is a simpler way to achieve the same diagram with the tikz-cd package.



0 \arrow{r} &
  M    \arrow{r}{f} \arrow{d} &
  M    \arrow{r}    \arrow{d} &
  M/fM \arrow{r}    \arrow{d} &
0 \arrow{r} &
  M_B      \arrow{r}{f\otimes\mathrm{id}} &
  M_B      \arrow{r} &
  (M/fM)_B \arrow{r} &

enter image description here

You must log in to answer this question.

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