# Two identical linked files, instead of one linked file. Linked files preference ignored

**URL:** <https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118>\
**Category:** Help\
**Tags:** ui, linked-files\
**Created:** [January 5, 2022, 9:35am UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118 "2022-01-05T09:35:38Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 5, 2022, 9:35am UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/1 "2022-01-05T09:35:39Z")

</div>

if I add a library, the pdf it auto finds will have two same files.  
all the same. why?

---

<div class="post-metadata">

**Author:** ![ThiloteE](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/thilotee/32/1008_2.png) [@ThiloteE](https://discourse.jabref.org/u/ThiloteE)\
**Post date:** [January 5, 2022, 4:02pm UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/2 "2022-01-05T16:02:22Z")

</div>

More information is needed to answer your question.

More specifically:

1. What method did you use to find pdf for your library?
2. What were your search parameters?

My first estimate would be that if you used the method `search for unlinked local files (Shift+F7)` you have a duplicate of the pdf file in the folder you opted to attach from.

---

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 6, 2022, 12:32am UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/3 "2022-01-06T00:32:08Z")

</div>

I let it auto find pdf file.  
If I add a library, it will find two same pdf files.

---

<div class="post-metadata">

**Author:** ![ThiloteE](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/thilotee/32/1008_2.png) [@ThiloteE](https://discourse.jabref.org/u/ThiloteE)\
**Post date:** [January 6, 2022, 3:42am UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/4 "2022-01-06T03:42:07Z")

</div>

Sorry, i don’t know how to reproduce your issue. More details needed.

Do you have a screenshot?

---

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 6, 2022, 8:30am UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/5 "2022-01-06T08:30:48Z")

</div>

![20220106162855](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/8/8fffdb04850d2221a9313f55d2c506d7dc90343e.png)

---

<div class="post-metadata">

**Author:** ![ThiloteE](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/thilotee/32/1008_2.png) [@ThiloteE](https://discourse.jabref.org/u/ThiloteE)\
**Post date:** [January 6, 2022, 3:23pm UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/6 "2022-01-06T15:23:34Z")

</div>

Ok good. That is something.

Would you be so nice to provide a screenshot of

- `options>preferences>linked files`

Also, could you report, how many pdfs with this name are within the folder 04-AdvOthers? Is it definitely just a single pdf file?

You can check if you left-click on one of the two files within Jabref, then right-click and choose `Open folder`

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/a/a47167eaf03bc1f3eb28e6c4fbd0299560ac9fb4.png)

---

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 7, 2022, 2:22am UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/7 "2022-01-07T02:22:46Z")

</div>

![image](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/4/499c75fcf4968d30910cf0210bf8d67f9582dd74.png)

---

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 7, 2022, 2:23am UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/8 "2022-01-07T02:23:52Z")

</div>

of course, it is definitely just a single pdf file.  
It would not have two same pdf file in a direction

---

<div class="post-metadata">

**Author:** ![ThiloteE](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/thilotee/32/1008_2.png) [@ThiloteE](https://discourse.jabref.org/u/ThiloteE)\
**Post date:** [January 7, 2022, 12:22pm UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/9 "2022-01-07T12:22:27Z")

</div>

Hmm. I have tried a few things, but i cannot reproduce the duplication on

JabRef 5.4–2021-12-20–ab44182  
Windows 10 10.0 amd64  
Java 16.0.2  
JavaFX 17.0.1+1

---

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 8, 2022, 1:24am UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/10 "2022-01-08T01:24:29Z")

</div>

When you click the link, another will show

---

<div class="post-metadata">

**Author:** ![ThiloteE](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/thilotee/32/1008_2.png) [@ThiloteE](https://discourse.jabref.org/u/ThiloteE)\
**Post date:** [January 8, 2022, 11:23am UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/11 "2022-01-08T11:23:46Z")

</div>

Indeed, i was now able to reproduce by manually clicking the link.

If i click on both links i am able to attach the same file twice. Jabref somehow does not detect, that it is a duplicate.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/7/706932e31305687b609d303d67e267f8fe7592d0.png)

I think it is related to this bug:

> <https://github.com/JabRef/jabref/issues/8385>
>
> \### JabRef version
> 
> 5.4 (latest release)
> 
> \### Operating system
> 
> GNU / Linu…x
> 
> \### Details on version and operating system
> 
> Fedora 34 Linux 1 5.15.12-100.fc34.x86\_64 JabRef 5.4--2021-12-20--ab44182 Linux 5.15.12-100.fc34.x86\_64 amd64 Jabref v 5.4 Java 16.0.2 JavaFX 17.0.1+1
> 
> \### Checked with the latest development build
> 
> \- \[\] I made a backup of my libraries before testing the latest development version.
> \- \[\] I have tested the latest development version and the problem persists
> 
> \### Steps to reproduce the behaviour
> 
> 1. assign a directory for all downloaded external files (pdf etc.) Preference -\> Linked Files -\> Main Files Directory
> 2. Open a library and work normally importing a reference useing the web extension
> 3. Close Jabref
> 4. Run Jabref with the library just created at step 2
> 5. Change Linked file preferences. Select Preference -\> Linked Files -\> search and store files relative to library file location.
> 6. Import from the web a new paper using the web extension plugin
> 7. verify that Jabref keeps saving the files in the old location
> 8. Select again the Preference -\> Linked Files -\> Main Files Directory and delete the string of the old directory so that the text field is empty.
> 9. select again Preference -\> Linked Files -\> search and store files relative to library file location
> 10. verify that this time the new preference is applied correctly
> 
> 
> \### Appendix
> 
> 
> !\[Screenshot from 2022-01-04 18-33-46\](https://user-images.githubusercontent.com/97118223/148100465-981903bf-f68f-43b0-af1d-438423d2d5f7.png)

The duplication happens when you have `search and store files relative to library file location` activated while at the same time, the main file directory points (while being deactivated (!), which is the bug) to the same folder your bib file is located in.

The duplication vanishes and thereby your problem will be solved, if you delete the lines that are written in `main file directory` under `options>preferences>linked files`

---

<div class="post-metadata">

**Author:** ![ThiloteE](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/thilotee/32/1008_2.png) [@ThiloteE](https://discourse.jabref.org/u/ThiloteE)\
**Post date:** [January 8, 2022, 11:37am UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/12 "2022-01-08T11:37:27Z")

</div>

The duplication ALSO happens, if you set the main file directory under `library>library properties>Override default file directories>General file directory` to the same folder your bib file is located in and `search and store files relative to library file` is activated.

---

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 8, 2022, 12:33pm UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/13 "2022-01-08T12:33:09Z")

</div>

I have no lines in the main file direction

---

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 8, 2022, 12:33pm UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/14 "2022-01-08T12:33:20Z")

</div>

![image](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/a/ac9dec0885c68dd535f91f97ddf67560dd295a98.png)

---

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 8, 2022, 12:37pm UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/15 "2022-01-08T12:37:27Z")

</div>

![image](https://canada1.discourse-cdn.com/flex030/uploads/jabref/original/2X/1/1fb6c0190c9f994751921d7364c1f8f384a9bdfa.png)

---

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 8, 2022, 12:37pm UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/16 "2022-01-08T12:37:55Z")

</div>

could you solve the problem in the next version?

---

<div class="post-metadata">

**Author:** ![ThiloteE](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/thilotee/32/1008_2.png) [@ThiloteE](https://discourse.jabref.org/u/ThiloteE)\
**Post date:** [January 8, 2022, 12:46pm UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/17 "2022-01-08T12:46:08Z")

</div>

Have you tried restarting Jabref after deleting the lines?

---

<div class="post-metadata">

**Author:** ![xinhongri](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/xinhongri/32/964_2.png) [@xinhongri](https://discourse.jabref.org/u/xinhongri)\
**Post date:** [January 8, 2022, 12:59pm UTC](https://discourse.jabref.org/t/two-identical-linked-files-instead-of-one-linked-file-linked-files-preference-ignored/3118/18 "2022-01-08T12:59:32Z")

</div>

there are no lines before and now
