Giter Site home page Giter Site logo

inkscape-figures's People

Contributors

gillescastel avatar kunzaatko avatar michaelmaex avatar miguelraz avatar pierreglaser avatar soptikha2 avatar yujie6 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

inkscape-figures's Issues

Stop watch?

inkscape-figures stop to stop the daemon - I can submit a PR later.

Inkscape-figures watch has no response or log on MacOS

@pierreglaser
sorry for bother you again,
I reinstalled it for my default python, and all goes well if I do things we do the last day.
But I find that the svg cannot be saved as pdf and pdf_tex automatically, and when I run the command"Inkscape-figures watch"
there is not any response or log.
So what should I do to get the error report now?

How to make this work in macvim?

I use macvim, which, from what I understand, is supposed to be very similar to vim. Almost everything about this tool works for me, except that when I hit control+F to create a file, Inkscape always seems to glitch out. In particular, when I hit control+F in insert mode, Inkscape will be launched, but then will quit itself before opening up anything. But I can still edit: When I hit control+F in command mode, I can select the file I want to edit, and the tool launches Inkscape just fine. I'm pretty new to all this, so I was wondering if anyone has advice on how to fix this. Thanks!

Unable to lock on the pidfile

Everything ran fine on my old MacOS 11.3, but somehow I decided to update to 12.3.1 Monterey... What a terrible mistake. Now when running
Inkscape-figures watch
for the first time as part of my ~/.zprofile, an error occurs: "Unable to lock on the pidfile." Subsequently cmd+s in Inkscape will no longer save properly.

However, when running with the Inkscape-figures watch --no-daemon option, there is no such error.

A temporary solution to this issue appears to be: in a separate terminal, run Inkscape-figures watch --no-daemon every time you need it to work.

Is there a better fix?

VScode configuration

Hi there!
I'm working on the configuration work for almost 1 week, and now I'm glad to say that I somehow manage to let everything happen under macOS + VSCode(without shortcut-manager). I'm wondering that whether it's possible to add a folder for VSCode configuration. I'm quite excited to share all this with everyone, especially at this moment since I know how tough to put all these together with little resources online.
I don't want to put this only in my personal repo, I think here is the best place for this.

rofi pops up when creating new figure

I had all the features working correctly for about 20 min
but for some reason after creating about 5 figures when i tried to make a new one
the rofi window opened instead of inkscape.

No matter what I can only edit already created inkscape files.
I tried deleting all the files in the figures directory
because I thought maybe there was a limit,
but now when I type a title and hit control f rofi opens with no files available
to choose.

'inkscape-figures watch' seems to have run correctly as it outputs
'Unable to lock on the pidfile.'

Not sure what info is needed to help solve the problem
but my OS is ubuntu 21.10

EDIT: Im dumb and didnt realize you had to be in insert mode

File save is not registered when using WSL

I am running Ubuntu 22.04.3 through WSL 2 on Windows 11. Even while running the inkscape-figures watch command, saving the inkscape figure is not recognized by the program, and the .pdf_tex file is not created.

watch not working on macOS

Hey, I can't get "watch" working by saving .svg in Inkscape. Have anyone had the same issue on macOS and got it working? Is there any package I need or change I can make?
I am using macOS Catalina 10.15.7 and Inkscape 1.0.1.

I have actually found a way by adding mapping to vim to call terminal, but I would like to automate it.
nnoremap <C-s>: ! for FILE in ./figures/*.svg; do inkscape -D $FILE -o .pdf --export-latex; done

I also tried this but didnt work at all.

I am quite new into vim, Latex and working with terminal, will be very happy for any advice.

Syntax error on v1.0.4

Hi Giles!

This is a fantastic package and I 've begun taking my classnotes with your setup.

I've yet to be able to setup the figures because of the following error.

Cheers!

Ubuntu 16.04

mrg@mrg-> sudo pip install inkscape-figures 
...

mrg@mrg~> inkscape-figures
Traceback (most recent call last):
  File "/usr/local/bin/inkscape-figures", line 3, in <module>
    from inkscapefigures import cli
  File "/usr/local/lib/python2.7/dist-packages/inkscapefigures/__init__.py", line 1, in <module>
    from .main import cli
  File "/usr/local/lib/python2.7/dist-packages/inkscapefigures/main.py", line 28
    rf"    \incfig{{{name}}}",
                            ^
SyntaxError: invalid syntax

Inkscape opening over tiled windows

In the blog, when Castel uses ctr + f an inkscape window opens up on top of both the tilted terminal and zathura. This is seen from here https://castel.dev/a48c6ef9b7407f13e4e0e86b2649333f/including_figure.gif.

On a closer look, it looks as if desktop environment number is changed.

When I try execute ctr + f however, I get third window in the sense that my screen is split into 3 things - the terminal, zathura, and inkscape.

Does anyone know how I can get the behavior in the gif?

PS: I am using bspwm as I think Castel uses it too?

File watcher does not run

After hitting Ctrl-F on a line with the figure name in my .tex file, steps 1 thru 5 execute properly, but the file watcher (step 6) does not run immediately after opening the .svg template, Vimtex returns a compile error

The :VimtexCompileOutput is:

! LaTeX Error: File `test.pdf_tex' not found.

Type X to quit or <RETURN> to proceed, 
or enter new name. (Default extension: pdf_tex)

Enter file name: 
./test.tex:24: Emergency stop.
<read *> 
         
l.24     \incfig{test}
                      ^^M                     
./test.tex:24:  ==> Fatal error occurred, no output PDF file produced!
Transcript written on test.log.
=== TeX engine is 'pdfTeX'
Latexmk: Errors, so I did not complete making targets 
vimtex_compiler_callback_failure

Where is the "inkscape-figures watch" command executed? Should this be added to the vim mapping?

Figures directory

It would be nice if the figures directory could be created automatically in case that it does not exit

Error: undefined variable: b:vimtex

hi, gillescastel
I try to use your python program on my wsl. after I map the <C-F>, then I enter the key, the vim show me an error: undefined variable: b:vimtex.
I do wrroy about it. Do I lost some step?

by the way, I find your python program use Popen(['inkscape..., but I just want to use inkscape in Windows, which should use /path/to/inkscape.exe reasonablely. Will it be a good idea to configue it?


easy way to deal with it: append alias inkscape='"/mnt/c/Program Files/Inkscape/inkscape.exe"', then it will work well.(but it need command like this: subprocess.run(['/bin/zsh', '-i', '-c', 'inkscape']))

launching Inkscape on macOS

Ctrl+f doesn't launch Inkscape, although it does create the file in the right position and with the right name (at least for the 1.0beta, the only version which is not dependent on xquartz yet).

Solution:
in 'inkscapefigures' folder in 'main.py' file, inside 'def Inkscape(path):'

subprocess.Popen path is set to "/Applications/Inkscape,set(path)" while this would not work, as its not an executable file (at least that's the reason I found for), and must be changed to:

"/Applications/Inkscape.app/Contents/MacOS/inkscape",str(path)

works like a charm.

thanks a lot for all of your work and sharing. you made me learn ViM from scratch, and build an amazing notes taking machine. your articles and repository are pure gold!

Fzf instead of choose for MacOS

Hey, I'm quite a newbie, so apologies if I'm not supposed to ask questions here...

I have fzf installed, would this work if I just change 'choose' for 'fzf' in the picker.py file?
If not, is it okay to have both fzf and choose installed just for this to work?

Appreciate any response and thanks a lot for all your work, has been such a great aid!

Clipboard only working when figure changed

The latex template of the figure is only copied to clipboard when the figure that is being edited is accually changed. This is due to the clipboard copying being triggerd in the file watcher and that gets triggered only when something changes in the figure.

This can be a problem if you have some figures that you decide to add to the document after removing them earlier without making any changes.

dyld[1317]: Library not loaded: ’@rpath/libinkscape_base.dylib’

Hi, When I use crtl + F in the insert mode, I got a issue below.
Is I missing a file called ibinkscape_base.dylib?
I try to find it on the internet, but there are not much information about that.

\begin{figure}[ht]
7 \centering
6 \incfig{image1}
5 \caption{image1}
4 \label{fig:image1}
3 \end{figure}
2 dyld[1317]: Library not loaded: ’@rpath/libinkscape_base.dylib’
1 Referenced from: ’/Applications/Inkscape.app/Contents/Resources/bin/inkscape’
32 Reason: tried: '/Applications/Inkscape.app/Contents/Resources/bin/../Resources/lib/libinkscape_base.dylib' (no such file), '/Applications/Inkscape.app/Contents/Resources/bin/../Resources/lib/inksca...

Mahalo

Inkscape window gets closed immediately after creating figure

Hello,

First of all, thanks a lot for this amazing tool! It works great except this one little bug that annoys me.

When I write the filename (say testfile) on a new line and press ctrl+f, the text is replaced with the \incfig command as it should be. However, then I see (surprisingly) two Inkscape icons appearing at the bottom of the screen and then they disappear immediately. The edit function works well, i.e. if I press ctrl+f in normal mode and select the file (Testfile) just created, then an Inkscape window opens and everything works fine. Though I would really be happy if the issue with the create could be solved.

I also used the

Inkscape-figures create testfile

command to create the figure and observed the same thing.(Inkscape icons appearing and then immediately disappearing) However this time it gave me the following output

Fontconfig warning: ignoring UTF-8: not a valid region tag

(org.inkscape.Inkscape:76263): GLib-CRITICAL **: 14:48:39.705: g_date_time_format: assertion 'datetime != NULL' failed

(org.inkscape.Inkscape:76263): GLib-CRITICAL **: 14:48:39.707: g_date_time_format: assertion 'datetime != NULL' failed

(org.inkscape.Inkscape:76263): GLib-CRITICAL **: 14:48:39.708: g_date_time_format: assertion 'datetime != NULL' failed

(org.inkscape.Inkscape:76263): GLib-CRITICAL **: 14:48:39.709: g_date_time_format: assertion 'datetime != NULL' failed
Shortcut::add_shortcut: duplicate shortcut found for: <Primary>comma  Old: app.preferences  New: app.transform-scale(0.5) !

I am using MacOS if it makes a difference.

Thanks a lot!

keymapping on vimrc doesn't work

Hello, Gillies!

I am working to set up a latex environment that you posted in the blog on Ubuntu.
Currently I have everything done, but the key mapping doesn't seem to work

I included the keymapping code to my vimrc but it doesn't seem to execute inkscape.

:!inkscape-figure create sometitle works on vim but it's the mapping on vimrc that doesn't work, I guess?

Could you help me figure out the problem? Thanks a lot.

Command flags of inkscape 1.0 have changed

Inkscape 1.0 (currently in beta) has drastically changed its command line interface. In particular, it has deprecated --export-pdf. We should probably check the version of Inkscape using subprocess.check_output(['inkscape', '--version']) and based on that use the appropiate flags.

Shortcuts not working after update 5b275a35d9 (2020-05-03)

After the recent update, this script stopped working. It still detects the windows but no shortcut has any effect.
The keybinding are the Inkscape's default ones so when I for example press t the text tool opens, not the roxi window.
Launching Inkscape with inkscape -V shows this output

Inkscape 1.0 (5b275a35d9, 2020-05-03)
    Pango version: 1.40.14

I am using Ubuntu Budgie and the update just came in.

Saving the figure

When saving the figure on macOS, using cmd+S, the figure is not automatically saved as a pdf and pdf_tex file. I have to manually use cmd+shift+S to save it as pdf. The file is only saved as SVG when using cmd+S.

Shouldn't the file be automatically saved as pdf when saving the file, according to the README?

Command flags of inkscape 1.1 have changed

Inkscape 1.1 (currently dev edition) has changed it's option --export-file to --export-filename. This means that current release of inkscape-figures doesn't work with Inkscape 1.1 and latter. I don't know which versions do and don't work and when the change occured.

This is fixed in pull request #19.

Tested with Inkscape 1.1-dev (3a9df5bcce, 2020-03-18).

Strange rapid glitching

Hello,
I have installed the inkscape-figures on MacOS and I run automatically at system startup a very simple script (via Automator)
#!/bin/bash
inkscape-figures watch
so that I don't have to open terminal and set figures watch manually.

Everything works pretty well despite the fact that a few times a day I encounter something really strange happening.
Out of nowhere, my inkscape starts to very rapidly open and close. I mean, very rapidly. If I had opened any text editor at that time I barely could type anything because of the rapidly opening and closing inkscape threads.

I've been trying to figure out what keyboard keys combination might trigger such behaviour and what combinations might stop that loop. Unfortunately, I could not comprehend any of this. Sometimes that loop starts when I don't even type anything, sometimes it stops when I type random keys or focus on some other windows. Sometimes it doesn't stop at all and I have to hard restart my Mac.

Could you please help me with that problem?
Best wishes!

Do not understand inkscape-figures

Hi!
This might be a dumb question but I don't know how to run the inkscape-figures watch on the terminal. I always get the "Command not found". What am I doing wrong? I straight up typed inkscape-figures watch in the terminal inside the folder I'm working in.
What confuses me is that it's the first time I see a python library(I call it like that because I installed it through pip) ran directly from the terminal, as if I were to run $numpy and something would happen.
Thanks in advance.

No pdf/pdf_tex created because of unexpected(?) inkscape_version_number

When trying to use the functionality to automatically save as pdf and pdf_tex when saving as svg no output was generated for me. (I ran the watch command before.) I followed the advice of this comment and got the following output:

Debug output log
DEBUG:inotify.adapters:Events received from epoll: ['IN_ACCESS']
DEBUG:inotify.adapters:Events received in stream: ['IN_CLOSE_WRITE']
INFO:inkscape-figures:Recompiling /home/towa/tex-test/figures/hallo3.svg
DEBUG:inkscape-figures:Inkscape 0.92.4 (5da689c313, 2019-01-14)

Traceback (most recent call last):
  File "/home/towa/.local/bin/inkscape-figures", line 4, in <module>
    cli()
  File "/home/towa/.local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/towa/.local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/towa/.local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/towa/.local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/towa/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/towa/.local/lib/python3.7/site-packages/inkscapefigures/main.py", line 113, in watch
    watcher_cmd()
  File "/home/towa/.local/lib/python3.7/site-packages/inkscapefigures/main.py", line 213, in watch_daemon_inotify
    maybe_recompile_figure(path)
  File "/home/towa/.local/lib/python3.7/site-packages/inkscapefigures/main.py", line 131, in maybe_recompile_figure
    inkscape_version_number = float(inkscape_version.split()[1].split('-')[0])
ValueError: could not convert string to float: '0.92.4'
DEBUG:inotify.adapters:Cleaning-up inotify.

Running inkscape --version gives Inkscape 0.92.4 (5da689c313, 2019-01-14). I don't know what the expected output here is but apparently this string can't be processed further.

Inkscape-figures command not found

I installed inkscape-figures with :
pip3 install inkscape-figures

But when I write in a terminal:
inkscape-figures watch

It says : zsh: command not found: inkscape-figures

my Python version is 3.7.3. The result for the installation of inkscape-figures with pip3 is:

Requirement already satisfied: inkscape-figures in ./.local/lib/python3.7/site-packages (1.0.8) Requirement already satisfied: daemonize in ./.local/lib/python3.7/site-packages (from inkscape-figures) (2.5.0) Requirement already satisfied: appdirs in ./.local/lib/python3.7/site-packages (from inkscape-figures) (1.4.4) Requirement already satisfied: pyperclip in ./.local/lib/python3.7/site-packages (from inkscape-figures) (1.8.0) Requirement already satisfied: inotify in ./.local/lib/python3.7/site-packages (from inkscape-figures) (0.2.10) Requirement already satisfied: click in ./.local/lib/python3.7/site-packages (from inkscape-figures) (7.1.2) Requirement already satisfied: nose in ./.local/lib/python3.7/site-packages (from inotify->inkscape-figures) (1.3.7)

I don't know why the last week it works but now it doesn't. I change my work-file directory, maybe is that but no idea how to solve it...

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.