1

I'm trying to figure out how to replicate this step in a Gaussian Elimination problem (which I'm pretty sure was created with LaTeX) in my web editor with KaTeX support. KaTeX unfortunately doesn't support importing packages.

enter image description here

The closest I've been able to get is this:

enter image description here

\rightarrow 
\begin{aligned}
\begin{vmatrix} 
a && && &- &d &= &7 \\ 
& &b && &+ &d &= &9 \\ 
&& &&c &+ &d &= &4 \\ 
& && &c &+ &d &= &4
\end{vmatrix} 

\begin{matrix} 
E_1 - E_2 \rightarrow E_1 \\ \\ 
E_3 + E_2 \rightarrow E_3 \\ 
\end{matrix}
\end{aligned}

The primary issue I see in this rendering is that the matrix lines aren't aligned with the proper equations in the vmatrix. Does anyone know how I can get my work to more closely line up with the example image above?

1
  • aligned and vmatrix aren't defined in LaTeX. They are in the AMS packages, however. You also aren't allowed the blank line in a display environment.
    – Teepeemm
    Nov 2, 2020 at 2:24

3 Answers 3

1

I believe the display environments are based on the array environment, so you can simply use that. The only main downside is now you need to count your columns. To get better vertical alignment, you can insert some convenient ~.

\documentclass{article}
\begin{document}
\[
\rightarrow
\left|
\begin{array}{ccccccc}
a&&&-&d&=&7\\
&b&&+&d&=&9\\
&&c&+&d&=&4\\
&&c&+&d&=&4\\
\end{array}
\right|
~
\begin{array}{c}
E_1 - E_2 \rightarrow E_1 \\
~\\
E_3 + E_2 \rightarrow E_3 \\
~
\end{array}
\]
\end{document}

code output

3
  • Ah gotcha! The tilda is the null character I wanted... Thanks!
    – ifconfig
    Nov 2, 2020 at 4:06
  • 1
    @ifconfig ~ is not a null character. It is a non breaking space. In math mode, you can try other space macros: \quad, \,, \:, \; or \ ... The null character may be \null. Nov 2, 2020 at 15:31
  • Ah, I stand corrected! Understood, thanks!
    – ifconfig
    Nov 2, 2020 at 17:30
1

It is very simple with the systeme package:

\documentclass{article}
\usepackage{amsmath}
\usepackage{systeme}

\begin{document}

\sysdelim{\lvert\;}{\rvert}
\systeme{a-d = 7\;,
 b + d = 9,%
  c + d = 4 ,%@
  c + d = 4}
\sysdelim . .
\hskip-1em
\systeme{E_1-E_2\to E_1, ,E_3 + E_2\to E_3,}

\end{document} 

enter image description here

3
  • Unfortunately, my editor doesn't allow me to import packages. It renders using the KaTeX javascript library.
    – ifconfig
    Oct 3, 2020 at 0:45
  • This package is beautiful but I my two French words are not enough for me to go through the manual :)
    – Diaa
    Oct 3, 2020 at 1:17
  • @Bernard Do you know a way of doing this without external packages?
    – ifconfig
    Oct 3, 2020 at 3:32
0

The result is quite poor and no match for a real solution with better methods such as systeme.

\begin{array}{|ccccccc|l}
a & & & - & d & = & 7 &
  \scriptstyle E_1-E_2\to E_1 \\
& b & & + & d & = & 9 \\
& & c & + & d & = & 4 &
  \scriptstyle E_3+E_2\to E_3 \\
& & c & + & d & = & 4
\end{array}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .