summary refs log tree commit diff
path: root/pkgs/misc/tex
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2005-09-02 15:50:55 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2005-09-02 15:50:55 +0000
commit7fccd83384f8ab2ca3f5df1e9f5c7f5c49ed8c49 (patch)
tree9bb6b8e38e2c92fb1cd798356af200ec411587fe /pkgs/misc/tex
parent9abe0fa3663eb2e94071317212436aedfcb19ff5 (diff)
downloadnixlib-7fccd83384f8ab2ca3f5df1e9f5c7f5c49ed8c49.tar
nixlib-7fccd83384f8ab2ca3f5df1e9f5c7f5c49ed8c49.tar.gz
nixlib-7fccd83384f8ab2ca3f5df1e9f5c7f5c49ed8c49.tar.bz2
nixlib-7fccd83384f8ab2ca3f5df1e9f5c7f5c49ed8c49.tar.lz
nixlib-7fccd83384f8ab2ca3f5df1e9f5c7f5c49ed8c49.tar.xz
nixlib-7fccd83384f8ab2ca3f5df1e9f5c7f5c49ed8c49.tar.zst
nixlib-7fccd83384f8ab2ca3f5df1e9f5c7f5c49ed8c49.zip
* Support \pgfdeclareimage.
svn path=/nixpkgs/trunk/; revision=3771
Diffstat (limited to 'pkgs/misc/tex')
-rw-r--r--pkgs/misc/tex/nix/find-includes.pl18
1 files changed, 12 insertions, 6 deletions
diff --git a/pkgs/misc/tex/nix/find-includes.pl b/pkgs/misc/tex/nix/find-includes.pl
index 6f3afcdaa040..da10c4699afc 100644
--- a/pkgs/misc/tex/nix/find-includes.pl
+++ b/pkgs/misc/tex/nix/find-includes.pl
@@ -25,12 +25,9 @@ while (scalar @workset > 0) {
     next if (defined $doneset{$fn});
 
     $doneset{$fn} = 1;
-    
-    if (!open FILE, "< $fn") {
-#	print STDERR "(cannot open $fn, ignoring)\n";
-	next;
-    };
 
+    next unless -e "$fn";
+    
     
     # Print out the full path *and* its relative path to $root.
     
@@ -40,7 +37,10 @@ while (scalar @workset > 0) {
     print OUT "$fn \"$relFN\"\n";
 
     
-    # Recursively find include in $fn.
+    # If this is a TeX file, recursively find include in $fn.
+    next unless $fn =~ /.tex$/ or $fn =~ /.ltx$/; 
+    open FILE, "< $fn" or die;
+    
     while (<FILE>) {
 	if (/\\input\{(.*)\}/) {
 	    my $fn2 = $1;
@@ -62,6 +62,12 @@ while (scalar @workset > 0) {
 	    push @workset, $path . "/" . $fn2 . ".pdf";
 	    push @workset, $path . "/" . $fn2 . ".png";
 	    push @workset, $path . "/" . $fn2 . ".ps";
+	} elsif (/\\pgfdeclareimage(\[.*\])?\{.*\}\{(.*)\}/) {
+	    my $fn2 = $2;
+            die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
+	    push @workset, $path . "/" . $fn2 . ".pdf";
+	    push @workset, $path . "/" . $fn2 . ".png";
+	    push @workset, $path . "/" . $fn2 . ".jpg";
         }
         # !!! also support \usepackage
     }