Changeset 16

Show
Ignore:
Timestamp:
06/10/08 22:53:23 (7 months ago)
Author:
jms
Message:

[pgiac] Ajout de la possibilité d'écrire des commandes giac sur plusieurs lignes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pgiac/pgiac

    r15 r16  
    2323 
    2424 
    25 my $VERSION     = "0.1.5";     # Lundi 9 juin 2008 
     25my $VERSION     = "0.1.6";     # Mardi 10 juin 2008 
    2626 
    2727my $OUT         = "";           # Contenu en sortie. 
     
    4747 
    4848my $DEBUG  = 0; 
     49 
     50my $INBLOC = 0; 
     51my $BLOC   = ""; 
    4952 
    5053# Commande pour déterminer la BoundingBox d'un fichier EPS via GS. 
     
    8891    while (<INGIAC>) { 
    8992        chomp($_); 
    90         if ($_ =~ /^\.gp (.*)/) { 
     93        if ($INBLOC) { 
     94            if ($_ =~ /^\.end/) { 
     95                chomp($BLOC); 
     96                &Executer($BLOC,"ltx"); 
     97                $INBLOC = 0; $BLOC = ""; 
     98            } else { 
     99                $BLOC .= "$_\n"; 
     100            } 
     101        } elsif ($_ =~ /^\.gp (.*)/) { 
    91102            &LireParametres($1); 
    92103        } elsif ($_ =~ /^\.gmp (.*)/) { 
    93104            &Executer($1,"mp"); 
    94         } elsif ($_ =~ /^\.g(.*)/) { 
     105        } elsif ($_ =~ /^\.g (.*)/) { 
    95106            &Executer($1,"ltx"); 
     107        } elsif ($_ =~ /^\.g\:(.*)/) { 
     108            $INBLOC = 1; $BLOC = $1 ? "$1\n" : ""; 
    96109        } elsif ($_ =~ /^\.G(.*)/) { 
    97110            my @lignes = qx{cat $1}; 
     
    179192$t 
    180193\\end{lstlisting} 
     194eop 
     195    } 
     196    if ($INBLOC) { 
     197        return << "eop"; 
     198{\\MarqueBlocGiac{$COMPTEUR}     
     199\\begin{verbatim} 
     200$t 
     201\\end{verbatim}  
     202} 
    181203eop 
    182204    }