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 try to do this:

](http://www7.pic-upload.de/19.12.13/547iej1463a4.jpg)

How to do that? Can you help me?

Here is my code for the matrix without the lines:

\left [
\begin{matrix}
    r_{11} & r_{12} & \dots & r_{1i} & r_{1,i+1} & \dots & r_{1n} & c_1\\
    \lambda_{21} & r_{22} & \dots & r_{2i} & r_{2,i+1} & \dots & r_{2n} & c_2\\
    \lambda_{31} & \lambda_{32} & & r_{3i} & r_{3,i+1} & \dots & r_{3n} & c_3\\
    \vdots & \vdots & \ddots & \vdots & \vdots & & \vdots & \vdots \\
    \lambda_{i1} & \lambda_{i2} & & r_{ii} & r_{i,i+1} & \dots & r_{in} & c_i\\
    \lambda_{i+1,1} & \lambda_{1+2,2} & & \lambda_{i+1,i} & a_{i+1,i+1}^{(i)} & \dots & a_{i+1,n}^{(i)} & b_{i+1}^{(i)}\\
    \vdots & \vdots & & \vdots & \vdots & & \vdots & \vdots \\
    \lambda_{n,1} & \lambda_{n,2} & \dots & \lambda_{n,i} & a_{n,i+1}^{(i)} & \dots & a_{n,n}^{(i)} & b_n^{(i)}\\
\end{matrix}
\right ]

Thank you so much.

share|improve this question
1  
Can you at least provide the code for the matrix without the lines? –  egreg Dec 19 '13 at 22:14
    
sure i can, i will edit the code –  texNewFag Dec 19 '13 at 22:14
add comment

1 Answer

up vote 6 down vote accepted

With array it is easy:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\[
\left [
%\begin{matrix}
\begin{array}{*7{c}|c}
    r_{11} & r_{12} & \dots & r_{1i} & r_{1,i+1} & \dots & r_{1n} & c_1\\
\cline{1-1}
   \multicolumn{1}{c|}{ \lambda_{21}} & r_{22} & \dots & r_{2i} & r_{2,i+1} & \dots & r_{2n} & c_2\\
\cline{2-2}
    \lambda_{31} &    \multicolumn{1}{c|}{\lambda_{32}} & & r_{3i} & r_{3,i+1} & \dots & r_{3n} & c_3\\
    \vdots & \vdots & \ddots & \vdots & \vdots & & \vdots & \vdots \\
    \lambda_{i1} & \lambda_{i2} & &  \multicolumn{1}{|c}{r_{ii}} & r_{i,i+1} & \dots & r_{in} & c_i\\
\cline{4-8}
    \lambda_{i+1,1} & \lambda_{1+2,2} & & \lambda_{i+1,i} & a_{i+1,i+1}^{(i)} & \dots & a_{i+1,n}^{(i)} & b_{i+1}^{(i)}\\
    \vdots & \vdots & & \vdots & \vdots & & \vdots & \vdots \\
    \lambda_{n,1} & \lambda_{n,2} & \dots & \lambda_{n,i} & a_{n,i+1}^{(i)} & \dots & a_{n,n}^{(i)} & b_n^{(i)}\\
%\end{matrix}
\end{array}
\right ]
\]

\end{document}

enter image description here

Some additional vertical correction would be useful.

Edit: It is the logic of probable meaning of the step line, but egreg's suggestion of logic of producing columns is a good alternative.

share|improve this answer
    
I'd use \multicolumn{1}{c|}{} in the empty cell, rather than \multicolumn{1}{|c}{r_{ii}}; the rules should always go at the end of a column specifier (except for the first column). Adding \rule{0pt}{3ex} in the cell after \cline{4-8} will make some more room for the high exponents in the row. –  egreg Dec 19 '13 at 22:55
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.