Storing Additional Files into attachment folders - LaTeX

Suppose I have attached a file to an item. Zotero automatically creates a new folder with an arbitrary name, for e.g. X49JSXMY.
Suppose I decide to manually copy additional files into this folder (using my OS file explorer an not zotero).
Is it safe ? I mean, can these additional files be altered by zotero (even after sync with the cloud or software update)?

Why I want to do that ?
Because I use LaTeX to generate some reports as pdf. Then, I save these report using zotero by creating a proper item and attach the pdf file to it. I would like to store the LaTeX files used to generate this pdf in the same folder as the pdf. Doing so, I can generate a new pdf with my LaTeX files if I want to and it will directly update the pdf in my zotero library.

So, my goal is to find a way to "link" my LaTeX files to the "automatically generated folder" where the final pdf is stored...
  • Zotero won't touch the files including during sync -- it will also not sync them, so you'd only have them on the device you put them into the Zotero folder. That also means you'd lose the files if you ever wanted to restore your library by syncing it down from the server to an empty version of Zotero.
  • But the files would be deleted during sync if the PDF was modified elsewhere (say, because your PDF reader re-saved it for some reason). I would strongly recommend not putting additional files anywhere within the data directory. This is a Zotero-managed folder, and we can't make any guarantees about unknown files.
  • Thank you both very much for your help !

    @dstillman I understand that it is not a good practice to put additional files and I will definitely try to find another way to do what I want.
    But, to be sure I understand well how zotero deals with files during sync, when you say :
    > the files would be deleted during sync if the PDF was modified elsewhere

    do you mean that if the the two pdf (one in the web library and one locally on my computer which I modify/erase manually without using zotero) are not the same, the local one would be deleted during sync ?
  • No, I'm just talking about normal file syncing: if the remote file has changed and the local one hasn't, the local one will be replaced on sync. I'm just saying that any auxiliary files in the directory would be deleted at the same time.
  • @dstillman Ok it is clear for me. Thanks a lot.

    On more question if I may (not related to your last comment), is there any difference for the library "sync process" if the file has been modified by zotero desktop app or manually by the user with the OS file explorer ? Or the "sync process" just compare the files metadata or something without checking some kind of zotero desktop app log to check the history of modifications...
  • (I didn't realize that, hence the different answer; sorry about that)
  • edited November 17, 2023
    (@adamsmith these things happen, don't worry and thank you very much for your involvement!)
  • @rigal.sylvain: Yes, Zotero itself doesn't modify the actual file. If you don't use an external PDF reader or make other external changes, the file is only ever uploaded when it's created. See Annotations in Database. External changes trigger file uploads, but as that page mentions, that's less efficient and might not happen immediately.
  • @dstillman Very interesting, I didn't know about the annotations, thank you for this discovery.
    Zotero never ceases to amaze me with its power!
    (the sync process seems to be very challenging with multiple users...)
Sign In or Register to comment.