- Timestamp:
- 05/09/06 11:13:01 (18 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 1 deleted
- 6 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/ToBeReviewed/TEXtoIDL/matchdelim.pro
r44 r47 47 47 ; 48 48 ; RELEASE: 49 ; $Name: Rel_ 1_2 $49 ; $Name: Rel_2_1_2 $ 50 50 ; 51 51 ; COPYRIGHT: -
trunk/ToBeReviewed/TEXtoIDL/nexttok.pro
r44 r47 29 29 ; $Id$ 30 30 ; $Log: nexttok.pro,v $ 31 ; Revision 1.4 2004/06/15 17:25:54 mcraig 32 ; Fixed bug in regular expression, changed array notation to square brackets 33 ; 31 34 ; Revision 1.3 1996/06/14 20:00:27 mcraig 32 35 ; Updated Copyright info. … … 40 43 ; 41 44 ; RELEASE: 42 ; $Name: Rel_ 1_2 $45 ; $Name: Rel_2_1_2 $ 43 46 ; 44 47 ; COPYRIGHT: … … 101 104 ENDIF 102 105 103 MatchIdx = MatchIdx (1:*)104 Matches = Matches (1:*)106 MatchIdx = MatchIdx[1:*] 107 Matches = Matches[1:*] 105 108 106 109 SortInd = sort(Matches) 107 110 108 Position = Matches (SortInd(0))111 Position = Matches[SortInd[0]] 109 112 110 Tok = string(TmpTok (MatchIdx(SortInd(0))))113 Tok = string(TmpTok[MatchIdx[SortInd[0]]]) 111 114 112 115 return, Tok -
trunk/ToBeReviewed/TEXtoIDL/showtex.pro
r44 r47 26 26 ; $Id$ 27 27 ; $Log: showtex.pro,v $ 28 ; Revision 1.4 2004/06/15 17:25:54 mcraig 29 ; Fixed bug in regular expression, changed array notation to square brackets 30 ; 28 31 ; Revision 1.3 1996/06/14 20:00:27 mcraig 29 32 ; Updated Copyright info. … … 36 39 ; 37 40 ; RELEASE: 38 ; $Name: Rel_ 1_2 $41 ; $Name: Rel_2_1_2 $ 39 42 ; 40 43 ; COPYRIGHT: … … 107 110 x = .1 108 111 FOR j = 1, 5 DO BEGIN 109 IF (count LT nseq ) THEN xyouts, x, y, DisplayString (count), align = .5, /norm112 IF (count LT nseq ) THEN xyouts, x, y, DisplayString[count], align = .5, /norm 110 113 count = count+1 111 114 x = x + dx -
trunk/ToBeReviewed/TEXtoIDL/textable.pro
r44 r47 30 30 ; $Id$ 31 31 ; $Log: textable.pro,v $ 32 ; Revision 1.8 2004/06/15 17:25:54 mcraig 33 ; Fixed bug in regular expression, changed array notation to square brackets 34 ; 32 35 ; Revision 1.7 1996/07/22 23:56:08 mcraig 33 36 ; Added \vartheta. … … 54 57 ; 55 58 ; RELEASE: 56 ; $Name: Rel_ 1_2 $59 ; $Name: Rel_2_1_2 $ 57 60 ; 58 61 ; COPYRIGHT: … … 94 97 ; Set IDL font sequence needed to switch to Greek letters. 95 98 GreekFont = strarr(3) 96 GreekFont (VECFONT)= '!7'97 GreekFont (PSFONT)= '!M'99 GreekFont[VECFONT] = '!7' 100 GreekFont[PSFONT] = '!M' 98 101 99 102 ; Set IDL font sequence needed to switch to special symbol font. 100 103 SymbolFont = strarr(3) 101 SymbolFont (VECFONT)= '!M'102 SymbolFont (PSFONT)= '!M'104 SymbolFont[VECFONT] = '!M' 105 SymbolFont[PSFONT] = '!M' 103 106 104 107 ; Set IDL font sequence needed to switch back to initial font. 105 108 PreviousFont = strarr(3) 106 PreviousFont (VECFONT)= '!X'107 PreviousFont (PSFONT)= '!X'109 PreviousFont[VECFONT] = '!X' 110 PreviousFont[PSFONT] = '!X' 108 111 109 112 ;lowercase Greek -- … … 205 208 [ '\circ', "%" , string(byte(176)) ]$ 206 209 ] 207 LowercaseGreek (1,*)= $208 GreekFont (FontSelection)$209 + LowercaseGreek (FontSelection,*)$210 + PreviousFont (FontSelection)211 UppercaseGreek (1,*)= $212 GreekFont (FontSelection)+$213 UppercaseGreek (FontSelection,*)$214 + PreviousFont (FontSelection)215 Symbols (1,*)= $216 SymbolFont (FontSelection)$217 + Symbols (FontSelection,*)$218 + PreviousFont (FontSelection)210 LowercaseGreek[1,*] = $ 211 GreekFont[FontSelection] $ 212 + LowercaseGreek[FontSelection,*] $ 213 + PreviousFont[FontSelection] 214 UppercaseGreek[1,*] = $ 215 GreekFont[FontSelection] +$ 216 UppercaseGreek[FontSelection,*] $ 217 + PreviousFont[FontSelection] 218 Symbols[1,*] = $ 219 SymbolFont[FontSelection] $ 220 + Symbols[FontSelection,*] $ 221 + PreviousFont[FontSelection] 219 222 220 223 TranslationTable = [[LowercaseGreek],[UppercaseGreek],[Symbols]] 221 return,TranslationTable (0:1,*)224 return,TranslationTable[0:1,*] 222 225 223 226 END -
trunk/ToBeReviewed/TEXtoIDL/textoidl.pro
r44 r47 41 41 ; $Id$ 42 42 ; $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 ; 43 52 ; Revision 1.4 1996/06/14 20:00:27 mcraig 44 53 ; Updated Copyright info. … … 54 63 ; 55 64 ; RELEASE: 56 ; $Name: Rel_ 1_2 $65 ; $Name: Rel_2_1_2 $ 57 66 ; 58 67 ; COPYRIGHT: … … 91 100 IF keyword_set (tex_seq) THEN BEGIN 92 101 table=textable() 93 return,table (0,*)102 return,table[0,*] 94 103 ENDIF 95 104 … … 123 132 ; around them if they are unbraced. This will have the result the 124 133 ; 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, *]+'}') 127 141 128 142 ; First we translate Greek letters and the like. This makes guessing 129 143 ; alignment of sub/superscripts easier, as all special characters will then 130 144 ; be one character long. 131 strn = strtrans(strn, table(0, *), table(1, *))132 145 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 135 156 136 157 return,strn -
trunk/ToBeReviewed/TEXtoIDL/translate_sub_super.pro
r44 r47 47 47 ; $Id$ 48 48 ; $Log: translate_sub_super.pro,v $ 49 ; Revision 1.5 2000/06/14 19:09:22 mcraig 50 ; Changed name of strtok str_token to avoid conflict in IDL 5.3. 51 ; 49 52 ; Revision 1.4 1996/06/14 20:00:27 mcraig 50 53 ; Updated Copyright info. … … 59 62 ; 60 63 ; RELEASE: 61 ; $Name: Rel_ 1_2 $64 ; $Name: Rel_2_1_2 $ 62 65 ; COPYRIGHT: 63 66 ; Copyright (C) 1996 The Regents of the University of California, All … … 131 134 ; display. 132 135 ; LIBRARY FUNCTIONS CALLED: 133 ; str tok-- Text/string (mcraig)136 ; str_token -- Text/string (mcraig) 134 137 ; sub_sup_idl -- contained in this file 135 138 ; MODIFICATION HISTORY: 136 139 ; $Id$ 137 140 ; $Log: translate_sub_super.pro,v $ 141 ; Revision 1.5 2000/06/14 19:09:22 mcraig 142 ; Changed name of strtok str_token to avoid conflict in IDL 5.3. 143 ; 138 144 ; Revision 1.4 1996/06/14 20:00:27 mcraig 139 145 ; Updated Copyright info. … … 152 158 ; 153 159 ; RELEASE: 154 ; $Name: Rel_ 1_2 $160 ; $Name: Rel_2_1_2 $ 155 161 ; 156 162 ; COPYRIGHT: … … 219 225 ; Our approach will be to grab the input string up to the next '^' or 220 226 ; '_', then process the script we've found. 221 NewString=str tok(strn,Token)227 NewString=str_token(strn,Token) 222 228 223 229 WHILE strlen(strn) GT 0 DO BEGIN … … 284 290 IF ( pos NE -1 ) THEN BEGIN ; more left to process 285 291 NewString = NewString $ 286 + str tok(strn, Token)292 + str_token(strn, Token) 287 293 ENDIF ELSE BEGIN ; we are done 288 294 NewString = NewString + strn
Note: See TracChangeset
for help on using the changeset viewer.