QuantEcon / lecture-jax

Lectures on Quantitative Economics Using JAX
https://jax.quantecon.org/
28 stars 4 forks source link

Fix Equation 4.18 #110

Open mmcky opened 1 year ago

mmcky commented 1 year ago

Eq (4.18) looks broken at the end (missing brackets) but actually if you hover over the equation there's a slider.

That's not obvious if you don't hover.

I wonder how we might deal with that?

Always show the slider? Maybe decrease the margins slightly?

I'm looking at https://64fcd7b7064a1019dc45546a--incomparable-parfait-2417f8.netlify.app/markov_asset, which is the JAX "An Asset Pricing Problem" lecure.

mmcky commented 1 year ago

I think the best short term solution is to split the equation over two lines for now.

mmcky commented 1 year ago

@Smit-create can you think about a way we might be able to do a pre-commit run to check for long equations?

From @jstac

I wonder if there's a way to scan the documents for these....

Smit-create commented 1 year ago

can you think about a way we might be able to do a pre-commit run to check for long equations?

Hmm, this might be a hard one. The main issue here is the number of characters that we write in a .md file for a latex equation is not always equal to the number of characters in the rendered equation.

One very naive approach to this problem can be to generate a pdf file -> convert it to .txt file and check the number of characters on each line in the .txt file. This might be a long and resource-consuming approach.

One another approach to detect this is if the HTML page contains a slider, then raise an error while generating the page for that file. I am not completely sure if this is possible as I need to dig into how the pages are generated internally and if there is some way to detect the same.

jstac commented 1 year ago

Thanks @Smit-create . Maybe that's not worth the effort. Instead we can make it the responsibility of the author to check.

Is there an easy way to allow long equations to run over the margins, instead of using a slider? That would make them easier to spot and correct.

mmcky commented 1 year ago

@Smit-create I guess I was wondering if there are any html visual checkers that we might be able to incorporate on the html side through CI such as https://smartbear.com/product/visualtest/

This idea is a longer term project but it would be nice to find a tool that could assist with this -- particularly if we could build some visual rules like this long equation check.

mmcky commented 1 year ago

Is there an easy way to allow long equations to run over the margins, instead of using a slider?

This behaviour would be controlled by quantecon-book-theme

mmcky commented 8 months ago

Is there an easy way to allow long equations to run over the margins, instead of using a slider? That would make them easier to spot and correct.

@jstac this is inherited behaviour for pydata-sphinx-theme but we could try and override the math / slider behaviour in our theme. Would you prefer all equations to not scroll.

jstac commented 8 months ago

Mmmm, it's hard to say what's best. I think I'd prefer for them not to scroll.

But ideally we should go through and rejig them so they fit ---- maybe worth an issue in meta?