Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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}]
    }
  }
}
share|improve this answer
    
Super, thanks, Ill give it a go... –  Nicholas Hamilton Dec 9 '12 at 6:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.