Joao-Peterson / super-figure

Super figure is a vscode extension that implements integration for Inkscape and Gimp as means to quickly launch and edit figures and see the results is your Latex or Markdown files
https://marketplace.visualstudio.com/items?itemName=peterson.super-figure
MIT License
16 stars 1 forks source link

onSave #6

Closed midpl0x closed 11 months ago

midpl0x commented 1 year ago

Hi,

So, I've been tryting to use Super-Figure for the last few days, but I have issues with the onSave commands. You refer to them in your readme, but you dont really explain what it really means?

Where am I supposed to add the onSave commands? I've tried with VS Code in settings.json, but that didnt seem to do anything.

Am I missing something? Otherwise, everything seems to work!

Thank you for making this!

Joao-Peterson commented 1 year ago

Hi, it appears i kinda brushed it over on how to actually change this configurations, but i did it because configuring vscode extensions is common knowledge for many people, so i assumed it.

But i see many people who are not into programming here so let me give you a quick rundown, on vscode, to change configurations just hit ctrl+shift+p, search for settings JSON, then a json file will open, now just start typing the extension name, superfigure, and the autocomplete will suggest all the configurations available.

Remember, onSave commands are arguments to call the configured program you are using, for example, if onSave for bitmap is just 'a', then ater you save a bitmap, the extension will run this command on a new subprocess: 'gimp a'.

Hope this helps. You can also read this official vscode guide

midpl0x commented 1 year ago

I'm probably just an idiot, but I have added the "super-figure.onVectorFileSave": "${executable} ${file} --export-area-page --export-dpi 300 --export-type=pdf --export-latex --export-filename ${dir}/${basename}.pdf" to settings.json, and no pdf_tex-file is created on save.

Though, the settings.json in the .vscode folder states the files is to be watched, and the path is correct. :(

Joao-Peterson commented 1 year ago

by default, inkscape is used for opening and saving vector images, are you editing a vector image? also, do you have inkscape installed?

If those checks out, please, tell me what OS are you running and reply here with the console output for the extension, which can be found by opening the integrated terminal, then click the output tab, then on the dropdown on the right select Superfigure.

midpl0x commented 1 year ago

I'm running Windows 10. I also have inkscape installed. I can make it launch from VS Code, as intended, but nothing happens when I save the file. It also doesn't launch every time, even though the output says something along the lines of "launching inkscape".

output2

Thank you for taking your time with this! It's greatly appreciated!

Joao-Peterson commented 1 year ago

That's strange, im gonna try and reproduce it on a windows machine, i use linux on mine.

Joao-Peterson commented 11 months ago

sorry for the wait, busy year. Tested and working on windows