Removing the extra \includegraphics isin output.pdf_tex does not enoughsolve the problem since each page in output.pdf contains parts of the drawings are contained in the other pages as welldrawing. I found a solution (proposed by Biber on launchpad.net) which uses a new definition of the "\includesvg" command:
- Your drawings must be in the folder "./Figures/";
- Your temporary files (".pdf", ".pdf_tex") will be added in the folder "./tmp/" (you don't need to create the "./tmp" folder it will be done automatically);
- The 3 following commands must be placed before '\begin{document}':
% 1 - Set the graphic paths
\graphicspath{ {./Figures/} {./.tmp/} }
% 2 - Command used to test if the compilation of the svg file is necessary (i.e., if the .svg file is more recent than the corresponding pdf file)
\newcommand{\executeiffilenewer}[3]{\ifnum\pdfstrcmp{\pdffilemoddate{#1}}{\pdffilemoddate{#2}}>0{\immediate\write18{ [ -d ./.tmp/ ] || mkdir ./.tmp; #3}}\fi}
% 3 - Command that creates the ".pdf" and ".pdf_tex" from the ".svg". The workaround is in this command
\newcommand{\includesvg}[2][\textwidth]{\def\svgwidth{#1}\executeiffilenewer{./Figures/#2.svg}{./.tmp/#2.pdf}{\unexpanded{PDF_FILE="./.tmp/#2.pdf"; inkscape -z --file=./Figures/#2.svg --export-pdf=$PDF_FILE --export-latex; sed -i 's/\\\\/\n/g' ${PDF_FILE}_tex; MAXPAGE=$(pdfinfo $PDF_FILE | grep -oP "(?<=Pages:)\s*[0-9]+" | tr -d " ") ; sed -i "/page=$(($MAXPAGE+1))/,\${/page=/d}" ${PDF_FILE}_tex; } } \input{./.tmp/#2.pdf_tex}}
With these three commands an svg file can be displayed using "\includesvg" (like we would use "\includegraphics"):
\begin{figure}
\centering
\includesvg[0.5\textwidth]{My_Nice_SVG_File} %Where the file is located at: ./Figures/My_Nice_SVG_File.svg
\caption{My_Caption]
\label{My_Label}
\end{figure}