Closed mmcky closed 5 years ago
quantecon.build.lectures
as a test case for this PR before mergingthis is broken in linear_algebra
on the python
side. So need to take a closer look tomorrow before merging this.
Should be:
and is (after nbconvert)
and strangely it looks ok in the notebook
with markdown
According to the preceding rule, this gives us an $ n \times 1 $ column vector
<a id='equation-la-atx'></a>
$$
A x
=
\left[
\begin{array}{ccc}
a_{11} & \cdots & a_{1k} \\
\vdots & \vdots & \vdots \\
a_{n1} & \cdots & a_{nk}
\end{array}
\right]
\left[
\begin{array}{c}
x_{1} \\
\vdots \\
x_{k}
\end{array}
\right]
:=
\left[
\begin{array}{c}
a_{11} x_1 + \cdots + a_{1k} x_k \\
\vdots \\
a_{n1} x_1 + \cdots + a_{nk} x_k
\end{array}
\right] \tag{2}
$$
>**Note**
>
>$ A B $ and $ B A $ are not generally the same thing
Another important special case is the identity matrix
It appears nbconvert is not honoring the $$
environment for displaymath reliably. The html has injected html items within the math. The source for this bug is:
$$</p>
<h1 id="A-x">A x<a class="anchor-link" href="#A-x">¶</a></h1><p>\left[
\begin{array}{ccc}
a_{11} & \cdots & a_{1k} \\
\vdots & \vdots & \vdots \\
a_{n1} & \cdots & a_{nk}
\end{array}
\right]
\left[
\begin{array}{c}
x_{1} \\
\vdots \\
x_{k}
\end{array}
\right]
:=
\left[
\begin{array}{c}
a_{11} x_1 + \cdots + a_{1k} x_k \\
\vdots \\
a_{n1} x_1 + \cdots + a_{nk} x_k
\end{array}
\right] \tag{2}
$$</p>
this is an issue with nbconvert
and not our template.
There is an issue already registered with nbconvert. https://github.com/jupyter/nbconvert/issues/404
Will try and massage the LaTeX to get it to work.
OK so the issue is the =
on its own line. This is caught by nbconvert
as markdown and breaks the equation environment. Given I am not sure how many edge cases there are here -- I am a bit reluctant to start editing our equations to fit around the nbconvert
issue until the treatment of $$
upstream is improved. @jlperla perhaps we should stick with wrapped equations in html for now -- what do you think?
Is the =
on its own line the only thing we know that triggers this? If so, then that seems to be a regex we could easily check for in and fix across the lecture notes?
From the issue on nbonvert
-- open lists [
also seem to break it. @jlperla do you have an RA that could check edge cases across the jl
side I would be happy to coordinate updating on the py
side. Its a bit tricky as they would need to diagnose on the IPYNB -> HTML border but they could do this on an individual lecture basis (without the template wrapper) using `jupyter nbconvert --to html file.ipynb``
The time consuming part is there is no way to check errors without reviewing all files file-by-file
Decision: Modify RST
files to suite buggy nbconvert
This PR changes the implementation to use
\tag{}
for displaymath with id labels instead of html tables. This increases compatibility withjupyterlab
and makes the notebook more readable.thanks @jlperla for the suggested solution.
Currently it looks like
<a id="">
references don't work in jupyterlab.Image size issues are also resolved as all math is in the same environment.