9
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}

\begin{equation}
{S}=
 \left(\begin{tabular}{1}
&\centering\{B_{M,i}\}\\
&\centering.\\
&\centering.\\
&\centering\{B_{1,i}\}  \{B_{2,i}\}  {.}  {.}  \{B_{M,i}\}
\end{tabular}
\right)
\end{equation}
\end{document}

When I execute the above code, I am getting the output, but it's stating "illegal character in an array arg".

1
  • 1
    Welcome to TeX.SE. I've edited your post so that code shows up as code by highlighting and hitting cmd/ctrl-k (or clicking the {} button). Thanks for the MWE.
    – Teepeemm
    Commented Oct 17, 2018 at 3:25

2 Answers 2

10

The "illegal character in array arg" references the fact that you're using 1 as a column specification which is undefined. You can only use l, r, c or p{<len>}. Also, using tabular places everything in text mode, which doesn't allow subscript/superscript without being in math mode. There is array as a math alternative.

Here's a suggested solution:

enter image description here

\documentclass{article}

\begin{document}

\[
  S = \left(\begin{array}{c}
    \{B_{M,i}\} \\
    \vdots \\
    \{B_{1,i}\} \ \{B_{2,i}\} \ \cdots \ \{B_{M,i}\}
  \end{array}\right)
\]

\end{document}
1
  • Happened with me as well. Typed 1 instead of l Commented Jun 23, 2020 at 0:21
2

You may want to double check a TeX tutorial about how tabular and array work. tabular is a text environment, and then would require that you typeset its entries as math with manual $. It looks like you really wanted array, which is in math and typesets its entries as math without needing $. The argument to either environment is the specification for each column. In your case, you have 1 column that you're centering, so {1} should be {c}, and then you wouldn't need \centering. (Other common options instead of c are l and r for left and right justified.) If you wanted more columns, then you would separate your columns with the & (but don't use it if there's only one column).

As long as you are using amsmath, I would recommend the pmatrix environment (the p stands for parentheses):

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\begin{document}

\begin{equation}
S=\begin{pmatrix}
\{B_{M,i}\}\\
\vdots\\
\{B_{1,i}\}  \{B_{2,i}\} \dots \{B_{M,i}\}
\end{pmatrix}
\end{equation}
\end{document}

A few other things to note: {S} is the same thing as S, I've used \vdots for vertical dots, and \dots for the horizontal dots. You could consider if you want to space the \{B_{k,i}\} out with \, or \ or not.

You must log in to answer this question.

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