Math & ScienceBeginner and matrices

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
moijk
Posts: 5
Joined: Thu Jan 14, 2010 9:21 pm

Beginner and matrices

Post by moijk »

I'm on my first day of LaTeX-use I asked the prof about it (Learned by the professor in front of the class that its pronounced "LaTek", not to be confused by the kinky stuff.) - anyway, what I'm trying to make is the same way to illustrate row change as we do in the math like this:
matrix.jpg
matrix.jpg (6.64 KiB) Viewed 3542 times
How can I make that arrow? the lenght have to be adjusted depending on the row and direction, plus indicate when action is performed towards it.

the way they have used in the tex examples are just by writing it in text, but I'd like to do it if it is possible. Hopefully something that can be written into a macro.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Beginner and matrices

Post by localghost »

I think the gauss package is the right one for this job. Perhaps the tkz-linknodes package (based on pgf) can also help.

Please upload attachments to the forum server next time. External links can get lost with time and make the problem incomprehensible.


Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
moijk
Posts: 5
Joined: Thu Jan 14, 2010 9:21 pm

Beginner and matrices

Post by moijk »

localghost wrote:I think the gauss package is the right one for this job. Perhaps the tkz-linknodes package (based on pgf) can also help.

Please upload attachments to the forum server next time. External links can get lost with time and make the problem incomprehensible.

Best regards and welcome to the board
Thorsten
Amazing - the 'gauss' package looks perfect. The only but is that it uses () and not [], I guess I can dig through the package to find out how to change that. But if you or anyone else got an idea on how to do it feel free to assist. Might not be needed, I'd just like to make it look perfectly like I want to.

Secondly, thanks for the upload-note. I'm just used to boards not allowing uploads. I'll do that from now on.
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Beginner and matrices

Post by localghost »

Section 1.1 of the gauss manual mentions an optional parameter for the delimiter type of the gmatrix environment. The allowed parameters are the same as introduced similarly in the amsmath manual (b, B, p, v, V) for the matrix environment. So I just chose »b« and got the desired result.

Code: Select all

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{gauss}

\begin{document}
  \begin{equation}
    \begin{gmatrix}[b]
      1 & 2 & 3 & 4 \\
      5 & 6 & 7 & 8 \\
      9 & 10 & 11 & 12 \\
      13 & 14 & 15 & 16
      \rowops
        \swap{0}{3}
    \end{gmatrix}
  \end{equation}
\end{document}
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
moijk
Posts: 5
Joined: Thu Jan 14, 2010 9:21 pm

Beginner and matrices

Post by moijk »

localghost wrote:Section 1.1 of the gauss manual mentions an optional parameter for the delimiter type of the gmatrix environment.
I felt I've read through the manual, but I apparently haven't.

Thank you. As someone who just dove into the language and tries to find his way through it, I highly appreciate both the package digging and manual-help. So a big thank you to both. :)
magicmoose
Posts: 90
Joined: Fri Nov 06, 2009 7:29 am

Beginner and matrices

Post by magicmoose »

moijk wrote:As someone who just dove into the language and tries to find his way through it, I highly appriciate both the package digging and manual-help. So a big thank you to both. :)
Pretty much all the packages have excellent documentation/manuals, and they're easy to find, either go to www.ctan.org/okg/«name of package» or open up command prompt/terminal and type "texdoc «name of package»"
Post Reply