Use pdfroot
Prev | Chapter 8. Reference management | Next

## Use pdfroot

The `pdfroot` variable allows you to store the paths to PDF or Postscript offprints of your references in a more efficient and more flexible way than a full path.

The AV field of a reference can hold either a plain text description of the physical place where a paper copy can be found (this can be anything that helps you to get hold of the copy, from a room number to a file folder title) or it can hold the path to an electronic version of the document. In the latter case, the string has to begin with “PATH:” and the path itself must follow without a space. This path will be converted into a link in the HTML output, and the neat plan is to open the document the link points to with a simple mouseclick. If you just store the full path of this document, something like `PATH:/home/markus/literature/5503.pdf`, you may run into problems fairly soon: If you have to reorganize the folder structure in your directory tree, all paths in the database would be incorrect. If you access the database from a different computer as the one that physically stores your offprints, you will be out of luck with these paths as well.

The idea is to store the invariable part of the path in the reference entry and any variable part of the path in the `pdfroot` variable. The `pdfroot` variable can be set either in your configuration file or with a command line option. Consider e.g. the following situation: You decide for some obscure reason to store the offprints in subdirectories according to the publication year. The full paths will thus be something like `/home/markus/literature/1999/2345.pdf` and `/home/markus/literature/2001/6213.ps`. The partial paths in the AV field of the reference entry could then be set to `PATH:1999/2345.pdf` and `PATH:2001/6213.ps`, whereas the correct value for the `pdfroot` would be `/home/markus/literature/`. Simple concatenation by refdb will then result in the proper full path.

If you now decide to rearrange your hard drive, all you need to do is to set `pdfroot` properly, as long as you don't change the directory structure below `/literature` (if you do that, you shoot yourself in the foot anyway).

If you want to access your offprints from a different computer, you have several options:

- You can mount the directory tree that actually holds the data. If the computer that stores your offprints e.g. exports `/home` as an NFS share, you could mount that to `/mnt` on your local computer. Then you can set `pdfroot` to `/mnt/markus/literature/` to access your offprints.

- You can store the offprints in a location that is accessible with an internet protocol like HTTP or FTP. Assume you keep the offprints in `/usr/local/www/data/refdb/offprints/` on a computer that runs Apache. Then you could set `pdfroot` to `http://machine.name/refdb/offprints/` and remotely access the offprints through HTTP.

Prev | Up | Next
Character encoding issues | Home | Interaction with external applications