# Make file field easily usable in LaTeX documents

**URL:** <https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218>\
**Category:** Features\
**Created:** [September 20, 2016, 7:38pm UTC](https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218 "2016-09-20T19:38:25Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![doncherry](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/doncherry/32/48_2.png) [@doncherry](https://discourse.jabref.org/u/doncherry)\
**Post date:** [September 20, 2016, 7:38pm UTC](https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218/1 "2016-09-20T19:38:25Z")

</div>

I’d like to embed the pdf file associated with a biblatex entry into my LaTeX document using the value of the `file` field. Currently it not only stores the file path (be it full or relative) but also a description and the file type, which makes it hard to retrieve only the path. Even though biblatex styles don’t use this field afaik, the documentation specifies that the field should (olny) contain the link:

> `file` field (verbatim)  
> A local link to a pdf or other version of the work. Not used by the standard bibliography  
> styles.

The additional information about the file type and description could probably be stored in some other, custom field, since it is only used by JabRef.

Related discussion on tex.sx: [How to embed a PDF file specified in the file field via JabRef?](http://tex.stackexchange.com/q/329062/4012)

* * *

Please vote if you support this proposal:

_Poll ([view on site](https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218/1))_

---

<div class="post-metadata">

**Author:** ![joerg.lenhard](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/joerg.lenhard/32/9_2.png) [@joerg.lenhard](https://discourse.jabref.org/u/joerg.lenhard)\
**Post date:** [September 21, 2016, 8:18am UTC](https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218/2 "2016-09-21T08:18:41Z")

</div>

Although I agree that just storing the link would actually be nice, changes in the syntax of the serialization are quite critical. The problem is that the syntax of the file field has existed for a long time and by now other editors and systems depend on it, it is not just used by JabRef, [see also this discussion](https://github.com/JabRef/jabref/issues/98). Hence, we cannot modify it easily without breaking other tools and such a decision is not easy to make. We need very convincing and very strong arguments for doing such a change. A mandatory predefined syntax in the specification would be such a very strong argument, but this does not exist. At least the description you cite is far too vague for me to justify (i) the effort that would be involved in such a change and (ii) to annoy all the people who depend on the current format.

---

<div class="post-metadata">

**Author:** ![doncherry](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/doncherry/32/48_2.png) [@doncherry](https://discourse.jabref.org/u/doncherry)\
**Post date:** [September 21, 2016, 8:40am UTC](https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218/3 "2016-09-21T08:40:50Z")

</div>

I agree, this backwards-compatability is important. Here’s an idea to cater for everybody’s needs: Introducing an option in the preferences for the file field:

- Use the `description;path;type` format
- Use the bare path …
  - … with escaping
  - … without escaping

Or the bare path option could just always be unescaped. The first option would be the standard, presumably. Always using forward slashes to specify directories should work best for LaTeX, I think.

One thing I can’t judge is the amount of work involved in this, but I would definitely appreciate having the bare path!

---

<div class="post-metadata">

**Author:** ![joerg.lenhard](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/joerg.lenhard/32/9_2.png) [@joerg.lenhard](https://discourse.jabref.org/u/joerg.lenhard)\
**Post date:** [September 21, 2016, 9:08am UTC](https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218/4 "2016-09-21T09:08:37Z")

</div>

A preference option that allows you to explicitly switch to a bare format might be a compromise. This would also ease migration from the old format in a sense.

Someone would need to implement it of course. I’ll be honest: Refactoring the file field is not our top-most priority at the moment. So, unless someone volunteers, you probably won’t see an advance on this very soon. I cannot speak for the others of course. Maybe one of the developers really wants the feature and then it can be very quick.

---

<div class="post-metadata">

**Author:** ![doncherry](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/doncherry/32/48_2.png) [@doncherry](https://discourse.jabref.org/u/doncherry)\
**Post date:** [September 21, 2016, 9:36am UTC](https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218/5 "2016-09-21T09:36:44Z")

</div>

I totally understand, and I’ve found a workaround for my specific use case: Manually putting the file path into the `addendum` field of the entries where I need it. But for general cases, you don’t happen to have an idea how to extract the path from the `file` field (as it currently is) in LaTeX, do you? 😕

---

<div class="post-metadata">

**Author:** ![joerg.lenhard](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/joerg.lenhard/32/9_2.png) [@joerg.lenhard](https://discourse.jabref.org/u/joerg.lenhard)\
**Post date:** [September 21, 2016, 9:51am UTC](https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218/6 "2016-09-21T09:51:09Z")

</div>

Good to hear you have a workaround!

Unfortunately, I cannot give a solution for the extraction in LaTeX. My LaTeX programming skills are confined to simple macros and layouting hacks for meeting paper size constraints 😉

---

<div class="post-metadata">

**Author:** ![Siedlerchr](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/siedlerchr/32/216_2.png) [@Siedlerchr](https://discourse.jabref.org/u/Siedlerchr)\
**Post date:** [September 21, 2016, 2:33pm UTC](https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218/7 "2016-09-21T14:33:26Z")

</div>

Hi,

while I have no advanced LaTeX knowledge, you might want to look into the offiial BibLaTeX documentation, there is also a lot content refering on creating/modifying styles.  
[https://www.ctan.org/pkg/biblatex](https://www.ctan.org/pkg/biblatex)

Regards

---

<div class="post-metadata">

**Author:** ![doncherry](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.jabref.org/doncherry/32/48_2.png) [@doncherry](https://discourse.jabref.org/u/doncherry)\
**Post date:** [October 2, 2016, 4:50pm UTC](https://discourse.jabref.org/t/make-file-field-easily-usable-in-latex-documents/218/8 "2016-10-02T16:50:02Z")

</div>

Thanks for the tip, but this problem isn’t really on the side of `biblatex`. It’s either about modifying strings in LaTeX, or about changing the way JabRef stores this information. I’ve tried the former and asked about in on [tex.sx](http://tex.sx) (see my original post), but couldn’t find a solution. Hence my post here, i.e. the latter 🙂.
