Skip to content

Commit 1a8fbcd

Browse files
committed
Use bmatrix when appropriate
1 parent aaef74b commit 1a8fbcd

2 files changed

Lines changed: 24 additions & 24 deletions

File tree

Slides/D4_LatexWorkshop.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -594,22 +594,22 @@ <h2>Arrays: Systems, Matrices, and Vectors</h2>
594594
<div class="fragment" data-fragment-index="4">
595595
<div class="cell">
596596
<div class="sourceCode cell-code" id="cb3"><pre class="sourceCode numberSource latex number-lines code-with-copy"><code class="sourceCode latex"><span id="cb3-1"><a href=""></a><span class="co">%Matrix</span></span>
597-
<span id="cb3-2"><a href=""></a><span class="ss">$</span><span class="sc">\left</span><span class="ss">[</span><span class="kw">\begin</span>{<span class="ex">array</span>}<span class="ss">{rrr} </span></span>
597+
<span id="cb3-2"><a href=""></a><span class="ss">$</span><span class="kw">\begin</span>{<span class="ex">bmatrix</span>}<span class="ss"> </span></span>
598598
<span id="cb3-3"><a href=""></a><span class="ss">2 &amp; 3 &amp; 8</span><span class="sc">\\</span><span class="ss"> </span></span>
599599
<span id="cb3-4"><a href=""></a><span class="ss">-4 &amp; 1 &amp; -2</span></span>
600-
<span id="cb3-5"><a href=""></a><span class="kw">\end</span>{<span class="ex">array</span>}<span class="sc">\right</span><span class="ss">]$</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
600+
<span id="cb3-5"><a href=""></a><span class="kw">\end</span>{<span class="ex">bmatrix</span>}<span class="ss">$</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
601601
</div>
602602
</div>
603603
<div class="fragment" data-fragment-index="5">
604604
<div class="cell">
605605
<div class="sourceCode cell-code" id="cb4"><pre class="sourceCode numberSource latex number-lines code-with-copy"><code class="sourceCode latex"><span id="cb4-1"><a href=""></a><span class="co">%Vector</span></span>
606-
<span id="cb4-2"><a href=""></a><span class="ss">$</span><span class="sc">\left</span><span class="ss">[</span><span class="kw">\begin</span>{<span class="ex">array</span>}<span class="ss">{r} 0</span><span class="sc">\\</span></span>
607-
<span id="cb4-3"><a href=""></a><span class="ss">0</span><span class="kw">\end</span>{<span class="ex">array</span>}<span class="sc">\right</span><span class="ss">]</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
606+
<span id="cb4-2"><a href=""></a><span class="ss">$</span><span class="kw">\begin</span>{<span class="ex">bmatrix</span>}<span class="ss"> 0</span><span class="sc">\\</span></span>
607+
<span id="cb4-3"><a href=""></a><span class="ss">0</span><span class="kw">\end</span>{<span class="ex">bmatrix</span>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
608608
</div>
609609
</div>
610610
</div><div class="column" style="width:50%;">
611611
<div class="fragment" data-fragment-index="2">
612-
<p>For example, the system <span class="math inline">\(\left\{\begin{array}{rcr} 2x_1 + 3x_2 + 8x_3 &amp; = &amp; 0\\ -4x_1 + x_2 - 2x_3 &amp; = &amp; 0\end{array}\right.\)</span> corresponds to the coefficient matrix <span class="math inline">\(\left[\begin{array}{rrr} 2 &amp; 3 &amp; 8\\ -4 &amp; 1 &amp; -2\end{array}\right]\)</span> and constant vector <span class="math inline">\(\left[\begin{array}{r} 0\\ 0\end{array}\right]\)</span>.</p>
612+
<p>For example, the system <span class="math inline">\(\left\{\begin{array}{rcr} 2x_1 + 3x_2 + 8x_3 &amp; = &amp; 0\\ -4x_1 + x_2 - 2x_3 &amp; = &amp; 0\end{array}\right.\)</span> corresponds to the coefficient matrix <span class="math inline">\(\begin{bmatrix} 2 &amp; 3 &amp; 8\\ -4 &amp; 1 &amp; -2\end{bmatrix}\)</span> and constant vector <span class="math inline">\(\begin{bmatrix} 0\\ 0\end{bmatrix}\)</span>.</p>
613613
</div>
614614
</div>
615615
</div>
@@ -632,15 +632,15 @@ <h2>Things to Note</h2>
632632
</div>
633633
<div class="cell">
634634
<div class="sourceCode cell-code" id="cb6"><pre class="sourceCode numberSource latex number-lines code-with-copy"><code class="sourceCode latex"><span id="cb6-1"><a href=""></a><span class="co">%Matrix</span></span>
635-
<span id="cb6-2"><a href=""></a><span class="ss">$</span><span class="sc">\left</span><span class="ss">[</span><span class="kw">\begin</span>{<span class="ex">array</span>}<span class="ss">{rrr} </span></span>
635+
<span id="cb6-2"><a href=""></a><span class="ss">$</span><span class="kw">\begin</span>{<span class="ex">bmatrix</span>}<span class="ss"> </span></span>
636636
<span id="cb6-3"><a href=""></a><span class="ss">2 &amp; 3 &amp; 8</span><span class="sc">\\</span><span class="ss"> </span></span>
637637
<span id="cb6-4"><a href=""></a><span class="ss">-4 &amp; 1 &amp; -2</span></span>
638-
<span id="cb6-5"><a href=""></a><span class="kw">\end</span>{<span class="ex">array</span>}<span class="sc">\right</span><span class="ss">]$</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
638+
<span id="cb6-5"><a href=""></a><span class="kw">\end</span>{<span class="ex">bmatrix</span>}<span class="ss">$</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
639639
</div>
640640
<div class="cell">
641641
<div class="sourceCode cell-code" id="cb7"><pre class="sourceCode numberSource latex number-lines code-with-copy"><code class="sourceCode latex"><span id="cb7-1"><a href=""></a><span class="co">%Vector</span></span>
642-
<span id="cb7-2"><a href=""></a><span class="ss">$</span><span class="sc">\left</span><span class="ss">[</span><span class="kw">\begin</span>{<span class="ex">array</span>}<span class="ss">{r} 0</span><span class="sc">\\</span></span>
643-
<span id="cb7-3"><a href=""></a><span class="ss">0</span><span class="kw">\end</span>{<span class="ex">array</span>}<span class="sc">\right</span><span class="ss">]</span></span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
642+
<span id="cb7-2"><a href=""></a><span class="ss">$</span><span class="kw">\begin</span>{<span class="ex">bmatrix</span>}<span class="ss"> 0</span><span class="sc">\\</span></span>
643+
<span id="cb7-3"><a href=""></a><span class="ss">0</span><span class="kw">\end</span>{<span class="ex">bmatrix</span>}</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
644644
</div>
645645
</div><div class="column" style="width:50%;">
646646
<ul>
@@ -650,10 +650,10 @@ <h2>Things to Note</h2>
650650
</div>
651651
</div>
652652
<ul>
653-
<li class="fragment"><p>The array environment allows you to construct aligned columns.</p>
653+
<li class="fragment"><p>The <code>array</code> or <code>bmatrix</code> environments allow you to construct aligned columns.</p>
654654
<ul>
655-
<li class="fragment">The number of columns is determined by the number of characters in the curly braces after <code>\begin{array}</code>.</li>
656-
<li class="fragment">The <code>r</code> character indicates that a column should be <em>right</em>-aligned, while the <code>c</code> and <code>l</code> characters indicated <em>center</em>- and <em>left</em>-alignment, respectively.</li>
655+
<li class="fragment">For an <code>array</code>, the number of columns is determined by the number of characters in the curly braces after <code>\begin{array}</code>.</li>
656+
<li class="fragment">The <code>r</code> character indicates that a column should be <em>right</em>-aligned, while the <code>c</code> and <code>l</code> characters indicate <em>center</em>- and <em>left</em>-alignment, respectively.</li>
657657
<li class="fragment">Columns in an array are separated by the ampersand (<code>&amp;</code>).</li>
658658
<li class="fragment">Rows in an array are separated using the double backslash (<code>\\</code>)</li>
659659
</ul></li>

Slides/D4_LatexWorkshop.qmd

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -300,10 +300,10 @@ $\left\{\begin{array}{rcr}
300300
#| eval: false
301301
302302
%Matrix
303-
$\left[\begin{array}{rrr}
303+
$\begin{bmatrix}
304304
2 & 3 & 8\\
305305
-4 & 1 & -2
306-
\end{array}\right]$
306+
\end{bmatrix}$
307307
```
308308

309309
:::
@@ -315,8 +315,8 @@ $\left[\begin{array}{rrr}
315315
#| eval: false
316316
317317
%Vector
318-
$\left[\begin{array}{r} 0\\
319-
0\end{array}\right]
318+
$\begin{bmatrix} 0\\
319+
0\end{bmatrix}
320320
```
321321

322322
:::
@@ -327,7 +327,7 @@ $\left[\begin{array}{r} 0\\
327327

328328
:::{.fragment data-fragment-index=2}
329329

330-
For example, the system $\left\{\begin{array}{rcr} 2x_1 + 3x_2 + 8x_3 & = & 0\\ -4x_1 + x_2 - 2x_3 & = & 0\end{array}\right.$ corresponds to the coefficient matrix $\left[\begin{array}{rrr} 2 & 3 & 8\\ -4 & 1 & -2\end{array}\right]$ and constant vector $\left[\begin{array}{r} 0\\ 0\end{array}\right]$.
330+
For example, the system $\left\{\begin{array}{rcr} 2x_1 + 3x_2 + 8x_3 & = & 0\\ -4x_1 + x_2 - 2x_3 & = & 0\end{array}\right.$ corresponds to the coefficient matrix $\begin{bmatrix} 2 & 3 & 8\\ -4 & 1 & -2\end{bmatrix}$ and constant vector $\begin{bmatrix} 0\\ 0\end{bmatrix}$.
331331

332332
:::
333333

@@ -367,19 +367,19 @@ $\left\{\begin{array}{rcr}
367367
#| eval: false
368368
369369
%Matrix
370-
$\left[\begin{array}{rrr}
370+
$\begin{bmatrix}
371371
2 & 3 & 8\\
372372
-4 & 1 & -2
373-
\end{array}\right]$
373+
\end{bmatrix}$
374374
```
375375

376376
```{latex}
377377
#| echo: true
378378
#| eval: false
379379
380380
%Vector
381-
$\left[\begin{array}{r} 0\\
382-
0\end{array}\right]
381+
$\begin{bmatrix} 0\\
382+
0\end{bmatrix}
383383
```
384384

385385
:::
@@ -393,10 +393,10 @@ $\left[\begin{array}{r} 0\\
393393

394394
::::
395395

396-
+ The array environment allows you to construct aligned columns.
396+
+ The `array` or `bmatrix` environments allow you to construct aligned columns.
397397

398-
+ The number of columns is determined by the number of characters in the curly braces after `\begin{array}`.
399-
+ The `r` character indicates that a column should be *right*-aligned, while the `c` and `l` characters indicated *center*- and *left*-alignment, respectively.
398+
+ For an `array`, the number of columns is determined by the number of characters in the curly braces after `\begin{array}`.
399+
+ The `r` character indicates that a column should be *right*-aligned, while the `c` and `l` characters indicate *center*- and *left*-alignment, respectively.
400400
+ Columns in an array are separated by the ampersand (`&`).
401401
+ Rows in an array are separated using the double backslash (`\\`)
402402

0 commit comments

Comments
 (0)