Skip to content
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

Particular equation not rendering (notebook) #3176

Closed
CamDavidsonPilon opened this issue Apr 14, 2013 · 4 comments
Closed

Particular equation not rendering (notebook) #3176

CamDavidsonPilon opened this issue Apr 14, 2013 · 4 comments
Milestone

Comments

@CamDavidsonPilon
Copy link

Hi, I'm trying to understand why the following equation won't render in a ipython notebook:

\begin{equation}
p(\theta | {\bf X}) \propto \underbrace{p({\bf X} | \theta)}_{{\rm likelihood}} \cdot \underbrace{        p(\theta) }_{{\rm prior}} 
\end{equation}

The Latex is correct, and it renders correctly on other mathjax sites. Is it some odd format that the notebook refuses?

I believe it may be the two \underbraces that are causing it, as removing one allows rendering.

@juhasch
Copy link
Contributor

juhasch commented Apr 14, 2013

Your Latex code works for me in a code cell as well as in markdown.

Markdown:

$$p(\theta | {\bf X}) \propto \underbrace{p({\bf X} | \theta)}_{{\rm likelihood}}  \cdot \underbrace{ p(\theta) }_{{\rm prior}} $$
from IPython.display import display, Math, Latex
a=r"""
\begin{equation}
p(\theta | {\bf X}) \propto \underbrace{p({\bf X} | \theta)}_{{\rm likelihood}} \cdot \underbrace{ p(\theta) }_{{\rm prior}} 
\end{equation}
"""
display(Math(a))

How exactly do you enter your equation ìn the notebook ?

@CamDavidsonPilon
Copy link
Author

I entered it exactly as I have is posted above. I cp'ed your first code, and that failed, but your second code piece worked. I am using ipython 0.13 btw

@ccordoba12
Copy link
Member

I think this was fixed in PR #2349, which is only present in master, not in 0.13.

@CamDavidsonPilon
Copy link
Author

Yup, that's it. I'm happy to close this issue. Thanks @ccordoba12 and @juhasch

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

No branches or pull requests

3 participants