6

I wanted to create a table in which one column is a diagram that uses psmatrix, and the other column is text. I got the following error:

"Forbidden control sequence found while scanning use of \psmatrix.".

Here is a MWE that gives this error, where only the column with the psmatrix is shown:

\documentclass{article}
\usepackage{auto-pst-pdf,pstricks,pst-node,array}
\begin{document}

\begin{tabular}{c}
  \begin{psmatrix}
    A & B & C  \\
    1 & 2 & 3
  \end{psmatrix}
\end{tabular}

\end{document}

One solution is to drop the table altogether and use only a psmatrix, and put the additional text in a matrix column. But, logically it is more convenient to keep the matrix separate from the text, since in the real document the matrix is generated by macros.

0

2 Answers 2

5

Just add braces around the pspicture:

\documentclass{article}
\usepackage{auto-pst-pdf,pstricks,pst-node} 
\begin{document}

\begin{tabular}{c}
  {\begin{psmatrix}
    A & B & C  \\
    1 & 2 & 3
  \end{psmatrix}}
\end{tabular}

\end{document}

The & at the top level are confusing TeX's table parser.

3

use a different syntax:

\documentclass{article}
\usepackage{auto-pst-pdf,pst-node} 
\begin{document}

\begin{tabular}{c}
  \psmatrix
    A & B & C  \\
    1 & 2 & 3
  \endpsmatrix
\end{tabular}

\end{document}

You must log in to answer this question.

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