Closed jlperla closed 5 years ago
thanks @jlperla. I will add your example to our test set and check it out. Perhaps our css is altering the look of labeled equations and not working correctly on default nbconvert
I also like you're idea of using latex \tag{#}
math
@jlperla if you get the chance can you post the output. The test case packaged with the extension has a labelled equation that is a bit smaller than the original equation (without labels) but I don't know what you mean with strange wrapping.
I have added the above test case to the test notebook math.rst
and it renders like this:
is your issue at the notebook level or post nbconvert
to html?
Notebooks. I am not sure how to generate html yet!
are you getting rendering that is different to the screenshot above?
The above is a rendered from the following rst in Jupytelab (generated using ubuntu on WSL, not that it matters, and displaying in chrome)
Fixed-Point Maps
----------------------------
Consider the simple equation, where the scalars :math:`p,\beta` are given, and :math:`v` is the scalar we wish to solve for
.. math::
:label: vfixed
v = p + \beta v
Of course, in this simple example, with parameter restrictions this can be solved as :math:`v = p/(1 - \beta)`
Rearrange the equation in terms of a map :math:`f(x) : \mathbb R \to \mathbb R`
.. math::
v = f(v)
where
.. math::
f(v) := p + \beta v
Therefore, a fixed point :math:`v^*` of :math:`f(\cdot)` is a solution to the above problem
Hmm. Thanks @jlperla. I can't replicate it on my local. Are you by chance using sphinx >= 1.8
? I haven't tested on the newly released 1.8
Key version numbers from conda list
are
sphinx 1.7.4 py36_0
sphinxcontrib 1.0 py36h6d0f590_1
sphinxcontrib-bibtex 0.4.0 <pip>
sphinxcontrib-jupyter 0.2b0.dev20180929 <pip>
sphinxcontrib-jupyter 0.2b0.dev20180827 <pip>
sphinxcontrib-websupport 1.0.1 py36hb5cb234_1
But I think this is probably a html/css problem, as opposed to a generation problem
I'm using sphinx=1.7.8
but as you say I don't think that is the issue (as the html output is the same). Could a local extension be altering the alignment of equations. My environment has not jupyter
extensions installed with no specific html/css adjustment to base jupyter.
My jupyter has no extensions, but perhaps it is old. The versions are
jupyter 1.0.0 py36_4
jupyter_client 5.2.3 py36_0
jupyter_console 5.2.0 py36he59e554_1
jupyter_core 4.4.0 py36h7c827e3_0
jupyterlab 0.32.1 py36_0
jupyterlab_launcher 0.10.5 py36_0
I will to upgrade jupyterlab tomorrow and see what happens
I mainly just jupyter notebook
rather than jupyterlab ... I will test with jupyterlab on my end also. Unfortunately jupyter notebook
and jupyterlab
don't always produce the same output: https://github.com/QuantEcon/sphinxcontrib-jupyter/issues/79
I think that most jupyterhub installations are moving quickly to jupyterlab
, so it might make sense to test there as the primary interface. But, if this is a jupyter vs. jupyterhub issue, I think it also points out that there is only so much you can do to deal with different versions of jupyterhub
@mmcky Is there any method to enlarge the labelled equations? As you mentioned, they are a little bit smaller than the equations without labels. Especially when I tried to present the notebook in slides (with RISE), I found it is hard to read.
Hi @mmcky, just wanted to chime in that I can reproduce this issue on https://compare-lectures.quantecon.org/jl/jupinx_test.html
<table width=100%><tr style='background-color: #FFFFFF !important;'>
<td width=10%></td>
<td width=80%>
$$
v = f(v)
$$
</td><td width=10% style='text-align:center !important;'>
</td></tr></table><p>And want to link to it in text <a href="julia_by_example.html#equation-fixed-point-map">(1)</a></p>
we could wrap the tables in a class and adopt a local mathjax resize in our theme for now.
https://stackoverflow.com/questions/19086152/changing-mathjaxs-font-size
A fix for the current solution has been implemented in https://github.com/QuantEcon/sphinxcontrib-jupyter/pull/152
Was this solution used in the latest generation of the notebooks? I just downloaded a notebook geenrated from the mccall lecture and in jupyterlab it looks like
On the other hand, to look at the julia examples file, the HTML is a little odd in that the numbered equations are larger than the other ones:
and the of numbered equations are still an issue with weird splitting
these issues should be fixed by https://github.com/QuantEcon/sphinxcontrib-jupyter/pull/154 when merged.
The jupinx master seems to have flaws in the display with equations. Create something like
And the generated HTML is
which wrapped the equation in a weird way because of the decrease in the width of the table
cc: @mmcky any thoughts on easy workaround?