Unable to display image file in Jupyter markdown cell - python

This code in a Markdown cell:
<img src="images/grad_summary.png" style="width:600px;height:300px;">
works fine in Jupyter browser, but in VS Code with Python extension it does not render at all, only a blank image box is shown. Both are running in the same conda environment.
This alternate method in a Markdown cell:
![title](images/grad_summary.png)
also works fine in Jupyter browser but does not render in VS Code with Python ext.
I searched stack overflow, there was something close but it did not address this issue. Any insights appreciated.

Doing what gnodab said worked for me! Install the "Markdown all in one" extension.

Related

output text in jupyter notebook

I'm working with vscode in jupyter notebooks and when executing a code the text suddenly looks out of range, before it looked normal, I tried reinstalling vscode.
This is the view I have from the github repository, before it looked like this in vscode:
Before
in vscode suddenly it started to look like this:
After
before they told me that the font is the problem and that I should edit the json of the configuration, however, the json is only with the theme for vscode since I have uninstalled everything related and I have reinstalled it, and it still continues the same
It's related to VSCode, you can wait for the update of VSCode. You can refer to this page for more details.
Your font has changed from fixed width to variable width. This is something you will find in settings.json but should change via VSCode's settings page. Search for "font" and select an appropriate option - perhaps Courier.

Download Jupyter Notebook as .html File with Image Importing Code Excluded (Not Shown)

I have the following output on my local Jupyter Notebook:
I want to "Download As" this Jupyter Notebook as a .html file. But when I open the html file I only want to see the image and not the block of code in In [6]. How do I do this?
You can use the markdown in Jupyter Notebook to render your image file.
You can change your shell from code to markdown and run this to get image.
![Test](test.png)
If image file is in another folder, you can do the following:
![<caption>](folder/image_filename.png)
Use the Julyter's Insert Image functionality and it'll work.
Markdown a cell.
Edit > Insert Image

jupyterlab doesn't display png image

jupyterlab fails to display png image:
![title](image/filename.png)
results in showing only displaying the title.
I have the following installation
JupyterLab v0.35.4
Known labextensions:
app dir: /anaconda3/envs/learnco_projects/share/jupyter/lab
#jupyter-widgets/jupyterlab-manager v0.38.1 enabled OK
#jupyterlab/toc v0.6.0 enabled OK
#mflevine/jupyterlab_html v0.1.4 enabled OK
#ryantam626/jupyterlab_code_formatter v0.1.9 enabled OK
jupyterlab-flake8 v0.2.4 enabled OK
Thank for the help
One easy way to display image on a Jupyter notebook is using HTML chunk of code in a Markdown cell, here is an example:
<img src='./image/filename.png'>Image description</img>
Once you run the cell, the image and its description text should appear in place of the HTML code.
EDIT
This works with jupyter lab and classic jupyter notebook.
Here is a solution:
1- Have the notebook open in JupyterLab.
2- Right-click on the tab of the notebook and select New View for Notebook
The new view of the notebook should load with all figures successfully loaded.

Convert Markdown to pdf with Jupyter Notebook

I'm working in a jupyter notebook, and I'm working on a markdown file. I'm using a mac with Sierra 10.12.16. I'd like to convert the markdown to a pdf and I'm wondering what the easiest way to do that would be. I've read a lot of posts about installing things like pandoc or using packages in atom. I'm wondering if there isn't a simple way with the jupyter notebook to convert the markdown file to pdf. It really seems like there should be, but I'm having trouble finding it.
I figured it out. You can just paste the markdown code in to a cell in a jupyter notebook and change the dropdown menu below "Widgets" in the notebook from "code" to "markdown". Then hit shift enter and it renders the markdown. You can then download the notebook as pdf.

Jupyter reveal based slideshow

I want to create a presentation such this starting from a simple Jupyter notebook.
What I have looks like:
Given that, I'd expect to get a slideshow with two slides corresponding to the two cells.
Then from the command line I execute:
jupyter nbconvert --to slides mynotebook.ipynb --post serve
What I get is a static html page that seems to group both of my cells together.
How do I get the type of one slide per cell effect of the linked presentation?
You may need to include a reference to the reveal.js package in your nbconvert command:
jupyter nbconvert --to slides --reveal-prefix="http://cdn.jsdelivr.net/reveal.js/2.5.0 mynotebook.ipynb --post serve
Or, for instructions on using a local version of reveal.js, see this blog post by Damian Avila
Have you tried opening the generated HTML with your browser?
I had the same issue on a fresh install of Lubuntu in a VirtualBox. It worked fine (using the --post serve flag) on my host system (OSX) but not in the VB. I didn't find much on the internets, so I just tried loading the XXXX.slides.html file with my browser and that appears to have solved it.
Summary:
$ jupyter nbconvert --to slides --reveal-prefix ../reveal.js XXXX.ipynb # using "--post serve" fails
$ firefox XXXX.slides.html
Hope this helps!

Categories