Of course it's a little bit hard without any code, but consider the matrix:
Code: Select all
1 2 2 2 2 2
2 1 2 2 2 2
2 2 1 2 2 2
2 2 2 1 2 2
2 2 2 2 1 2
2 2 2 2 2 1
Anyone have any ideas?
Code: Select all
1 2 2 2 2 2
2 1 2 2 2 2
2 2 1 2 2 2
2 2 2 1 2 2
2 2 2 2 1 2
2 2 2 2 2 1
Code: Select all
\documentclass[a4paper,10pt]{article}
\begin{document}
\[
\left(
\begin{array}{cccccc}
1 & \\
& 1 & & & \mbox{\Huge $2$}\\
& & 1 & \\
& & & 1 & \\
& \mbox{\Huge $2$} & & & 1 \\
& & & & & 1
\end{array}
\right)
\]
\end{document}
Code: Select all
\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{multirow}
\begin{document}
\[
\begin{pmatrix}
1 & & & & \multirow{3}{*}{\Huge 2} & \\
& 1 & & & & \\
& & 1 & & & \\
& \multirow{3}{*}{\Huge 2} & & 1 & & \\
& & & & 1 & \\
& & & & & 1
\end{pmatrix}
\]
\end{document}
Code: Select all
\usepackage{calc}
\usepackage{ifthen}
%
\newcounter{rownumber}
\newcounter{columnnumber}
% Filldiagonal{diagonalvalue}{other value}{element counter}{row size}
%check if diagonal, puts as diagonalvalue, otherwise other value
\newcommand{\filldiagonal}[4]{%
%
% Much easier to think of the rows and columns starting at 0,
%then the modulus gives column number, integer divison gives row number
%
\setcounter{rownumber}{\value{#3}/#4}%
\setcounter{columnnumber}{\value{#3}-\value{rownumber}*#4}%
\ifthenelse{\value{columnnumber}=\value{rownumber}}{#1}{#2}%
\stepcounter{#3}%
%
}
Code: Select all
\newcounter{eleme}
\setcounter{eleme}{0}
\begin{array}{cccccccccc}
\filldiagonal{1}{2}{eleme}{10} & ... & \filldiagonal{1}{2}{eleme}{10}\\
\filldiagonal{1}{2}{eleme}{10} & ... & \filldiagonal{1}{2}{eleme}{10}\\
...
\filldiagonal{1}{2}{eleme}{10} } & ... & \filldiagonal{1}{2}{eleme}{10}\\
\end{array}
Code: Select all
\documentclass[11pt]{memoir}
\usepackage{ifthen}
\usepackage{forloop}
\newcommand{\filldiagonal}[5]{
\ifthenelse{#3=#4}{#1}{#2}%
\ifthenelse{#4<#5}{ & }{\\}%
}
\begin{document}
\newcounter{rownumber}
\newcounter{columnnumber}
$$\begin{array}{cccccccccc}
\forLoop{1}{10}{rownumber}{%
\forLoop{1}{10}{columnnumber}{%
\filldiagonal{1}{2}{\value{rownumber}}{\value{columnnumber}}{10}%
}%
}\end{array}$$
\end{document}
Code: Select all
\documentclass[11pt]{memoir}
\usepackage{ifthen}
\usepackage{forloop}
\newcommand{\filldiagonal}[5]{
\ifthenelse{#3=#4}{#1}{#2}%
\ifthenelse{#4<#5}{ & }{\\}%
}
\begin{document}
\newcounter{rownumber}
\newcounter{columnnumber}
$$\begin{array}{cccccccccc}
\forLoop{1}{10}{rownumber}{%
\forLoop{1}{10}{columnnumber}{%
\ifthenelse{\value{rownumber} = \value{columnumber}}{1}{2}%
\ifthenelse{\value{columnnumber}<10}{\\}{&}%
}
}
\end{array}$$
\end{document}
I think the \multirow command is having problems running in my math environment.localghost wrote:An alternative to Stefan's approach.For more information refer to the manuals of the used packages.Code: Select all
\documentclass[11pt,a4paper]{article} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{multirow} \begin{document} \[ \begin{pmatrix} 1 & & & & \multirow{3}{*}{\Huge 2} & \\ & 1 & & & & \\ & & 1 & & & \\ & \multirow{3}{*}{\Huge 2} & & 1 & & \\ & & & & 1 & \\ & & & & & 1 \end{pmatrix} \] \end{document}
The »Math mode« document might give some more useful hints to handle that. Stefan already mentioned a package from the easy bundle which provides several packages for mathematical expressions.
Code: Select all
\documentclass[twoside,12pt,openright]{report}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{array}
\usepackage{multirow}
\begin{equation}
\text{adj}({\bf A}^T \! {\bf A})_{k,k}= \left|
\begin{bmatrix}
u^1_a & ... & u^m_a \\
u^1_b & ... & u^m_b \\
\lambda & ... & \lambda
\end{bmatrix}
\begin{bmatrix}
\multirow{2}{*}{\large {\bf R}_r} & u^m_a \\
& u^m_b \\
0^T & \lambda
\end{bmatrix} \right|
\end{equation}
\end{document}
You are wrong. Obviously you haven't tested my example. Otherwise you would have found out that it's working fine. The only thing that doesn't work is your way of choosing font styles for boldface in math mode.mdk31 wrote:I think the \multirow command is having problems running in my math environment. [...] I'm getting errors like "Missing $ inserted" or "Missing } inserted" which I think is because of the \multirow in the equation environment.
Code: Select all
\begin{equation}
\text{adj}({\bf A}^T \! {\bf A})_{k,k}= \left|
\begin{bmatrix}
u^1_a & ... & u^m_a \\
u^1_b & ... & u^m_b \\
\lambda & ... & \lambda
\end{bmatrix}
\begin{bmatrix}
\multirow{2}{*}{\large \mathbf{R}_k} & u^m_a \\
& u^m_b \\
0^T & \lambda
\end{bmatrix} \right|
\end{equation}
\end{document}
Code: Select all
\documentclass[twoside,12pt,openright]{report}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{array}
\usepackage{multirow}
\setlength{\extrarowheight}{0.4cm}
\newcommand{\vectornorm}[1]{\left|\left|\mathbf{#1}\right|\right|}
\newcommand{\mb}[1]{\mathbf{#1}}
\begin{document}
\begin{equation}
\text{adj}(\mb{A}^T \! \mb{A})_{k,k}= \left|
\begin{bmatrix}
\multirow{2}{*}{$\mb{R}_k$} & u^m_a \\
& u^m_b \\
0^T & \lambda
\end{bmatrix}
\begin{bmatrix}
\multirow{2}{*}{$\mb{R}^T_k$} & & 0 \\
u^m_a & u^m_b & \lambda \\
\end{bmatrix}\right|
\end{equation}
\end{document}