Skip to content

Help export PDF with images in VSCode #530

Answered by yhatt
spivakj asked this question in Q&A
Discussion options

You must be logged in to vote

Try relative path from the location of Markdown file.

-![h:300](/Project/Slides/Image.png)
+![h:300](./Project/Slides/Image.png)

Image paths starting with / are absolute paths. They will be resolved from different file locations depending on the context.

Details:

  • While previewing in VS Code, the absolute path is resolved from the VS Code project root.
  • While exporting, the absolute path is resolved from the file system root. 1
  • While viewing in exported HTML, the absolute path is resolved from URL root.

If you want stable path resolution, recommend always to use relative paths.

Footnotes

  1. If enabled Markdown › Marp: Strict Path Resolution During Export experimental setting in Marp for VS…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by spivakj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants