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

Latex Equations in iJulia (not printing) #278

Closed
alexocampo907 opened this issue Feb 18, 2015 · 28 comments
Closed

Latex Equations in iJulia (not printing) #278

alexocampo907 opened this issue Feb 18, 2015 · 28 comments
Assignees

Comments

@alexocampo907
Copy link

I'm having trouble getting my latex equations to display in print preview. Regular latex displays in print preview but when I try to use an equation such as \begin{align} it doesn't display (see attached screen shots).

displays in ijulia
doesn t display in print preview

Thank you for any help,

Alex

@Carreau
Copy link
Contributor

Carreau commented Feb 18, 2015

That's most likely a bug in IPython. Can you try the 3.0 Rc release ? Does it do the same when you manually nbconvert --to html ?

@stevengj
Copy link
Member

They can't try the 3.0 release until #224 is completed, no?

This seems like the same thing as JuliaCloud/JuliaBox#76

Is there an issue number or commit in IPython that we should link here?

@Carreau
Copy link
Contributor

Carreau commented Feb 18, 2015

The kernel might start as Python, but the conversion to html/print preview should work.

@alexocampo907
Copy link
Author

It is different to JuliaCloud/JuliaBox#76 because my latex actually shows up in the print preview. For instance if I type $\alpha$ in a markdown cell, it will display.

However if I try to use \begin{equation} or any other type of equation latex, it will show fine in the console and then not show in the print preview.

Carreau, how do I execute the manual nbconvert --to html?

@Carreau
Copy link
Contributor

Carreau commented Feb 18, 2015

Carreau, how do I execute the manual nbconvert --to html?

Shoudl be :

$ ipython nbconvert --to html <your ipynb>

Should create an html file with the same name.

@alexocampo907
Copy link
Author

Sorry for my technical illiteracy. But I triend the manual nbconvert and it gave me an error.

I set the working directory:
Alexs-MacBook-Air-2:Methods II alexocampo$ pwd
/Users/alexocampo/Documents/Harvard/Semester 2/Methods II

Then ran the code you mentioned:
Alexs-MacBook-Air-2:Methods II alexocampo$ ipython nbconvert --to html <HW 2 Methods.ipynb>
-bash: syntax error near unexpected token newline' >

@jiahao
Copy link
Member

jiahao commented Feb 18, 2015

Replace the angle brackets with double quotes and try again.

@alexocampo907
Copy link
Author

Thanks! The manual nbconvert worked but still no latex equations displaying :(

@stevengj
Copy link
Member

@alexocampo907, I think nbconvert needs LaTeX (e.g. MacTeX) to be installed on your system for equation rendering (and for nice PDF output)?

@Carreau Carreau self-assigned this Feb 19, 2015
@Carreau
Copy link
Contributor

Carreau commented Feb 19, 2015

@alexocampo907, I think nbconvert needs LaTeX (e.g. MacTeX) to be installed on your system for equation rendering (and for nice PDF output)?

For Html it should still rely on mathjax.
I'm at Strata the next two days, but assigned that to me to have a look.

@alexocampo907
Copy link
Author

Any progress on this issue?

It does use mathjax. I know this because I had to use the following stack exchange in order to get my regular latex (i.e. non equation latex) to show in the print preview.

@Carreau
Copy link
Contributor

Carreau commented Feb 22, 2015

I would try IPython 3.0 RC, it seem to work (for me at least) on 3.0-dev, and there will most likely not be a bugfix on 2.x. I'll try on 2.x later.

@alexocampo907
Copy link
Author

Sorry again for my technical illiteracy, but do I upgrade to IPython 3.0 RC by putting the following in the terminal?

pip install ipython --upgrade

@Carreau
Copy link
Contributor

Carreau commented Feb 23, 2015

that shouLd work, if it does not force the version with pip install ipython==3.0.0rc1

@jiahao
Copy link
Member

jiahao commented Feb 23, 2015

Works for me in 3.0.0rc1 also.

screen shot 2015-02-22 at 9 20 46 pm

@Carreau
Copy link
Contributor

Carreau commented Feb 23, 2015

Works for me in 3.0.0rc1 also.

Great ! Seem like 3.0 will be a good release !

@alexocampo907
Copy link
Author

ok guys BIG PROBLEM now. I installed the latest version of Ipython using the instructions above, but now my IJulia won't open! See attachement for the error:

screen shot 2015-02-22 at 9 47 31 pm

Any idea why this is happening?

@Carreau
Copy link
Contributor

Carreau commented Feb 23, 2015

can you get the full command line, and/or try the command line directly ( ipython notebook)?

@Carreau
Copy link
Contributor

Carreau commented Feb 23, 2015

And also:

Oh, you are a R user, do you know there is an R Kernel too.

@Carreau
Copy link
Contributor

Carreau commented Feb 23, 2015

Without the full traceback, I would try nuking ~/.ipython/profile_julia away (or temporary move it somewhere else). The issue a Pkg.build("IJulia") to recreate it.

@alexocampo907
Copy link
Author

Thanks for your quick help!

I was able to get the notebook to start by doing
pip install jinja2 tornado pyzmq --upgrade
and
pip install jsonschema

but now when I am inside looking at my file all I see is a blank file (attached)
screen shot 2015-02-22 at 10 00 47 pm

Thanks for the tip about the R kernel too!

@Carreau
Copy link
Contributor

Carreau commented Feb 23, 2015

Force refresh page a few time (Cmd-Shift-R)
If does not work
Open JS console. (Cmd-Alt-J) see it error.
Retry force refresh (Chrome is stubborn)

This is typical of cached Javascript from IPython 2.0, or custom.Js not upgraded.

@jiahao
Copy link
Member

jiahao commented Feb 23, 2015

I had this problem too. Please update IJulia with Pkg.update() and try again. v0.2.0 was tagged very recently.

@Carreau
Copy link
Contributor

Carreau commented Feb 23, 2015

pip install jinja2 tornado pyzmq --upgrade

And you should not have to do that, it means that IPython was not installed previously with pip install ipython[all]. But I guess this is due to you using conda, with which I'm not super familiar with.

@alexocampo907
Copy link
Author

Ok progress! I reinstalled and updated the IJulia package like you all said and now I am seeing my work again! THANK YOU THANK YOU THANK YOU!

However, now I am having an issue while trying to print (attached)
screen shot 2015-02-22 at 10 12 59 pm

@Carreau
Copy link
Contributor

Carreau commented Feb 23, 2015

No module named mistune is self explanatory, you are missing it, you need to pip-install it.

try pip install ipython[all]==3.0.0rc1 (with or without the ==3.0.0rc1 depending on what you did earlier), it will reinstall IPython making sure you have all dependencies.

@alexocampo907
Copy link
Author

Ok, I tried pip install ipython[all]==3.0.0rc1 and I am still having the same problem:

Could not import nbconvert: No module named mistune

@alexocampo907
Copy link
Author

Working!! I did:

pip install mistune

now everything is working (including equation Latex) and I think we can say that this issue is closed! Thank you to everyone who helped out and my apologies again for my lack of knowledge with IPython.

@jiahao jiahao closed this as completed Feb 23, 2015
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

No branches or pull requests

4 participants