27

Unfortunately I am not able to include svg images in overleaf. This is the minimal example:

\documentclass{article}
\usepackage{svg}
\usepackage{amsmath}
\begin{document}

\begin{figure}[htbp]
  \centering
  \includesvg{image.svg}
  \caption{svg image}
\end{figure}

\end{document}

This will give an error says

File `./image' not found

Overleaf does allow svg extensions but how can I include the file?

2
  • 4
    The svg package requires the shell escape to be enabled and an existing installation of Inkscape - which probably is not available on Overleaf. Converting the SVG files to PDF using Inkscape manually before and uploading this PDF files could be a possible workaround.
    – epR8GaYuh
    Jul 17 '18 at 16:30
  • 1
    Just to add on to @epR8GaYuh's comment, shell escape is enabled on Overleaf, but Inkscape isn't available on the servers for now.
    – imnothere
    Jul 18 '18 at 3:51
38

This does work on the Overleaf v2 beta, where Inkscape's available. Here's the MWE above on the beta new version of the site:

\documentclass{article}
\usepackage{svg}
\usepackage{amsmath}

\title{Inkscape package on Overleaf }
\begin{document}
\maketitle

\begin{figure}[htbp]
  \centering
  \includesvg{image.svg}
  \caption{svg image}
\end{figure}

\end{document}

enter image description here

7
  • 1
    MWE not found - is this really possible? Mar 16 '19 at 18:20
  • Oops, apologies - I'd accidentally deleted the example. I've recreated it and updated the link.
    – walszje
    Mar 26 '19 at 15:36
  • 3
    I added the code and a screenshot because external links are very likely to be broken in the (maybe not near) future. The screenshot is not in a really good quality - you can replace it with another if you want, and feel free to roll back if you don't like :)
    – user156344
    Mar 26 '19 at 18:11
  • @walszje thanks for the example. It worked for me however my svg doesn't fit into a single column. How can I fix it ? Actually, I can fit into a single column by \includesvg[width=\columnwidth] but it becomes unreadable.
    – zwlayer
    Sep 10 '19 at 11:35
  • 3
    It does not work now, can not figure out the reason
    – Travis
    Jan 15 '20 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.