Ignore:
Timestamp:
05/09/06 11:13:01 (18 years ago)
Author:
pinsard
Message:

upgrade of TEXT2IDL/TEXtoIDL according to cerbere.lodyc.jussieu.fr: /usr/home/smasson/SAXO_RD/ : files

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/ToBeReviewed/TEXtoIDL/textoidl.pro

    r44 r47  
    4141;       $Id$ 
    4242;       $Log: textoidl.pro,v $ 
     43;       Revision 1.7  2004/06/15 17:25:54  mcraig 
     44;       Fixed bug in regular expression, changed array notation to square brackets 
     45; 
     46;       Revision 1.6  2004/01/11 01:49:00  mcraig 
     47;       Changed format of one array to newer [] style to avoidf conflict with function name in astro library. 
     48; 
     49;       Revision 1.5  2001/11/23 21:10:55  mcraig 
     50;       Added backslash '\' to tex sequences in translation table to protect them during regexp search in strsplit. 
     51; 
    4352;       Revision 1.4  1996/06/14 20:00:27  mcraig 
    4453;       Updated Copyright info. 
     
    5463; 
    5564; RELEASE: 
    56 ;       $Name: Rel_1_2 $ 
     65;       $Name: Rel_2_1_2 $ 
    5766; 
    5867; COPYRIGHT: 
     
    91100    IF keyword_set (tex_seq) THEN BEGIN 
    92101        table=textable() 
    93         return,table(0,*) 
     102        return,table[0,*] 
    94103    ENDIF  
    95104 
     
    123132;   around them if they are unbraced.  This will have the result the 
    124133;   it will be difficult to use \ as a sub/superscript.  Get over it. 
    125     strn =  strtrans(strn, '^'+table(0, *), '^{'+table(0, *)+'}') 
    126     strn =  strtrans(strn, '_'+table(0, *), '_{'+table(0, *)+'}') 
     134 
     135;   V2.11 Must include the '\' in from of translation table TeX 
     136;   sequences to ensure that strsplit properly treats the '\' in the 
     137;   TeX sequence. Since strsplit is doing a regexp replace, and '\' is 
     138;   special in regexps, need to escape it. 
     139    strn =  strtrans(strn, '\^'+'\'+table[0, *], '^{'+table[0, *]+'}') 
     140    strn =  strtrans(strn, '\_'+'\'+table[0, *], '_{'+table[0, *]+'}') 
    127141 
    128142;  First we translate Greek letters and the like.  This makes guessing 
    129143;  alignment of sub/superscripts easier, as all special characters will then 
    130144;  be one character long. 
    131     strn = strtrans(strn, table(0, *), table(1, *)) 
    132145 
    133     FOR i = 0L, n_elements(strn)-1 DO $ 
    134       strn(i) = translate_sub_super(strn(i)) ; Take care of sub/superscripts 
     146;   V2.11 Must include the '\' in from of translation table TeX 
     147;   sequences to ensure that strsplit properly treats the '\' in the 
     148;   TeX sequence. Since strsplit is doing a regexp replace, and '\' is 
     149;   special in regexps, need to escape it. 
     150    strn = strtrans(strn, '\'+table[0, *], table[1, *]) 
     151 
     152 
     153    FOR i = 0L, n_elements(strn)-1 DO BEGIN  
     154        strn[i] = translate_sub_super(strn[i]) ; Take care of sub/superscripts 
     155    ENDFOR  
    135156 
    136157    return,strn 
Note: See TracChangeset for help on using the changeset viewer.