comparison scripts/plot/private/__go_draw_axes__.m @ 14545:1f922eedf9ce

Accommodate backslash string escapes in regexp pattern. (changeset e47d929fde8f). * __go_draw_axes__.m (__tex2enhanced__): Escape the backslash in the regexp patterm.
author Ben Abbott <bpabbott@mac.com>
date Tue, 10 Apr 2012 21:11:02 -0400
parents 319660795df1
children 86854d032a37
comparison
equal deleted inserted replaced
14544:be18c9e359bf 14545:1f922eedf9ce
2337 2337
2338 function str = __tex2enhanced__ (str, fnt, it, bld) 2338 function str = __tex2enhanced__ (str, fnt, it, bld)
2339 persistent sym = __setup_sym_table__ (); 2339 persistent sym = __setup_sym_table__ ();
2340 persistent flds = fieldnames (sym); 2340 persistent flds = fieldnames (sym);
2341 2341
2342 [s, e, m] = regexp(str,'\\([a-zA-Z]+|0)','start','end','matches'); 2342 [s, e, m] = regexp(str,'\\\\([a-zA-Z]+|0)','start','end','matches');
2343 2343
2344 for i = length (s) : -1 : 1 2344 for i = length (s) : -1 : 1
2345 ## special case for "\0" and replace with "{/Symbol \306}' 2345 ## special case for "\0" and replace with "{/Symbol \306}'
2346 if (strncmp (m{i}, '\0', 2)) 2346 if (strncmp (m{i}, '\0', 2))
2347 str = cstrcat (str(1:s(i) - 1), '{/Symbol \306}', str(s(i) + 2:end)); 2347 str = cstrcat (str(1:s(i) - 1), '{/Symbol \306}', str(s(i) + 2:end));