jabref icon indicating copy to clipboard operation
jabref copied to clipboard

Allow relative paths for LaTeX aux file (group definition by cited entries)

Open jorgman1 opened this issue 2 years ago • 5 comments

Is your suggestion for improvement related to a problem? Please describe. I have some groups defined by the citations in a LaTeX auxiliary file. However, the path to the auxiliary file needs to be an absolute path. Thus, it only works in one computer. (I synchronise my library in several computers via ownCloud).

Describe the solution you'd like Allow relative paths when defining groups from aux files

jorgman1 avatar Dec 20 '21 07:12 jorgman1

The following should already work:

  • Library Properties -> LaTeX File directory. Here you can use a relative directory to your aux directory
  • In the group dialog, if you then select the aux file, it will be stored as relative to the above directory

But I just see that there is a paramter which takes the username into account

Siedlerchr avatar Dec 20 '21 15:12 Siedlerchr

While it is a bit unclear, I believe the LaTeX File directory is also user-specific.

refs. JabRef's documentation and https://github.com/JabRef/jabref/issues/4736.

k3KAW8Pnf7mkmdSMPHz27 avatar Dec 20 '21 16:12 k3KAW8Pnf7mkmdSMPHz27

Ahh, I did not know those Path definitions in the Library Properties. They seem to take user and computer name into account. At least they are stored as follows in my bib-file:

@Comment{jabref-meta: fileDirectoryLatex-USER-COMPUTER:PATH;}

I will check it in January with the computer at the university. But that should solve my problem. Thanks a lot!

(I was a bit confused, because in the JabRef preferences the following option can be checked: "Search and store files relative to library file location". I could not find the equivalent for the LaTeX files)

jorgman1 avatar Dec 20 '21 20:12 jorgman1

Just to check, is this issue solved?

ilippert avatar Jun 18 '22 10:06 ilippert

Sorry for my delay answering. I completely forgot about it. I tried the suggestion from Siedlerchr, but it does not work (JabRef 5.7--2022-06-15--cb5fe60). If I use an absolute path for the LaTeX File directory, then I can use a relative Path in the group dialog. That makes sense. Unfortunately, the group remains empty. However, if I remove the LaTeX File directory and use an absolute path in the group dialog, the group is populated correctly. But this solution only works on one computer.

jorgman1 avatar Jun 18 '22 11:06 jorgman1

I think this is due to a bug -- cf. #9990

@jorgman1 If these files still exist and it is still relevant, can you please check whether the username set correctly for your second host in the bib file:

@Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}

and that it is not

@Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:C:\\Path\\A;}
@Comment{jabref-meta: fileDirectoryLatex-UserA-HostB:C:\\Path\\B;}

lcnittl avatar Jun 08 '23 07:06 lcnittl

Using the latest version (JabRef 5.10--2023-06-15--710e1f2) I still have an error. The username is set correctly only for one host, the second host does not save a username:

@Comment{jabref-meta: fileDirectoryLatex--HostB:PathB;} @Comment{jabref-meta: fileDirectoryLatex-UserA-HostA:PathA;}

Moreover, when I try to edit the group and select an Aux file, I get an error (on both hosts, even if the LaTeX file directory is not set). This error is new. Error_log.txt

jorgman1 avatar Jun 16 '23 12:06 jorgman1

I think we need to get all entries and check which belongs to the username @calixtus @koppor Did you recently refactored anything regarding the file listener?

Siedlerchr avatar Jun 16 '23 14:06 Siedlerchr

No, I remember looking at it, when I discovered that we have a DummyFileMonitor, but I don't think anyone refactored it for quite some time.

calixtus avatar Jun 16 '23 18:06 calixtus

Maybe related to the change of getUser to getUserAndHost?

calixtus avatar Jun 16 '23 18:06 calixtus

Maybe related to the change of getUser to getUserAndHost?

The issue occurred before. Need to investigate.

koppor avatar Jun 19 '23 09:06 koppor