Hello
How to write a LaTeX code to generate the matrix shown in the following image?
Regards
Math & Science ⇒ How to write a code for this ?
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to write a code for this ?
My first idea was to do this without any additional package.
But perhaps there is a more elegant solution.
Best regards
Thorsten
Code: Select all
\[
% \renewcommand{\arraystretch}{1.2}
\left[
\begin{array}{ccc}
A_{11} & \multicolumn{1}{c|}{A_{12}} & 0 \\ \cline{2-3}
A_{21} & \multicolumn{1}{|c|}{A_{22}} & A_{23} \\ \cline{1-2}
0 & \multicolumn{1}{|c}{A_{32}} & A_{33}
\end{array}
\right]
\]
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
How to write a code for this ?
Thanks for the response,
but your code doesn't produce the required result, it produces this: Nevertheless, using the same idea, a valid code is:
Thanks !
but it doesn't look elegant as you said.
but your code doesn't produce the required result, it produces this: Nevertheless, using the same idea, a valid code is:
Code: Select all
\[
\left[
\begin{array}{ccc}
A_{11} & \multicolumn{1}{c|}{A_{12}} & 0 \\ \cline{2-3}
A_{21} & \multicolumn{1}{|c|}{A_{22}} & 0 \\ \cline{1-2}
0 & \multicolumn{1}{|c}{A_{32}} & A_{33}
\end{array}
\right]
\]
but it doesn't look elegant as you said.
Last edited by M.A on Sat Sep 05, 2009 3:27 pm, edited 1 time in total.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
How to write a code for this ?
I corrected my code while you were answering. But you are right. Initially I forgot two vertical lines and did a copy & paste error. My sample code was only meant to be a basic structure you could build upon. Perhaps you will find more ideas in the "[url=http://ctan.org&pkg/voss-mathmode]Math mode[/url]" document.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: How to write a code for this ?
Thanks for the math mode document, it is a comprehensive reference.
Regards,
M.A
Regards,
M.A