2

I am using bibtex (Natbib), with Jabref to manage a reference database.

Many of the records are journal papers etc... which I have a PDF copy on file, Jabref allows this file to be recorded against the database entry, so that it can be opened directly from within the Jabref application. I am sure that there are alternatives to Jabref, not important to this question.

My query is that in the same way^ that the citation** creates a hyperlink that you can click, resulting in the relevant webpage being opened, does anyone know of a way to achieve the same effect, however, but for local files.

The aim of this is to make the working document more convenient in the research literature review process.


^ Provided hyperref package is used.

** Should it include a DOI or Webpage record as part of the bib entry.

1 Answer 1

3

Standard BibTeX styles don't have a specific field for local file, some styles admit the doi and url field. It is possible to use url for local files. Alternatively one has to modify a bst file.

However, BibLaTeX has native support for the file field. file is not supported by standard styles. Here is a simple way to insert it

\renewbibmacro{finentry}{\finentry\par\href{\thefield{file}}{Local PDF}}

JabRef stores the information about the file(s) associated to an entry in the file field. The information about a local file is stored as :path:PDF. Thus, one has to manipulate the values to make a proper URI. A possible solution is to use the source map facilities of biber.

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=file,
        match=\regexp{.*:(.*):PDF},
        replace=\regexp{file://$1}]
    }
  }
}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .