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.

From the picture below, both are supposed to be 4x4 matrices, but I want to express the first one with 2x2 matrix within 2x2 matrix where the J1 and J2 are 2x2 matrices while the 0 is 2x2 zero matrix. I wanted to make the size to look the same as this looks somehow ugly. Anyone has idea? I attached the code as well.

\begin{multicols}{2}
\begin{enumerate}
    \item $\begin{Bmatrix}
    J_1 & 0 \\
    0 & J_2 
    \end{Bmatrix}$
    \item $\begin{Bmatrix}
        \lambda_0 & 1 & 0 & 0 \\
        0 & \lambda_0 & 1 & 0 \\
        0 & 0 & \lambda_0 & 0 \\
        0 & 0 & 0 & \lambda_1
        \end{Bmatrix}$ 
    \item $\begin{Bmatrix}
            \lambda_0 & 1 & 0 & 0 \\
            0 & \lambda_0 & 1 & 0 \\
            0 & 0 & \lambda_0 & 1 \\
            0 & 0 & 0 & \lambda_0
            \end{Bmatrix}$ 
    \item $\begin{Bmatrix}
            \alpha & \beta & 1 & 0 \\
            -\beta & \alpha & 0 & 1 \\
            0 & 0 & \alpha & \beta \\
            0 & 0 & -\beta & \alpha 
            \end{Bmatrix}$
\end{enumerate}
\end{multicols}

enter image description here

share|improve this question
2  
Please post your code as text not an image, preferably as a complete small document, so people can test their answers. –  David Carlisle Mar 13 at 17:09
    
Can you teach me how to post it as code? >.< –  Andrew Ooi Mar 13 at 17:11
    
Just cut and paste the text in to the question, then highlight it and click the {} button in the editor (which just indents it by 4 spaces) the wiki then formats it as a scrollable text box –  David Carlisle Mar 13 at 17:12
    
done, thanks @DavidCarlisle –  Andrew Ooi Mar 13 at 17:14
4  
Better would be to have a full document \documentclas.... so we don't have to guess where Bmatrix is defined. (I can guess but you never know) (I guessed wrongly about a cases environemnt today when someone didn't show their preamble and I assumed it was amsmath) –  David Carlisle Mar 13 at 17:16
add comment

3 Answers 3

up vote 8 down vote accepted

enter image description here

\documentclass{article}
\usepackage{multicol,amsmath}

\begin{document}
\begin{multicols}{2}
\begin{enumerate}
    \item $\begin{Bmatrix}
\begin{picture}(0,0)\put(5,-8){\boldmath\large$J_1 $}\end{picture}
&&
\begin{picture}(0,0)\put(5,-8){\boldmath\large$0$}\end{picture}
&\\
\phantom{\lambda_1}&
\phantom{\lambda_1}&
\phantom{\lambda_1}&
\phantom{\lambda_1}\\
\begin{picture}(0,0)\put(5,-8){\boldmath\large$0$}\end{picture}
 &&
\begin{picture}(0,0)\put(5,-8){\boldmath\large$J_2 $}\end{picture}
&\\
\phantom{0}
    \end{Bmatrix}$
    \item $\begin{Bmatrix}
        \lambda_0 & 1 & 0 & 0 \\
        0 & \lambda_0 & 1 & 0 \\
        0 & 0 & \lambda_0 & 0 \\
        0 & 0 & 0 & \lambda_1
        \end{Bmatrix}$ 
    \item $\begin{Bmatrix}
            \lambda_0 & 1 & 0 & 0 \\
            0 & \lambda_0 & 1 & 0 \\
            0 & 0 & \lambda_0 & 1 \\
            0 & 0 & 0 & \lambda_0
            \end{Bmatrix}$ 
    \item $\begin{Bmatrix}
            \alpha & \beta & 1 & 0 \\
            -\beta & \alpha & 0 & 1 \\
            0 & 0 & \alpha & \beta \\
            0 & 0 & -\beta & \alpha 
            \end{Bmatrix}$
\end{enumerate}
\end{multicols}
\end{document}
share|improve this answer
add comment

Here is an option that just moves the 2x2 entries into a 4x4 position with an \fbox around them:

enter image description here

\documentclass{article}

\usepackage{amsmath,multicol}% http://ctan.org/pkg/{amsmath,multicol}

\newcommand{\pl}{\phantom{\lambda_0}}
\makeatletter
\newcommand{\twotofour}[2][]{%
  \settowidth{\dimen@}{#1}%
  \ifdim\dimen@=\z@\settowidth{\dimen@}{#2}\fi%
  \makebox[0pt]{%
    \smash{\raisebox{.5\normalbaselineskip}{%
      \setlength{\fboxsep}{2\fboxsep}%
        \fbox{\makebox[\dimen@]{\vphantom{#1}#2}}}\hspace*{4\arraycolsep}}}}
\makeatother
\begin{document}

\begin{multicols}{2}
  \begin{enumerate}
    \item $\begin{Bmatrix}
        \pl & \pl & \pl & \pl \\
        & \twotofour{$J_1$} & & \twotofour[$J_1$]{0} \\
        & & & \\
        & \twotofour[$J_1$]{0} & & \twotofour{$J_2$} 
      \end{Bmatrix}$
    \item $\begin{Bmatrix}
        \lambda_0 & 1 & 0 & 0 \\
        0 & \lambda_0 & 1 & 0 \\
        0 & 0 & \lambda_0 & 0 \\
        0 & 0 & 0 & \lambda_1
      \end{Bmatrix}$ 
    \item $\begin{Bmatrix}
        \lambda_0 & 1 & 0 & 0 \\
        0 & \lambda_0 & 1 & 0 \\
        0 & 0 & \lambda_0 & 1 \\
        0 & 0 & 0 & \lambda_0
      \end{Bmatrix}$ 
    \item $\begin{Bmatrix}
        \alpha & \beta & 1 & 0 \\
        -\beta & \alpha & 0 & 1 \\
        0 & 0 & \alpha & \beta \\
        0 & 0 & -\beta & \alpha 
      \end{Bmatrix}$
  \end{enumerate}
\end{multicols}
\end{document}

Another option with horizontal/vertical rules, defaulting to array for creating the first Bmatrix:

enter image description here

\documentclass{article}
\usepackage{amsmath,multicol}% http://ctan.org/pkg/{amsmath,multicol}
\newcommand{\pl}{\phantom{\lambda_0}}
\makeatletter
\newcommand{\twotofour}[2][]{%
  \makebox[0pt]{%
    \smash{\raisebox{.5\normalbaselineskip}{%
      #2}\hspace*{4\arraycolsep}}}}
\makeatother
\begin{document}

\begin{multicols}{2}
  \begin{enumerate}
    \item $\left\{\begin{array}{@{}cc|cc@{}}
        \pl & \pl & \pl & \pl \\
        & \twotofour{$J_1$} & & \twotofour[$J_1$]{0} \\
        \hline
        & & & \\
        & \twotofour[$J_1$]{0} & & \twotofour{$J_2$} 
      \end{array}\right\}$
    \item $\begin{Bmatrix}
        \lambda_0 & 1 & 0 & 0 \\
        0 & \lambda_0 & 1 & 0 \\
        0 & 0 & \lambda_0 & 0 \\
        0 & 0 & 0 & \lambda_1
      \end{Bmatrix}$ 
    \item $\begin{Bmatrix}
        \lambda_0 & 1 & 0 & 0 \\
        0 & \lambda_0 & 1 & 0 \\
        0 & 0 & \lambda_0 & 1 \\
        0 & 0 & 0 & \lambda_0
      \end{Bmatrix}$ 
    \item $\begin{Bmatrix}
        \alpha & \beta & 1 & 0 \\
        -\beta & \alpha & 0 & 1 \\
        0 & 0 & \alpha & \beta \\
        0 & 0 & -\beta & \alpha 
      \end{Bmatrix}$
  \end{enumerate}
\end{multicols}
\end{document}
share|improve this answer
add comment

Here I use a TABstack. For the three normal sized ones, the syntax was interchangeable, except for putting the environment contents into the \braceMatrixstack argument. I did need to set up the horizontal intercolumn gap 2ex in advance.

For the large matrix, I just made the letters \LARGE which took care of the vertical requirement. I did need to add a little space to the left and right of the entries, and change the intercolumn gap.

\documentclass{article}
\usepackage{multicol}
\usepackage{tabstackengine}
\begin{document}
\begin{multicols}{2}
\begin{enumerate}
\setstacktabbedgap{3.3ex}
    \item $\LARGE\braceMatrixstack{
    ~J_1 & 0~ \\
    ~0 & J_2~ 
    }$
\setstacktabbedgap{2ex}
\setstackgap{L}{\baselineskip}
    \item $\braceMatrixstack{
        \lambda_0 & 1 & 0 & 0 \\
        0 & \lambda_0 & 1 & 0 \\
        0 & 0 & \lambda_0 & 0 \\
        0 & 0 & 0 & \lambda_1
        }$ 
    \item $\braceMatrixstack{
            \lambda_0 & 1 & 0 & 0 \\
            0 & \lambda_0 & 1 & 0 \\
            0 & 0 & \lambda_0 & 1 \\
            0 & 0 & 0 & \lambda_0
            }$ 
    \item $\braceMatrixstack{
            \alpha & \beta & 1 & 0 \\
            -\beta & \alpha & 0 & 1 \\
            0 & 0 & \alpha & \beta \\
            0 & 0 & -\beta & \alpha 
            }$
\end{enumerate}
\end{multicols}
\end{document}

enter image description here

share|improve this answer
add comment

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.