LaTeX forum ⇒ Math & ScienceMatrix with inclined dashed line and big 0

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

Matrix with inclined dashed line and big 0

Postby BastienBastien » Sun Nov 11, 2012 4:17 pm

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 4555 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 4555 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

Tags:

User avatar
Stefan Kottwitz
Site Admin
Posts: 9194
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Sun Nov 11, 2012 6:24 pm

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
Site admin

BastienBastien
Posts: 40
Joined: Mon Aug 20, 2012 2:27 pm

Postby BastienBastien » Wed Nov 14, 2012 11:13 am

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 4526 times


1.png
1.png (64.02 KiB) Viewed 2164 times


Thanks !!!!
BastienBastien

User avatar
Stefan Kottwitz
Site Admin
Posts: 9194
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Nov 14, 2012 11:22 am

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
Site admin

BastienBastien
Posts: 40
Joined: Mon Aug 20, 2012 2:27 pm

Postby BastienBastien » Fri Nov 16, 2012 10:01 am

Hello,

Here is the preambule :

  1. \documentclass[10pt,a4paper,final]{report}
  2. \usepackage[utf8]{inputenc}
  3. \usepackage[francais]{babel}
  4. \usepackage[T1]{fontenc}
  5. \usepackage{amsmath}
  6. \usepackage{amssymb}
  7. \usepackage[]{hyperref}
  8. \usepackage{moreverb}l'indentation)
  9. \usepackage{marvosym}
  10. \usepackage{schemabloc}
  11. \usepackage{steinmetz}
  12. \usepackage{color}
  13. \usepackage{fancyhdr}
  14. \usepackage[squaren, Gray, cdot]{SIunits}
  15. \usepackage{mathtools,mathrsfs}
  16.  
  17. \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
  18.  
  19. \begin{document}


Then the Matrix's code :

  1. $ \dot{x} =
  2. \begin{bmatrix}
  3. -a_1 & -a_2 & \cdots &\cdots & -a_n\\
  4. 1 & & & & 0\\
  5. 0 & \ddots & &\text{\huge{0}} & \vdots\\
  6. \vdots & \text{\huge{0}} & \ddots & & \vdots\\
  7. 0 & \cdots & 0 & 1 & 0\\
  8. \end{bmatrix}
  9. x+
  10. \begin{bmatrix}
  11. 1 \\
  12. 0 \\
  13. \vdots \\
  14. \vdots \\
  15. 0 \\
  16. \end{bmatrix}
  17. u$\\ \\
  18.  
  19. $ y =
  20. \begin{bmatrix}
  21. b_1 & b_2 & \cdots & \cdots & b_n\\
  22. \end{bmatrix}
  23. x+
  24. \begin{bmatrix}
  25. 0 \\
  26. \end{bmatrix}
  27. u$\\
  28.  
  29. \end{document}


Thanks !
BastienBastien
Last edited by cgnieder on Fri Nov 16, 2012 1:14 pm, edited 1 time in total.
Reason: added code markup

BastienBastien
Posts: 40
Joined: Mon Aug 20, 2012 2:27 pm

Postby BastienBastien » Sun Nov 25, 2012 4:40 pm

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... !


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 8 guests