Giter Site home page Giter Site logo

Comments (17)

cuppajoeman avatar cuppajoeman commented on July 17, 2024

I have a similar problem.
Where/when should the inkscape watch command be executed?

from inkscape-figures.

gillescastel avatar gillescastel commented on July 17, 2024

When you create a figure, the watcher should normally start watching the directory.
What OS you using? What's the content of ~/.config/inkscape-figures/roots?
What happens when you execute inkscape-figures watch?

from inkscape-figures.

cuppajoeman avatar cuppajoeman commented on July 17, 2024

Hello Gilles,

This is what happens when I try to use inkscape-figures, this video also contains what roots looks like and what happens when I execute watch.

https://streamable.com/eglz4

from inkscape-figures.

gillescastel avatar gillescastel commented on July 17, 2024

Thanks! What I said wasn't correct. Creating a figure doesn't start the file watcher, it merely adds the folder to the list of folders that should be watched. Actually starting the watcher should be done by executing inkscape-figures watch once. I saw that the first time you executed that command, there was no output (which is expected). The second time you ran it, it gave an error about not being able to lock a pid file. This means that the file watcher is running.

Please edit and save the figure you've just created. I think (and hope) that now the script will compile the figures as expected. Please report back!

from inkscape-figures.

cuppajoeman avatar cuppajoeman commented on July 17, 2024

Hi Gilles,

Here is a recording of what happens when I run the watcher and create the file

https://streamable.com/6ox8z

It doesn't seem to be compiling the figure correctly but it is generating the pdf_tex.

After that if I run the watcher again the output is as expected (my vim seems to glitch, but I believe that's unrelated and that usually doesn't happen)

https://streamable.com/s4owt

from inkscape-figures.

mcgoldba avatar mcgoldba commented on July 17, 2024

Thanks Gilles! I am not at a place were I can try your last recommendation, but I did look at this some more yesterday. I was able to successfully create the .pdf_tex file and compile the document without any error if I manually went back to vim after Ctrl-f opened inkscape and ran the command

.!inkscape-figures watch

After this I can edit the figure, save it, and compile the document successfully. However, If I recall correctly it requires me to manually call the watch command every time, and it doesn't work if I run this command before hitting Ctrl-f or running it directly from the console, I get the same 'pid' error (Although I may be wrong on this point). I will look into more tonight.

By the way I am running Ubuntu linux from a Acer chromebook through a crouton.

from inkscape-figures.

mcgoldba avatar mcgoldba commented on July 17, 2024

I get the same result as cuppa with your most recent suggestion. The only way I can get the figure to appear properly is if it implement the watch command after hitting Ctrl-f and before Ctrl-s in inkscape.

from inkscape-figures.

cuppajoeman avatar cuppajoeman commented on July 17, 2024

Hi Gilles,

Do you have any suggestions for when/how to run the watch command?

Thanks,
cup

from inkscape-figures.

cuppajoeman avatar cuppajoeman commented on July 17, 2024

@mcgoldba Have you come up with a workaround?

from inkscape-figures.

mcgoldba avatar mcgoldba commented on July 17, 2024

Not yet. I haven't had time to look at it recently. I did try to start the watcher with a revised vim mapping for Ctrl-f... but it didn't work. I had something like:

inoremap <C-f> <Esc>: silent exec '.!inkscape-figures create "'.getline('.').'" "'.b:vimtex.root.'/figures/" && .!inkscape-figures watch'<CR><CR>:w<CR>

from inkscape-figures.

gillescastel avatar gillescastel commented on July 17, 2024

What version of inkscape and python are you using? I've added some debugging options to version 1.0.1.
You can install it as follows:

pip install inkscape-figures==1.0.1

Now, if you run

LOGLEVEL=DEBUG inkscape-figures watch --no-daemon

you should get some debugging output.

Now, in another terminal, execute

inkscape-figures create "Figure 1"
inkscape-figures edit

and select "Figure 1". Upon saving, the directory should contain "figure-1.pdf_tex" or something similar.
Please attach the output of the watch command.

from inkscape-figures.

cuppajoeman avatar cuppajoeman commented on July 17, 2024

Hi Gilles,

I currently am using python3.7 and am using inkscape version 0.92.3,

Here is the the output of the watch command:

INFO:inkscape-figures:Watching figures.
DEBUG:inotify.adapters:Inotify handle is (3).
DEBUG:inotify.adapters:Adding watch: [/home/c-u-p/.cs]
DEBUG:inotify.adapters:Added watch (1): [/home/c-u-poots]
INFO:inkscape-figures:Watching directories: /home/c-tex-example/figures, /home/c-u-p/My_Files/School/223
DEBUG:inotify.adapters:Adding watch: [/home/c-u-p/fi
DEBUG:inotify.adapters:Added watch (2): [/home/c-u-p
DEBUG:inotify.adapters:Adding watch: [/home/c-u-p/la
DEBUG:inotify.adapters:Added watch (3): [/home/c-u-p
DEBUG:inotify.adapters:Adding watch: [/home/c-u-p/Myk 4/figures]
DEBUG:inotify.adapters:Added watch (4): [/home/c-u-pWeek 4/figures]

Here's a video of me using inkscape figures, and the output.
https://streamable.com/fecql

from inkscape-figures.

gillescastel avatar gillescastel commented on July 17, 2024

It looks like everything is working just fine? Whenever you save the svg, the figure gets recompiled and the pdf_tex/pdf files get created. Is there still something that doesn't work as expected or has your problem been solved?

from inkscape-figures.

mcgoldba avatar mcgoldba commented on July 17, 2024

I am using Inscape 0.91 r13725.

Here is the output:

INFO:inkscape-figures:Watching figures.
DEBUG:inotify.adapters:Inotify handle is (4).
DEBUG:inotify.adapters:Adding watch: [/home/mcgoldba/.config/inkscape-figures/roots]
DEBUG:inotify.adapters:Added watch (1): [/home/mcgoldba/.config/inkscape-figures/roots]
INFO:inkscape-figures:Watching directories: /home/mcgoldba/summer2019/ucsd_fund_ml/test/figures, /home/mcgoldba/summer2019/gt_dsn_opt/lecturenotes/module5/figures, /home/mcgoldba, /home/mcgoldba/test/figures, /home/mcgoldba/summer2019/gt_dsn_opt/mynotes/figures
DEBUG:inotify.adapters:Adding watch: [/home/mcgoldba/summer2019/ucsd_fund_ml/test/figures]
DEBUG:inotify.adapters:Added watch (2): [/home/mcgoldba/summer2019/ucsd_fund_ml/test/figures]
DEBUG:inotify.adapters:Adding watch: [/home/mcgoldba/summer2019/gt_dsn_opt/lecturenotes/module5/figures]
DEBUG:inotify.adapters:Added watch (3): [/home/mcgoldba/summer2019/gt_dsn_opt/lecturenotes/module5/figures]
DEBUG:inotify.adapters:Adding watch: [/home/mcgoldba]
DEBUG:inotify.adapters:Added watch (4): [/home/mcgoldba]
DEBUG:inotify.adapters:Adding watch: [/home/mcgoldba/test/figures]
DEBUG:inotify.adapters:Added watch (5): [/home/mcgoldba/test/figures]
DEBUG:inotify.adapters:Adding watch: [/home/mcgoldba/summer2019/gt_dsn_opt/mynotes/figures]
DEBUG:inotify.adapters:Added watch (6): [/home/mcgoldba/summer2019/gt_dsn_opt/mynotes/figures]
DEBUG:inotify.adapters:Events received from epoll: ['IN_ACCESS']
DEBUG:inotify.adapters:Events received in stream: ['IN_CLOSE_WRITE']
INFO:inkscape-figures:Recompiling figure-1.svg
DEBUG:inkscape-figures:Running command:
DEBUG:inkscape-figures:inkscape --export-area-page --export-dpi 300 --export-pdf /home/mcgoldba/figure-1.pdf --export-latex /home/mcgoldba/figure-1.svg
DEBUG:inkscape-figures:Command succeeded
DEBUG:inotify.adapters:Events received from epoll: ['IN_ACCESS']
DEBUG:inotify.adapters:Events received in stream: ['IN_CLOSE_WRITE']
DEBUG:inkscape-figures:File has changed, but is nog an svg
DEBUG:inotify.adapters:Events received in stream: ['IN_CLOSE_WRITE']
DEBUG:inkscape-figures:File has changed, but is nog an svg

It seems that the .pdf_tex file is created correctly in this casea, and when I run within vim using the command with the debugger running. If I try to run without the debugger active, no .pdf_tex file is created.

from inkscape-figures.

cuppajoeman avatar cuppajoeman commented on July 17, 2024

When I run inkscape-figures watch, in a terminal somewhere else, and then start editing my document and adding figures it works!
I believe I have the same behavior as mcgoldba as if I don't have inkscape-figures watchin running somewhere, the pdf_tex is not generated.

from inkscape-figures.

rieunity avatar rieunity commented on July 17, 2024

I get the similar problem in the latest version 1.0.4 and solve it by edit the insert map in the tex.vim as following:inoremap <C-f> <Esc>: silent exec '.!inkscape-figures create "'.getline('.') .'" "'.b:vimtex.root.'/figures/";inkscape-figures watch'<CR><CR>:w<CR>
It seems that this is equivalent to the condition that we type the watch command after creating and before closing the inkscape.

Hope this comment can solve someone's problem.

from inkscape-figures.

gillescastel avatar gillescastel commented on July 17, 2024

Closing this issue as it looks like it is working for most people. If anyone still has similar problems, feel free to open a new issue.

from inkscape-figures.

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.