Skip to content

Math rendering issue in golf putting example #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
isms opened this issue May 1, 2024 · 4 comments · Fixed by #658
Closed

Math rendering issue in golf putting example #657

isms opened this issue May 1, 2024 · 4 comments · Fixed by #658

Comments

@isms
Copy link
Contributor

isms commented May 1, 2024

Notebook title: Model building and expansion for golf putting
Notebook url: https://github.com/pymc-devs/pymc-examples/blob/main/examples/case_studies/putting_workflow.ipynb

Issue description

Small LaTeX issue ( $$ blocks) results in bad render which looks fine in the Jupyter notebook while working on it but not in the rendered result.

Rendered by sphinx

image

Code in notebook

3. The distance the ball goes, $u$, is distributed according to
$$
u \sim \mathcal{N}\left(1 + \text{distance}, \sigma_{\text{distance}} (1 + \text{distance})\right),
$$
where we will learn $\sigma_{\text{distance}}$.

Again, this is a geometry and algebra problem to work the probability that the ball goes in from any given distance:
$$
P(\text{good distance}) = P(\text{distance} < u < \text{distance} + 3)
$$

Expected output (as rendered properly while in Jupyter notebook)

image

Proposed solution

Fix $$ enclosures either inline or in the sphinx rendering pipeline

@ricardoV94
Copy link
Member

@isms do you want to open a PR to fix it?

@isms
Copy link
Contributor Author

isms commented May 1, 2024

@ricardoV94 Working on it now -- trying to assess whether it's specific to this notebook (for example, as a result of being in a numbered list) or a configuration issue that affects all $$ blocks across notebooks.

@isms
Copy link
Contributor Author

isms commented May 1, 2024

Looks like it affects all of them, e.g. in the rugby analytics case study, this

$$log \\theta_{g1} = home + att_{h(g)} + def_{a(g)} $$
$$log \\theta_{g2} = att_{a(g)} + def_{h(g)}$$

Renders as this:
image

@isms
Copy link
Contributor Author

isms commented May 1, 2024

Looks like it only happens when the $$ block is inline (no leading newlines), and is related to this issue: jupyter-book/jupyter-book#1181

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants