Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/quickbuild_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def main():
xml_ids = []
for f in changed_files:
if Path("source", b) in f.parents and f.suffix == ".ptx":
root = etree.parse(f).getroot()
parser=etree.XMLParser(recover=True)
root = etree.parse(f,parser=parser).getroot()
Comment on lines +33 to +34
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StevenClontz This fixes the error being thrown by duplicate xmlids. The error was because the xml was being parsed strictly here before pretext was involved. Please review for any unintended consequences of this change

if root.tag in ["section", "chapter", "preface", "appendix", "frontmatter"]:
xml_id = root.get(r"{http://www.w3.org/XML/1998/namespace}id")
xml_ids.append({
Expand Down
126 changes: 121 additions & 5 deletions source/linear-algebra/source/01-LE/01.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ is a collection of one or more linear equations.
When variables in a large linear system are missing, we prefer to
write the system in one of the following standard forms:<idx><h>standard</h><h>form of a linear system</h></idx>
</p>
<sidebyside widths="33% 33% 33%" margins="auto" valign="middle">
<sidebyside widths="33% 33% 33%" margins="auto" valign="middle" component="html">
<p>
Original linear system:
<md alignment="alignat" alignat-columns="2">
Expand Down Expand Up @@ -386,6 +386,52 @@ is a collection of one or more linear equations.
</md>
</p>
</sidebyside>
<sidebyside widths="45%" margins="auto" valign="middle" component="print">
<p>
Original linear system:
<md alignment="alignat" alignat-columns="2">
<mrow>
x_1 + 3x_3 &amp;\,=\,&amp; 3
</mrow>
<mrow>
3x_1 - 2x_2 + 4x_3 &amp;\,=\,&amp; 0
</mrow>
<mrow>
-x_2 + x_3 &amp;\,=\,&amp; -2
</mrow>
</md>
</p>
</sidebyside>
<sidebyside widths="45% 45%" margins="auto" valign="middle" component="print">
<p>
Verbose standard form:
<md alignment="alignat" alignat-columns="4">
<mrow>
1x_1 &amp;\,+\,&amp; 0x_2 &amp;\,+\,&amp; 3x_3 &amp;\,=\,&amp; 3
</mrow>
<mrow>
3x_1 &amp;\,-\,&amp; 2x_2 &amp;\,+\,&amp; 4x_3 &amp;\,=\,&amp; 0
</mrow>
<mrow>
0x_1 &amp;\,-\,&amp; 1x_2 &amp;\,+\,&amp; 1x_3 &amp;\,=\,&amp; -2
</mrow>
</md>
</p>
<p>
Concise standard form:
<md alignment="alignat" alignat-columns="4">
<mrow>
x_1 &amp; &amp; &amp;\,+\,&amp; 3x_3 &amp;\,=\,&amp; 3
</mrow>
<mrow>
3x_1 &amp;\,-\,&amp; 2x_2 &amp;\,+\,&amp; 4x_3 &amp;\,=\,&amp; 0
</mrow>
<mrow>
&amp;\,-\,&amp; x_2 &amp;\,+\,&amp; x_3 &amp;\,=\,&amp; -2
</mrow>
</md>
</p>
</sidebyside>
</remark>

<remark>
Expand Down Expand Up @@ -456,7 +502,15 @@ system). Otherwise it is <term>inconsistent</term>.<idx><h>inconsistent linear s

<figure xml:id="figure-intersecting-planes-one">
<caption>Intersection of three planes at one point</caption>
<image xml:id="LE1-image-intersection-planes-one">
<image xml:id="LE1-image-intersection-planes-one" width="50%" component="print">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-one.sage" parse="text"/>
</sageplot>
<description>
<p>Three planes are shown to intersect at a single point. An arrow points to the point of intersection at coordinates <m>(1,2,3)</m>.</p>
</description>
</image>
<image xml:id="LE1-image-intersection-planes-one" component="html">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-one.sage" parse="text"/>
</sageplot>
Expand All @@ -468,7 +522,15 @@ system). Otherwise it is <term>inconsistent</term>.<idx><h>inconsistent linear s

<figure xml:id="figure-intersecting-planes-inf">
<caption>Intersection of three planes at a line</caption>
<image xml:id="LE1-image-intersection-planes-inf">
<image xml:id="LE1-image-intersection-planes-inf" width="50%" component="print">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-inf.sage" parse="text"/>
</sageplot>
<description>
<p>Three planes are shown to intersect along a line of points.</p>
</description>
</image>
<image xml:id="LE1-image-intersection-planes-inf" component="html">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-inf.sage" parse="text"/>
</sageplot>
Expand All @@ -480,7 +542,15 @@ system). Otherwise it is <term>inconsistent</term>.<idx><h>inconsistent linear s

<figure xml:id="figure-intersecting-planes-zero">
<caption>Three non-mutually-intersecting planes</caption>
<image xml:id="LE1-image-intersection-planes-zero">
<image xml:id="LE1-image-intersection-planes-zero" width="50%" component="print">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-zero.sage" parse="text"/>
</sageplot>
<description>
<p>Three planes are shown to intersect at no common point, although each pair of planes intersects along a line of points.</p>
</description>
</image>
<image xml:id="LE1-image-intersection-planes-zero" component="html">
<sageplot variant="3d" aspect="1.0">
<xi:include href="./sage/LE1-image-intersection-planes-zero.sage" parse="text"/>
</sageplot>
Expand Down Expand Up @@ -704,7 +774,7 @@ Then use these to describe the solution set
The only important information in a linear system are its coefficients and
constants.
</p>
<sidebyside widths="33% 33% 33%" margins="auto" valign="middle">
<sidebyside widths="33% 33% 33%" margins="auto" valign="middle" component="html">
<p>
Original linear system:
<md alignment="alignat" alignat-columns="2">
Expand Down Expand Up @@ -748,6 +818,52 @@ Then use these to describe the solution set
</md>
</p>
</sidebyside>
<sidebyside widths="45%" margins="auto" valign="middle" component="print">
<p>
Original linear system:
<md alignment="alignat" alignat-columns="2">
<mrow>
x_1 + 3x_3 &amp;\,=\,&amp; 3
</mrow>
<mrow>
3x_1 - 2x_2 + 4x_3 &amp;\,=\,&amp; 0
</mrow>
<mrow>
-x_2 + x_3 &amp;\,=\,&amp; -2
</mrow>
</md>
</p>
</sidebyside>
<sidebyside widths="45% 45%" margins="auto" valign="middle" component="print">
<p>
Verbose standard form:
<md alignment="alignat" alignat-columns="4">
<mrow>
1x_1 &amp;\,+\,&amp; 0x_2 &amp;\,+\,&amp; 3x_3 &amp;\,=\,&amp; 3
</mrow>
<mrow>
3x_1 &amp;\,-\,&amp; 2x_2 &amp;\,+\,&amp; 4x_3 &amp;\,=\,&amp; 0
</mrow>
<mrow>
0x_1 &amp;\,-\,&amp; 1x_2 &amp;\,+\,&amp; 1x_3 &amp;\,=\,&amp; -2
</mrow>
</md>
</p>
<p>
Coefficients/constants:
<md alignment="alignat" alignat-columns="4">
<mrow>
1 &amp; &amp; 0 &amp;\,\,&amp; 3 &amp;\,|\,&amp; 3
</mrow>
<mrow>
3 &amp;\, \,&amp; -2 &amp;\,\,&amp; 4 &amp;\,|\,&amp; 0
</mrow>
<mrow>
0 &amp;\, \,&amp; -1 &amp;\,\,&amp; 1 &amp;\,|\,&amp; -2
</mrow>
</md>
</p>
</sidebyside>
</remark>

<definition>
Expand Down
51 changes: 48 additions & 3 deletions source/linear-algebra/source/01-LE/02.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Swapping two columns, for example:
<p>
Add a constant to every term of a row, for example:
</p>
<sidebyside>
<sidebyside component="html">
<p>
<me>
\left[\begin{array}{cc|c} 1 &amp; 2 &amp; 4
Expand All @@ -197,6 +197,21 @@ Add a constant to every term of a row, for example:
</md>
</p>
</sidebyside>
<p component="print">
<me>
\left[\begin{array}{cc|c} 1 &amp; 2 &amp; 4
\\ 1 &amp; 3 &amp; 5 \end{array}\right]
\sim
\left[\begin{array}{cc|c} 1+3 &amp; 2+3 &amp; 4+3
\\ 1 &amp; 3 &amp; 5 \end{array}\right]
</me>
</p>
<p component="print">
<md>
<mrow>x +2y \amp= 4 \amp 4x + 5y \amp= 7</mrow>
<mrow>x + 3y \amp= 5 \amp x +3y \amp= 5 </mrow>
</md>
</p>
<p>
<ol marker="A." cols="2">
<li>Solutions must be the <em>same</em>.</li>
Expand All @@ -211,7 +226,7 @@ Add a constant to every term of a row, for example:
<p>
Multiply a row by a nonzero constant, for example:
</p>
<sidebyside>
<sidebyside component="html">
<p>
<me>
\left[\begin{array}{cc|c} 1 &amp; 2 &amp; 4
Expand All @@ -228,6 +243,21 @@ Multiply a row by a nonzero constant, for example:
</md>
</p>
</sidebyside>
<p component="print">
<me>
\left[\begin{array}{cc|c} 1 &amp; 2 &amp; 4
\\ 1 &amp; 3 &amp; 5 \end{array}\right]
\sim
\left[\begin{array}{cc|c} 3(1) &amp; 3(2) &amp; 3(4)
\\ 1 &amp; 3 &amp; 5 \end{array}\right]
</me>
</p>
<p component="print">
<md>
<mrow>x +2y \amp= 4 \amp 3x + 6y \amp= 12</mrow>
<mrow>x + 3y \amp= 5 \amp x +3y \amp= 5 </mrow>
</md>
</p>
<p>
<ol marker="A." cols="2">
<li>Solutions must be the <em>same</em>.</li>
Expand All @@ -242,7 +272,7 @@ Multiply a row by a nonzero constant, for example:
<p>
Add one row to another row, for example:
</p>
<sidebyside>
<sidebyside component="html">
<p>
<me>
\left[\begin{array}{cc|c} 1 &amp; 2 &amp; 4
Expand All @@ -259,6 +289,21 @@ Add one row to another row, for example:
</md>
</p>
</sidebyside>
<p component="print">
<me>
\left[\begin{array}{cc|c} 1 &amp; 2 &amp; 4
\\ 1 &amp; 3 &amp; 5 \end{array}\right]
\sim
\left[\begin{array}{cc|c} 1 &amp; 2 &amp; 4
\\1+1 &amp; 3+2 &amp; 5+4 \end{array}\right]
</me>
</p>
<p component="print">
<md>
<mrow>x +2y \amp= 4 \amp \unknown x +\unknown y \amp= \unknown </mrow>
<mrow>x + 3y \amp= 5 \amp \unknown x +\unknown y \amp= \unknown </mrow>
</md>
</p>
<p>
<ol marker="A." cols="2">
<li>Solutions must be the <em>same</em>.</li>
Expand Down
71 changes: 55 additions & 16 deletions source/linear-algebra/source/02-EV/01.ptx
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,20 @@ we refer to this real number as a <term>scalar</term>.
<task>
<p>
Sketch the four Euclidean vectors
<me>1\left[\begin{array}{c}1\\2\end{array}\right]=\left[\begin{array}{c}1\\2\end{array}\right],\hspace{1em}
<me component="html">1\left[\begin{array}{c}1\\2\end{array}\right]=\left[\begin{array}{c}1\\2\end{array}\right],\hspace{1em}
3\left[\begin{array}{c}1\\2\end{array}\right]=\left[\begin{array}{c}3\\6\end{array}\right],\hspace{1em}
0\left[\begin{array}{c}1\\2\end{array}\right]=\left[\begin{array}{c}0\\0\end{array}\right],\hspace{1em}
-2\left[\begin{array}{c}1\\2\end{array}\right]=\left[\begin{array}{c}-2\\-4\end{array}\right]</me>
<md component="print">
<mrow>
1\left[\begin{array}{c}1\\2\end{array}\right]\amp=\left[\begin{array}{c}1\\2\end{array}\right], \amp
3\left[\begin{array}{c}1\\2\end{array}\right]\amp=\left[\begin{array}{c}3\\6\end{array}\right],
</mrow>
<mrow>
0\left[\begin{array}{c}1\\2\end{array}\right]\amp=\left[\begin{array}{c}0\\0\end{array}\right],\amp
-2\left[\begin{array}{c}1\\2\end{array}\right]\amp\left[\begin{array}{c}-2\\-4\end{array}\right]
</mrow>
</md>
in the same <m>xy</m> plane by drawing an arrow to the <m>(x,y)</m> coordinate associated with each vector.
</p>
</task>
Expand Down Expand Up @@ -163,22 +173,51 @@ we refer to this real number as a <term>scalar</term>.
</p>
</introduction>
<task>
<p>
<p component="html">
Sketch the following five Euclidean vectors in the same <m>xy</m> plane.
<me>
1\left[\begin{array}{c}1\\2\end{array}\right]+
0\left[\begin{array}{c}-1\\1\end{array}\right]=\unknown\hspace{2em}
0\left[\begin{array}{c}1\\2\end{array}\right]+
1\left[\begin{array}{c}-1\\1\end{array}\right]=\unknown\hspace{2em}
1\left[\begin{array}{c}1\\2\end{array}\right]+
1\left[\begin{array}{c}-1\\1\end{array}\right]=\unknown
</me>
<me>
-2\left[\begin{array}{c}1\\2\end{array}\right]+
1\left[\begin{array}{c}-1\\1\end{array}\right]=\unknown\hspace{2em}
-1\left[\begin{array}{c}1\\2\end{array}\right]+
-2\left[\begin{array}{c}-1\\1\end{array}\right]=\unknown
</me>
<md>
<mrow>
1\left[\begin{array}{c}1\\2\end{array}\right]+
0\left[\begin{array}{c}-1\\1\end{array}\right]\amp=\unknown\amp
0\left[\begin{array}{c}1\\2\end{array}\right]+
1\left[\begin{array}{c}-1\\1\end{array}\right]\amp=\unknown\amp
1\left[\begin{array}{c}1\\2\end{array}\right]+
1\left[\begin{array}{c}-1\\1\end{array}\right]\amp=\unknown
</mrow>
</md>
<md>
<mrow>
-2\left[\begin{array}{c}1\\2\end{array}\right]+
1\left[\begin{array}{c}-1\\1\end{array}\right]\amp=\unknown\amp
-1\left[\begin{array}{c}1\\2\end{array}\right]+
-2\left[\begin{array}{c}-1\\1\end{array}\right]\amp=\unknown
</mrow>
</md>
</p>
<p component="print">
Sketch the following five Euclidean vectors in the same <m>xy</m> plane.
<md>
<mrow>
1\left[\begin{array}{c}1\\2\end{array}\right]+
0\left[\begin{array}{c}-1\\1\end{array}\right]\amp=\unknown\amp
0\left[\begin{array}{c}1\\2\end{array}\right]+
1\left[\begin{array}{c}-1\\1\end{array}\right]\amp=\unknown
</mrow>
</md>
<md>
<mrow>
1\left[\begin{array}{c}1\\2\end{array}\right]+
1\left[\begin{array}{c}-1\\1\end{array}\right]\amp=\unknown \amp
-2\left[\begin{array}{c}1\\2\end{array}\right]+
1\left[\begin{array}{c}-1\\1\end{array}\right]\amp=\unknown
. </mrow>
</md>
<md>
<mrow>
-1\left[\begin{array}{c}1\\2\end{array}\right]+
-2\left[\begin{array}{c}-1\\1\end{array}\right]\amp=\unknown
</mrow>
</md>
</p>
</task>
<task>
Expand Down
Loading
Loading