#!/usr/bin/perl -w # # Syntax: mk_latex_zip [-h] [-k] zip_tag latex_file # # Purpose: Collects all latex, figure, bibtex, ... files of the user on which # latex_file depends, and creates a zip file called zip_tag.zip out # of them. # Use the -k flag to indicate that the temporary target directory # should not be removed. # The -h flag shows the help info for this command. # Created: Jan 2, 2011 by Bart De Schutter # Last revised: # Status: public # Category: latex ############################################################################### # # Main program. # ############################################################################### use strict; my ($target_dir, $tmp_dir, $zip_tag, $latex_file, $keep_tmp) ($zip_tag, $latex_file, $keep_tmp) = process_options (); $tmp_dir = create_tmp_dir ('mk_latex_zip'); $target_dir = "${tmp_dir}/${zip_tag}"; mkdir ( $target_dir) || die ("Cannot open create $target_dir"); system ("cp $latex_file $target_dir") == 0 || die ("Error touching $tmp_file"); copy_file_to_target($latex_file); run_ if ( $keep_tmp ) { rmdir($target_dir); rmdir($tmp_dir); } # run latex and bibtex do like mktex latex bibtex makeindex latex # detect files grep "^[ ]*([./]" ijc_0*.*l* grep -v "/usr/share" grep -v "/usr/lib" grep -v "\.aux" # detect graphics files grep "^[ TAB]*<" # detect bibtex files grep "style file" *blg