Math & ScienceMatrix with inclined dashed line and big 0

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
BastienBastien
Posts: 40
Joined: Mon Aug 20, 2012 2:27 pm

Matrix with inclined dashed line and big 0

Post by BastienBastien »

Hi,

I need to make some Matrixes.
I can do simple matrix without any problem.
But, I failed at drawing an inclined, oblique dashed line in a matrix.
\ddots is not a good solution in my case.

On the following matrix, you can see that the dash line goes from the a_{2,1} (second line, first column) element, to the a_{n,n-1} element. This is what I want.
1.png
1.png (12.61 KiB) Viewed 9024 times
But on the below matrix, because the size of the two bigs '0' is higher, there is a shift between the dashed line and the "destination" '1' element.
2.png
2.png (9.25 KiB) Viewed 9024 times
First question : do you think it would be better to draw these bigs '0' by using Tikz ? If yes, how could I do it ?

Second question : do you know how to draw the dash line in a right way, without shift ? By using Tikz ? If yes, how could I do it ?

With best regards,
BastienBastien

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10340
Joined: Mon Mar 10, 2008 9:44 pm

Matrix with inclined dashed line and big 0

Post by Stefan Kottwitz »

What is your current code for this matrix?

You could use the blkarray package. Sure, TikZ can be used to draw more freely. I would just check out blkarray and bigdelim before. Also, it could be easier sometimes to use \raisebox for small tweaks.

Stefan
LaTeX.org admin
BastienBastien
Posts: 40
Joined: Mon Aug 20, 2012 2:27 pm

Matrix with inclined dashed line and big 0

Post by BastienBastien »

Hello,

Thanks for your answer.
I had a look on the packages you told me but I am not quite this could help.
Here is the code I did :
2.png
2.png (47.58 KiB) Viewed 8995 times
1.png
1.png (64.02 KiB) Viewed 6633 times
Thanks !!!!
BastienBastien
User avatar
Stefan Kottwitz
Site Admin
Posts: 10340
Joined: Mon Mar 10, 2008 9:44 pm

Re: Matrix with inclined dashed line and big 0

Post by Stefan Kottwitz »

It would be better if you would post your code as text, copy&paste. There's a code button above the edit field for automatic markup. We cannot copy code from images without typing every line, so I guess nobody tests long code from screenshots.

Stefan
LaTeX.org admin
BastienBastien
Posts: 40
Joined: Mon Aug 20, 2012 2:27 pm

Matrix with inclined dashed line and big 0

Post by BastienBastien »

Hello,

Here is the preambule :

Code: Select all

\documentclass[10pt,a4paper,final]{report} 
\usepackage[utf8]{inputenc} 
\usepackage[francais]{babel} 
\usepackage[T1]{fontenc} 
\usepackage{amsmath} 
\usepackage{amssymb} 
\usepackage[]{hyperref}
\usepackage{moreverb}l'indentation) 
\usepackage{marvosym}
\usepackage{schemabloc}
\usepackage{steinmetz}
\usepackage{color} 
\usepackage{fancyhdr} 
\usepackage[squaren, Gray, cdot]{SIunits}
\usepackage{mathtools,mathrsfs} 
 
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} 
 
\begin{document}


Then the Matrix's code :

Code: Select all

$ \dot{x} = 
\begin{bmatrix} 
-a_1		& 	-a_2			&	\cdots	&\cdots				& -a_n\\ 
1			&       			&			&  					& 0\\ 
0			&       \ddots		&			&\text{\huge{0}}	& \vdots\\ 
\vdots		&       \text{\huge{0}}		&	\ddots	&		 			& \vdots\\ 
0  			& 		\cdots		&	0		&	1	 			& 0\\ 
\end{bmatrix} 
x+ 
\begin{bmatrix} 
1		\\ 
0		\\ 
\vdots	\\ 
\vdots	\\ 
0 	\\ 
\end{bmatrix} 
u$\\ \\ 
 
$ y = 
\begin{bmatrix} 
b_1	& 	b_2	&	\cdots	& \cdots	& b_n\\ 
\end{bmatrix} 
x+ 
\begin{bmatrix} 
0		\\ 
\end{bmatrix} 
u$\\

\end{document}
Thanks !
BastienBastien
Last edited by cgnieder on Fri Nov 16, 2012 1:14 pm, edited 1 time in total.
BastienBastien
Posts: 40
Joined: Mon Aug 20, 2012 2:27 pm

Re: Matrix with inclined dashed line and big 0

Post by BastienBastien »

Hello dear LaTeX2e users !

No idea ?
Do not waste your time, but if one of you has an idea, a path which I could follow, investigate, or some keywords, it would be great.

Regards,
Enjoy sunday evening before going back to work... !
Post Reply