]> git.lyx.org Git - lyx.git/blobdiff - lib/scripts/prefTest.pm
Create Chapter 6 Bullets in Additional.lyx and move the bullet section into it; this...
[lyx.git] / lib / scripts / prefTest.pm
index 1f1470f5a6c73c1adb07a8e30a7622badfe08baf..8e25b7986baaf51f3858e31610a61470d6f73ca8 100644 (file)
@@ -87,23 +87,39 @@ sub getConverter($$)
   chomp($l);
   my ($from, $to, $cmd, $par);
   ($l, $from) = getNext($l);
-  return undef if ($from !~ /tex$/);
+  return undef if ($from !~ /(ps|tex|dvi)$/);
   ($l, $to) = getNext($l);
   return undef if ($to !~ /^((dvi3?|pdf[23456]?)(log)?)$/);
+  my ($checkfor, $substitute, $extrapar);
+  if ($from =~ /tex/) {
+    $checkfor = qr/\s+\-shell\-(escape|restricted)/;
+    $substitute = "-shell-escape";
+    $extrapar = qr/^latex/;
+  }
+  elsif ($from =~ /ps$/) {
+    $checkfor = qr/\s+\-dALLOWPSTRANSPARENCY/;
+    $substitute = "-dALLOWPSTRANSPARENCY";
+    $extrapar = qr/hyperref-driver=dvips/;
+  }
+  else {
+    $checkfor = qr/\s+-i\s+dvipdfmx-unsafe.cfg/;
+    $substitute = "-i dvipdfmx-unsafe.cfg";
+    $extrapar = qr/^hyperref-driver=dvipdfm/;
+  }
   ($l, $cmd) = getNext($l);
   if ($add) {
-    if ($cmd !~ /\-shell-(escape|restricted)/) {
+    if ($cmd !~ $checkfor) {
       if ($cmd =~ /^(\S+)\s*(.*)$/) {
-       $cmd = "$1 -shell-escape $2";
+       $cmd = "$1 $substitute $2";
        $cmd =~ s/\s+$//;
       }
     }
   }
   else {
-    $cmd =~ s/\s+\-shell\-(escape|restricted)//;
+    $cmd =~ s/$checkfor//;
   }
   ($l, $par) = getNext($l);
-  return undef if ($par !~ /^latex/);
+  return undef if ($par !~ $extrapar);
   my $key = "\"$from\" \"$to\"";
   if ($add) {
     return([$key, [$cmd, $par]]);