# VSCode & local image in markdown

**URL:** https://discourse.julialang.org/t/vscode-local-image-in-markdown/121291
**Category:** VS Code
**Created:** [October 14, 2024, 2:11pm UTC](https://discourse.julialang.org/t/vscode-local-image-in-markdown/121291 "2024-10-14T14:11:25Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [October 14, 2024, 2:11pm UTC](https://discourse.julialang.org/t/vscode-local-image-in-markdown/121291/1 "2024-10-14T14:11:25Z")

</div>

I asked about this a year ago, but there was not really a solution to my problem…

I’m trying to insert an image into a markdown cell of a Jupyter Notebook in VSCode. The following code does not work, for some weird reason:

```julia
<img src="../figs/WaveNet-1.svg" width="25%" height = "25%" />

```

Here, the image is found in the `figs` directory, which is a subdirectory of the parent directory of where the notebook is located.

_However_, it seems like if I _move_ the image file to the same directory as the notebook, and change the insertion code to:

```julia
<img src="WaveNet-1.svg" width="25%" height = "25%" />

```

then it sort of works… (“sort of”… I had to open the markdown cell and execute it several times before the image showed up… and this makes the directory cluttered).

**Question:** Is this a bug in VSCode/Jupyter notebook?

[If I instead create a subdirectory `figs` _under_ the location of the notebook and write:

```julia
<img src="figs/WaveNet-1.svg" width="25%" height = "25%" />

```

this also works. I want to put figures in a given folder to avoid clutter. I’m surprised that I cannot use the `"../figs/...."` syntax. ]

---

<div class="post-metadata">

### Author: ![dqeeq](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@dqeeq](https://discourse.julialang.org/u/dqeeq)
#### Post date: [October 15, 2024, 5:46pm UTC](https://discourse.julialang.org/t/vscode-local-image-in-markdown/121291/2 "2024-10-15T17:46:51Z")

</div>

I have an impression that jupyter can only see files in children directories. A quick search reveals [this confirmation](https://stackoverflow.com/a/46762386)

I am not sure if I understood your question properly though. I mean I did not get where is the root of your jupyter notebook.

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [October 15, 2024, 6:07pm UTC](https://discourse.julialang.org/t/vscode-local-image-in-markdown/121291/3 "2024-10-15T18:07:35Z")

</div>

I am modifying a Jupyter notebook that I ran in the past using IJulia, in my web browser. In the original notebook, there was no problem in using

```julia
<img src="../figs/WaveNet-1.svg" width="25%" height = "25%" />

```

But this file syntax does not work with Jupyter notebook in VSCode. I do not think this is because VSCode is confused with the directory it is in – I also tried to specify the full path in the text string above (`"C://...."`), but that didn’t work. So either there is a reduced functionality in VSCode (compared to IJulia + web browser), or some changes has been made.

I can probably live with putting figures in sub-folders, but I don’t like it… I try to have (LaTeX) documents (`docs`), figures (`figs`), and notebooks (`nbs`) in parallel subfolders, and I may have to change that.

---

<div class="post-metadata">

### Author: ![dqeeq](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@dqeeq](https://discourse.julialang.org/u/dqeeq)
#### Post date: [October 16, 2024, 3:25pm UTC](https://discourse.julialang.org/t/vscode-local-image-in-markdown/121291/4 "2024-10-16T15:25:16Z")

</div>

This has nothing to do with julia.  
You may want to open a bug report on github: [vscode-jupyter](https://github.com/microsoft/vscode-jupyter).

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [October 16, 2024, 3:31pm UTC](https://discourse.julialang.org/t/vscode-local-image-in-markdown/121291/5 "2024-10-16T15:31:48Z")

</div>

I will do so.
