# Create Figure with subfigures from .svg files

I am trying to create a number of figures in Overleaf which consist of several subpictures. To get highly resoluted pictures, I have saved them in .svg format. I have read different posts and learned that the svg package utilizes the subfigure (or subfig?) package to achieve this. I have tried to create my images in different ways, nothing really works. I have also read that there are workarounds using inkscape, but those seem outdated.. What code can I use in LaTeX to achieve what I want?

One of the versions I have tried is the following:

\documentclass{article}
\usepackage{svg}
\usepackage{subfigure}

\begin{document}
\begin{figure}[H]
\begin{subfigure}[t]{1\textwidth}
\includesvg[width=\linewidth]{sul_trends.svg}
\label{fig:a}
\end{subfigure}
\end{figure}


But it produces an error: Missing number, treated as zero. <to be read again> } l.322 \begin{subfigure}[t]{1\textwidth}

• subfigure is a deprecated package. Use the subfig or subcaption packages. The \label without caption is also not useful – user31729 Jun 6 '16 at 11:21
• Just noticed: svg loads subfig, so subcaption does fail then! – user31729 Jun 6 '16 at 11:40

Since svg loads subfig, which is in turn incompatible with subcaption,there's not left: Use \subfloat inside of a figure environment.

The subfigure package is obsolete and shouldn't be used any longer!

\documentclass{article}
\usepackage{graphicx}
\usepackage{svg}
\usepackage{subfig}

\begin{document}

\begin{figure}%
\centering

• I used \includegraphics instead of \includesvg because I was too lazy to generate some .svg files – user31729 Jun 6 '16 at 12:01
• @sequence_hard \includesvg from the svg package requires inkscape, which unfortunately isn't available on Overleaf's servers at present. Sorry about that! As an alternative, you can export the .svg to .pdf (which would still be high-res) on your own machine, and then upload the .pdf to your Overleaf project. – imnothere Jun 6 '16 at 12:24
• @sequence_hard: Yes, in this case you can use subcaptions package as well – user31729 Jun 6 '16 at 13:41