Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to make a matrix in LaTeX. Now I am trying to make a table with multicolumn like

a b c
d  у

So I coded

\usepackage{arydshln}
\usepackage{array}
\usepackage{amsmath}
\usepackage{multirow}
\begin{document}
\begin{align*}
& \hspace{0.3cm}\overbrace{\hphantom{\begin{array}{ccc}
a&b&c
\end{array}}}\\
&\left[
\begin{array}{ccc}
a&b&c\\
d&\multicolumn{2}{c}{$\phi$}\\
\end{array}
\right]
\end{align*}
\end{document}

But I cannot make the multicolumn work I've read several manuals like

http://andrewjpage.com/index.php?/archives/43-Multirow-and-multicolumn-spanning-with-latex-tables.html

http://cosy.comli.com/wordpress1/2009/04/08/advanced-matrix-partitioning-latex/

And some others, but it doesn't solve my problem. I am using texmaker and it error log gives some abstract errors like "missing $ inserted". Thank you.

share|improve this question

migrated from stackoverflow.com Mar 8 '11 at 15:33

This question came from our site for professional and enthusiast programmers.

    
This is a question better suited for tex.stackexchange.com. That said, I think you need to insert a space before the closing $, like this: $\phi $. –  Matt Ball Mar 8 '11 at 15:06
    
@Matt Ball (although it probably not going to reach stackoverflow): you don't need a space before the closing dollar. –  Bruno Le Floch Mar 8 '11 at 15:54

1 Answer 1

up vote 5 down vote accepted

You already are in math environment (align*), so there's no need to escape \phi with $ $ -- and that's what is causing the error. Just remove them, and you should be good to go.

share|improve this answer
    
awesome, thanks! –  lhj7362 Mar 8 '11 at 16:25

Your Answer

 
discard

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.