Getting usepackage{svglatex} in TeXstudio to work

I am working in TeXstudio, trying to get the usepackage “svglatex” to work. My goal is to be able to import .svg-files that I produced in inkscape (without the need to export/convert them first).

Can you please instruct me how to achieve this?
System info

TeXstudio 4.5.1 (git 0.0.0++)
Using Qt Version 6.4.3, compiled with Qt 6.4.2 R
Xfce 4.18
Manjaro 22.1
Kernel: Linux 6.2.10-1-MANJARO
Architecture: x86-64

Here are the things I tried:

  • added \usepackage{svglatex} (gave me error “svglatex.sty not found”
  • Downloaded svglatex.sty to /usr/share/texmf-dist/tex/generic/svglatex/svglatex.sty (I created that folder)
  • LC_ALL=C pacman -Qo /usr/share/texmf-dist/tex/generic/svglatex/svglatex.sty
  • \graphicspath{{/usr/share/texstudio/}}
  • pip install svglatex
  • sudo texhash
kpsewhich svglatex.sty
sudo pacman -S texlive-science
sudo pacman -Syu texlive-most

Did you read the

  1. Install for your user: pip install svglatex
  2. Copy svglatex.sty to the folder ~/texmf/tex/latex/local/ (create the folders if they don’t exist)
  3. Run texhash $HOME/texmf

If this doesn’t work, you must provide a Minimal Working Example and the error message.

Thank you for your response, mithrial. The test-examples from the repo work fine using the make all command.

I ran the 3 steps you pointed out, and added “-shell-escape” to my default compiler in TeXstudio:
pdflatex -synctex=1 -interaction=nonstopmode -shell-escape %.tex

Using the CDL, in the folder containing my tex-files:

(base) [dejhost@Workstation latex]$ kpsewhich -var-value=TEXMFHOME

A minimized, not-working example:

\documentclass[11pt, a4paper, titlepage]{book}
	\immediate\write18{svglatex -i ./images/sequence33 -m latex-pdf}
	\caption{Nice caption.}

My error-message:

File ./images/sequence33.pdf_tex' not found. \input{./images/sequence33.pdf_tex}

I am not allowed to attach a .svg-drawing in this forum. Sry.

You should use \includesvg. I mean, that’s the whole point of using this package.

Sorry, of course… In main.tex:


The actual document:

	\caption{Nice caption.}


Process started: pdflatex -synctex=1 -interaction=nonstopmode --shell-escape "main".tex

sh: line 1: svglatex: command not found
system returned with code 32512
Process exited normally

The document:

Do you have ~/.local/bin in your PATH?

This is usually where pip packages are installed.

Can you run the command in the terminal? How are you compiling your package?

This is what PATH looks like:

(base) [dejhost@Workstation latex]$ cat /etc/profile
# /etc/profile

# Set our umask
umask 022

# Append "$1" to $PATH when not already in.
# This function API is accessible to scripts in /etc/profile.d
append_path () {
    case ":$PATH:" in

# Append our default paths
append_path '/usr/local/sbin'
append_path '/usr/local/bin'
append_path '/usr/bin'

# Force PATH to be environment
export PATH

# Load profiles from /etc/profile.d
if test -d /etc/profile.d/; then
	for profile in /etc/profile.d/*.sh; do
		test -r "$profile" && . "$profile"
	unset profile

# Unload our profile API functions
unset -f append_path

# Source global bash config, when interactive but not posix or sh mode
if test "$BASH" &&\
   test "$PS1" &&\
   test -z "$POSIXLY_CORRECT" &&\
   test "${0#-}" != sh &&\
   test -r /etc/bash.bashrc
	. /etc/bash.bashrc

# Termcap is outdated, old, and crusty, kill it.

# Man is much better than us at figuring this out
(base) [dejhost@Workstation latex]$ 

Should I add
append_path '~/.local/bin' ?

If I run the command pdflatex -synctex=1 -interaction=nonstopmode -shell-escape "main".tex from the shell, I get:

Exception: SVG file “images/sequence33.svg” not found! Cannot export to PDF.
system returned with code 256

in TeXstudio, I still get the

sh: line 1: svglatex: command not found system returned with code 32512
Process exited normally

Here is a screenshot showing the folder structure and the svg:

The .tex-files are in the parent folder.

I’ve now switched to another usepackage:

To insert the svg, I simply write

This does the trick.

Here is an alternative method - in case other readers are looking for more sophisticated method: