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

Cannot copy to desired directory #3

Closed max-prime-math closed 1 year ago

max-prime-math commented 1 year ago

In Windows it seems like Super Figure copies the template to the root folder that VSCode has opened, and not the directory of the tex file being edited. So if I am editing file vscode-folder/latex-folder/file.tex then running Super Figure inside file.tex on text fig will copy the template to vscode-folder/fig.svg instead of vscode-folder/latex-folder/fig.svg.

I'm not sure if that's the intended behaviour, but I think it would make more sense for the template to be copied to the same directory as the tex file that's being edited. Super Figure works as intended if your tex file is in the root of the VSCode folder, but not anywhere else.

I wonder if it's in the definition of ${dir}?

Joao-Peterson commented 1 year ago

That's intended behavior, i opted to use the workspace folder as the relative directory for executing commands and copying files.

If you want to create an image, say in vscode-folder/latex-dir/images/fig, then it is simple as write it down as such, but you wouldn't be able to compile latex as usual, so i prefer to just open the latex folder in itself. Maybe i should emphasize that better in the README.

Well, it was easier to code in this way and more intuitive, at least to me, sorry but this is the way i would like things to work.

max-prime-math commented 1 year ago

That's too bad. I wonder how hard it would be to make the adjustment to copy the files into the directory of the tex file. Doing so wouldn't interfere with its current functionality.

Joao-Peterson commented 1 year ago

What can be done is a option for a relative folder, so if edit the tex file vscode-folder/latex-folder/file.tex and you would want to save the images to the folder vscode-folder/latex-folder/images/, then the relative folder option should be set to ./latex-folder, then a image named images/fig.svg will be saved on the path latex-folder/images/fig.svg.

That's an option, and people like me who would opt for using the root vscode folder as is, can also use it in that way.

max-prime-math commented 1 year ago

That's interesting. I'll try that out!

Joao-Peterson commented 1 year ago

Try what? that's not a option at this time. Or are you gonna make a PR?

If not i will try and make time this next week and program this option.

max-prime-math commented 1 year ago

I misunderstood - I thought you had already implemented this. I won't be able to make a PR at this time since I am still grappling with how vscode extensions are built.