NAME

cpbibart - Copy articles in files referenced in a latex file.


SYNOPSIS

cpbibart [options] sourcefile targetdir

cpbibart --help


DESCRIPTION

cpbibart is used to make a bundle of a LaTeX document and the documents it cites.

Note that at the moment only files with filenames similar to the cite key used in the latex document and an extension can be found. If you don't practice this behaivour this program is of no use to you. Sorry :(

cpbibart reads the .bbl or .aux file from a latex run and copies files with filenames similar to cite keys in the latex file from a set of directories to a target directory, creating the target directory if it doesn't exist. The set of directories to search for articles may be set by the -d option.

As the .bbl file is used bibtex must be run before cpbibart

  1. [pdf]latex
  2. bibtex
  3. cpbibart

Optionally the typeset file and/or the source code for it may also be copied to the target directory by providing the -a or -f options. In that case links to the copied references may optionally be put in the bibliography by the -l or -L option. This is done by manipulation of the bbl file and a rerun of latex (with -L) in the source directory thus overwriting the existent typeset file and .bbl file before copying to the target directory. For the links to work the href package must be loaded in the latex document.

If the the -l or -L switches that overwrites .bbl and .dvi or .pdf files the originals is received again by a rerun of bibtex and latex.

  1. [pdf]latex
  2. bibtex
  3. cpbibart
  4. bibtex
  5. [pdf]latex

A bibtex .bib file including the cited references may also be generated with the aux2bib program if present, and added to the target directory with the -b option.


OPTIONS

-a, --article Copy typset article also to targetdir.
-b, --bibfile Generate a .bib file with the used citations.
--debug Print debug messages.
-ddirectory1[,directory2...], --directories=directory1[,directory2...] Directories to search for articles.
-f[suffix1[,suffix2...]], --sources[=suffix1[,suffix2...]] Copy full sources to article to targetdir. Files with given suffixes will be copied. Default is tex,bbl.
-h, --help Print this help.
-l, --link Add links to articles in the .bbl file. The .bbl file generated by bibtex will be backed up in a .bbl~ file. The links are inserted as latex \\url{} commands which needs package url to be displayed or href to be working links.
-L[command], --latex[=command] run command on the texfile after regeneration of the .bbl file. Default command is latex. Implies -l.
-r Print list of citations where no corresponding file is found to STDOUT
-ssuffix1[,suffix2[,...]], --suffixes=suffix1[,suffix2[,...]] Suffixes for articles to look for in priority order. Only first match for each article will be copied. Default is pdf, ps,ps.gz.
-u, --aux Read citation keys from .aux file instead of .bbl file.
-v, --verbose Print verbose output


DIAGNOSTICS

cpbibart is usually running silently with only error messages to STDERR. However some helpful progress output can be achieved by the -v option. A list of citations in the text to which no corresponding files have been found can be generated by the -r option. The debug option --debug is probably not of any use.

A usage message can is written to STDOUT by the -h option.


EXAMPLE

cpbibart -a -dpapers -f -Lpdflatex -r foo.bbl mytargetdir

will

  1. Copy the papers cited in the article foo.tex to mytargetdir.
  2. Print a list of papers not found to STDOUT.
  3. Backup foo.bbl to foo.bbl~.
  4. Insert links to the found papers in foo.bbl.
  5. Run the command pdflatex foo.
  6. Copy foo.tex, foo.bbl, the newly generated foo.pdf (and if present since earlier foo.ps) to mytargetdir.


BUGS

Probably


RESTRICTIONS

Only files with names similar to the citekeys are found.

Only for UN*X-like systems.


AUTHORS

Johan Arvelius, johan.arvelius@irf.se

Code from Dr Nicola Talbot included.


COPYRIGHT AND LICENSE

Copyright (C) 2008, 2009 Johan Arvelius, some parts copyright Nicola Talbot as indicated in the code.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.