google-research / arxiv-latex-cleaner

arXiv LaTeX Cleaner: Easily clean the LaTeX code of your paper to submit to arXiv
Apache License 2.0
5.41k stars 333 forks source link

An option to flatten the file structure. #37

Open suvojit-0x55aa opened 3 years ago

suvojit-0x55aa commented 3 years ago

Although this was made to make text repos compatible with arxiv submission, I think an option to flatten the sub directories will also extend this toll to be useable in submission to other platforms.

Description of the feature: \includegraphics{activation/Activations.pdf} these file include lines can be shortened to \includegraphics{activation_Activations.pdf}

and the activation/Activations.pdf copied to same directory as the tex file.

jponttuset commented 3 years ago

Hi @suvojit-0x55aa, This would definitely be useful, marking it as enhancement to see if someone would be willing to create a PR. Thanks!

tvercaut commented 3 years ago

This would also be a helpful workaround for #26

AndreaMarchetti1996 commented 1 year ago

It would really be useful. I have a Data folder With Pictures where I make a lot of tests and is very disorganised. I keep the latex project in a different folder. It would be nice to have this latex code automatically make a local copy only of the pictures that are really called inside the '.tex' documents

jorsn commented 11 months ago

It should be sufficient to copy all relevant files to the root dir of the archive, discarding any directory structure, if the user does not include any file into the TeX document by path but rather uses TEXINPUTS/\input@path/\graphicspath/BIBINPUTS etc. The unmodified TeX file in the archive should still compile normally, since the root dir is included in all search paths (TEXINPUTS, BIBINPUTS, graphicspath, etc.).

Problems:

  1. Of course one can do stuff in TeX that breaks this, as one can break anything using TeX.
  2. This does not prefix file names. For this to work, the script would always need to change the TeX file (or one programs the prefixing in TeX).
harshakokel commented 1 month ago

+1 This would be really helpful.