summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/misc/tex/nix/dot2pdf.sh2
-rw-r--r--pkgs/misc/tex/nix/find-includes.pl5
2 files changed, 6 insertions, 1 deletions
diff --git a/pkgs/misc/tex/nix/dot2pdf.sh b/pkgs/misc/tex/nix/dot2pdf.sh
index 755cc645710..816fe9b01ee 100644
--- a/pkgs/misc/tex/nix/dot2pdf.sh
+++ b/pkgs/misc/tex/nix/dot2pdf.sh
@@ -5,7 +5,7 @@ ensureDir $out
 dot2pdf() {
     sourceFile=$1
     targetName=$out/$(basename $(stripHash $sourceFile; echo $strippedName) .dot).pdf
-    echo "convering $sourceFile to $targetName..."
+    echo "converting $sourceFile to $targetName..."
     dot -Tps $sourceFile > tmp.ps
     epstopdf --outfile $targetName tmp.ps
 }
diff --git a/pkgs/misc/tex/nix/find-includes.pl b/pkgs/misc/tex/nix/find-includes.pl
index 633f9084370..0f171c78703 100644
--- a/pkgs/misc/tex/nix/find-includes.pl
+++ b/pkgs/misc/tex/nix/find-includes.pl
@@ -56,6 +56,11 @@ while (scalar @workset > 0) {
                 $bib =~ s/\s+$//;
                 push @workset, $path . "/" . $bib . ".bib";
             }
+	} elsif (/\\includegraphics(\[.*\])?\{(.*)\}/) {
+	    my $fn2 = $2;
+            die "absolute path! $fn2" if substr($fn2, 0, 1) eq "/";
+	    push @workset, $path . "/" . $fn2 . ".pdf";
+	    push @workset, $path . "/" . $fn2 . ".ps";
         }
         # !!! also support \usepackage
     }