Giter VIP home page Giter VIP logo

Comments (5)

KelSolaar avatar KelSolaar commented on May 23, 2024 2

@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.

mrpiggi avatar mrpiggi commented on May 23, 2024

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.

larsweiler avatar larsweiler commented on May 23, 2024

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.

mrpiggi avatar mrpiggi commented on May 23, 2024

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.

larsweiler avatar larsweiler commented on May 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.