Skip to main content
All CollectionsAuthor HelpImages
Does Leanpub support SVG images? How can I add an SVG image to a Leanpub book?
Does Leanpub support SVG images? How can I add an SVG image to a Leanpub book?

Keywords: svg, .svg, image, images, Scalable Vector Graphics

Leanpub Support avatar
Written by Leanpub Support
Updated over a week ago
Does Leanpub support SVG images? How can I add an SVG image to a Leanpub book?

Leanpub supports SVG images in books.

From Wikipedia: SVG

There are two ways to add an SVG image to a Leanpub book: 1) as an ordinary image, and 2) as inline code.

Adding an SVG File as An Ordinary Image

You can add an SVG file to a Leanpub book just like you would add any other accepted image file, like a PNG or JPG file.

You can find an article pointing to instructions for adding images to Leanpub books here.

The tl;dr answer is that you add the SVG image to your book's resources folder, and thn do this in your manuscript:


Adding an SVG File as Inline Code

You can also an SVG image as inline code, like this:

{type: image, format: svg}
<svg width="20" height="20">
<circle cx="10" cy="10" r="9" fill="blue"/>

That example will create a little circle.

The following example will add the Leanpub logo icon from Font Awesome:

{type: image, format: svg}
<svg xmlns="" viewBox="0 0 576 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - License - Copyright 2024 Fonticons, Inc.--><path d="M386.5 111.5l15.1 249-11-.3c-36.2-.8-71.6 8.8-102.7 28-31-19.2-66.4-28-102.7-28-45.6 0-82.1 10.7-123.5 27.7L93.1 129.6c28.5-11.8 61.5-18.1 92.2-18.1 41.2 0 73.8 13.2 102.7 42.5 27.7-28.3 59-41.7 98.5-42.5zM569.1 448c-25.5 0-47.5-5.2-70.5-15.6-34.3-15.6-70-25-107.9-25-39 0-74.9 12.9-102.7 40.6-27.7-27.7-63.7-40.6-102.7-40.6-37.9 0-73.6 9.3-107.9 25C55.2 442.2 32.7 448 8.3 448H6.9L49.5 98.9C88.7 76.6 136.5 64 181.8 64 218.8 64 257 71.7 288 93.1 319 71.7 357.2 64 394.2 64c45.3 0 93 12.6 132.3 34.9L569.1 448zm-43.4-44.7l-34-280.2c-30.7-14-67.2-21.4-101-21.4-38.4 0-74.4 12.1-102.7 38.7-28.3-26.6-64.2-38.7-102.7-38.7-33.8 0-70.3 7.4-101 21.4L50.3 403.3c47.2-19.5 82.9-33.5 135-33.5 37.6 0 70.8 9.6 102.7 29.6 31.8-20 65.1-29.6 102.7-29.6 52.2 0 87.8 14 135 33.5z"/></svg>

Try it for fun!

For the relevant section of the Markua specification on inline SVG images, please go here.

A Note About SVG Images in Leanpub Courses

Please note that normal .svg images work in courses, but inline SVG code will not, sorry about that!

If you have any feedback or questions about this article, please email the Leanpub team about it at!

If you have any questions or thoughts on writing and self-publishing with Leanpub, please join our global community of authors in our Authors Forum here!

Are you interested in self-publishing, and creating your first Leanpub book? Here are some quick tutorials for our most popular writing modes:

Are you looking for great deals on Leanpub ebooks, ebook bundles, and courses? Sign up for our Weekly and Monthly newsletter sales here!

To learn about amazing new books and authors, subscribe to our YouTube channel here:

You can also follow Leanpub in lots of other places!

Did this answer your question?