Comments (5)
@larsweiler : I had the same issue than you, I ended up dealing with it in a transparent and somehow elegant way: I'm using my own inkscape
wrapper, i.e. replacing in $PATH
the one from Inkscape, which gives me a chance to modify the paths, the wrapper calls Inkscape with the same arguments but modified absolute paths. I made a gist available here: https://gist.github.com/KelSolaar/5e24073ffbde03af99d9092580dcf61d
from svg.
Hi,
without a MWE and the resulting log file it's quite difficult for me to help you, because I can't try to reproduce your case. The following MWE worked for me on Windows, where the tex file itself as well as the svg file (pathexample.svg
) are located in the same path, which was additionally given with \svgpath
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{adieresis={รค},germandbls={ร}}
\usepackage{svg}
\svgpath{{C:/Users/Hanisch/Documents/GitHub/svg/test}}
\begin{document}
\begin{figure}
\includesvg[width=\linewidth]{pathexample}%
\caption{Test}\label{fig:example-tex}
\end{figure}
\end{document}
So, without any detailed description, I can't do anything. What does not work? The invocation of Inkscape, the pdf export, or the graphic import in LateX?
from svg.
Hi, thanks for your response.
I try to be more verbose. I stored your example file in /tmp/latex-svg/svg-test.tex
and an svg-file in /tmp/latex-svg/pathexample.svg
. I also changed \svgpath
. When I call pdflatex -shell-escape svg-test.tex
I get the following error:
(/usr/local/texlive/2017/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
** (inkscape-bin:61155): WARNING **: Can't open file: pathexample.svg (doesn't exist)
** (inkscape-bin:61155): WARNING **: Can't open file: pathexample.svg (doesn't exist)
** (inkscape-bin:61155): WARNING **: Specified document pathexample.svg cannot be opened (does not exist or not a valid SVG file)
system returned with code 256
Package svg Warning: The export with Inkscape failed for file
(svg) `pathexample.svg'
(svg) Troubleshooting: Please check in the log file how
(svg) the invocation of Inkscape took place and try to
(svg) execute it yourself in the terminal on input line 9.
! Package svg Error: File `pathexample_svg-tex.pdf' is missing.
See the svg package documentation for explanation.
Type H <return> for immediate help.
...
l.9 \includesvg[width=\linewidth]{pathexample}
In the logfile I see the following Inkscape call:
(/usr/local/texlive/2017/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
))
Package svg Info: Calling Inkscape on input line 9.
runsystem(inkscape -z -D --export-latex --file="pathexample.svg" --export-pdf="pathexample_svg-tex.pdf" )...executed.
Package svg Warning: The export with Inkscape failed for file
(svg) `pathexample.svg'
(svg) Troubleshooting: Please check in the log file how
(svg) the invocation of Inkscape took place and try to
(svg) execute it yourself in the terminal on input line 9.
! Package svg Error: File `pathexample_svg-tex.pdf' is missing.
Just for completion, when I run Inkscape like in the log-file, I get this:
inkscape -z -D --export-latex --file="pathexample.svg" --export-pdf="pathexample_svg-tex.pdf"
** (inkscape-bin:62017): WARNING **: Can't open file: pathexample.svg (doesn't exist)
** (inkscape-bin:62017): WARNING **: Can't open file: pathexample.svg (doesn't exist)
** (inkscape-bin:62017): WARNING **: Specified document pathexample.svg cannot be opened (does not exist or not a valid SVG file)
The problem actually is, that Inkscape on macOS wants full paths for input and output file. When I manually run inkscape -z -D --export-latex --file="/tmp/latex-svg/pathexample.svg" --export-pdf="/tmp/latex-svg/pathexample_svg-tex.pdf"
everything is okay and pathexample_svg-tex.pdf
will be created. Even the final PDF will be properly created with another pdflatex
run.
So, the whole thing is just something special for Inkscape on macOS, which must be called with full paths.
Just let me know, if I need to explain further or help you in testing :)
from svg.
Hi,
this problem is actually caused due to the way how paths are searched by LaTeX. If a file is found within the working directory by it's name, \input@path
is never evaluated. For that reason, the easiest way would be to store the svg files within a subfolder in your working directory and add the absolute path to this folder with \svgpath{/tmp/latex-svg/<subfolder>/pathexample.svg}
. In this case, the absolute path is used for the invocation of Inkscape. Is this a possible solution or do you really need the svg files in the same folder as the tex file?
from svg.
Hi,
I gave it another shot. But I could not find any satisfying solution. I can not change the sources to full paths, as the files are in a collaborative repository. So obviously everyone uses different paths. I also looked into Inkscape, but the problem is in OS X. It might work with a self-compiled version of Inkscape, but I could not get Inkscape compiled.
In the end, I think, we could stop here and I will use a Windows or Linux VM for this project. Thanks for your time and patience with me :)
from svg.
Related Issues (20)
- Including some files from matplotlib fails, commandline works HOT 2
- Importing SVG doesn't work on Windows when the filename contains German special characters
- No helpful error message when inkscape conversion fails HOT 5
- Rendering twice removes the output HOT 1
- \includesvg in Beamer causing wrong figure placement HOT 6
- Bug color/colour of text not correct HOT 2
- Inkscape conversion command deprecated for Inkscape 1.2.2 (2022-12-09) HOT 5
- SVG extracted using `svg-extract` looks different from the original SVG HOT 4
- `svg` package takes the bounding box of the original SVG as opposed to the bounding box resulting from the text conversion HOT 2
- Exporting selected layers HOT 3
- Including two files by the same name results in duplication of the first file HOT 1
- Call inkscape --shell with batches of files for faster processing HOT 4
- Handling for package `svg-extract` only options is flawed when used with package `svg` instead
- TeXstudio autocomplete is not supported by svg package HOT 6
- add support for opt-in ImageMagick instead of Inkscape HOT 4
- Compilation fails for specific images
- Text Reference Displays Section Number Instead of Figure Number with \ref HOT 1
- svg-extract incompatibility with filecontents HOT 1
- includesvg incompatible with setkeys{Gin} HOT 16
- Enhanced support for pandoc HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svg.