Subversion Repositories wimsdev

Rev

Rev 12259 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12259 Rev 13101
Line 277... Line 277...
277
    if(*p1=='\\' || isspace(*p1)) *p1=' ';// replace \ and all spaces by a simple space -
277
    if(*p1=='\\' || isspace(*p1)) *p1=' ';// replace \ and all spaces by a simple space -
278
    if(*p1=='\"') { string_modify(p,p1,p1+1,"''"); p1++;} // replace " by ''
278
    if(*p1=='\"') { string_modify(p,p1,p1+1,"''"); p1++;} // replace " by ''
279
  }
279
  }
280
}
280
}
281
 
281
 
282
/* Error-tolerante raw math translation routine
282
/* Error-tolerant raw math translation routine
283
 * Translate error-laden raw math into machine-understandable form.
283
 * Translate error-laden raw math into machine-understandable form.
284
 * do nothing if there is some { or \\
284
 * do nothing if there is some { or \\
285
 */
285
 */
286
void rawmath(char *p)
286
void rawmath(char *p)
287
{
287
{
Line 604... Line 604...
604
        ovlstrcpy(p1,p1+1);p1--;
604
        ovlstrcpy(p1,p1+1);p1--;
605
    }
605
    }
606
  }
606
  }
607
}
607
}
608
 
608
 
609
/* <=, >=, ->, =>, <=>
609
/* <=, >=, ->, =>, <=>, !=, <-> <-->, <-
610
 * if int n != 0, use html code, else use tex code
610
 * if int n != 0, use html code, else use tex code
611
 */
611
 */
612
 
612
 
613
void __replace_arrow ( char *p, int n)
613
void __replace_arrow ( char *p, int n)
614
{
614
{
Line 640... Line 640...
640
    for(p2=p1; p2>p && *(p2-1)=='='; p2--);
640
    for(p2=p1; p2>p && *(p2-1)=='='; p2--);
641
    if(p2>p && *(p2-1)==';') continue;
641
    if(p2>p && *(p2-1)==';') continue;
642
    if(p2<p1) { string_modify(p,p2,p1+5,"%sLongrightarrow",m_prefix);}
642
    if(p2<p1) { string_modify(p,p2,p1+5,"%sLongrightarrow",m_prefix);}
643
    else { string_modify(p,p1,p1+5,"%sRightarrow",m_prefix) ;}
643
    else { string_modify(p,p1,p1+5,"%sRightarrow",m_prefix) ;}
644
  }
644
  }
-
 
645
  /* <->, <-->, <- */
-
 
646
  /* <-- not implemented because -- is replaced by + elsewhere */
-
 
647
  for(p1=strstr(p,"&lt;-"); p1!=NULL; p1=strstr(p1+1,"&lt;-")) {
-
 
648
    for(p2=p1+5; *p2=='-'; p2++);
-
 
649
    if(strncmp(p2,"&gt;",4)==0)
-
 
650
      if ((p2-p1)%2)
-
 
651
        string_modify(p,p1,p2+4,(p2>p1+5) ? "%slongleftrightarrow" : "%sleftrightarrow",m_prefix);
-
 
652
      else
-
 
653
        string_modify(p,p1,p2+4,(p2>p1+6) ? "%sleftrightharpoons" : "%sleftrightharpoons",m_prefix);
-
 
654
    else
-
 
655
      string_modify(p,p1,p2,(p2>p1+5) ? "%slongleftarrow " : "%sleftarrow ",m_prefix);
-
 
656
  }
-
 
657
 
645
/* Not equal */
658
  /* Not equal */
646
  for(p1=strstr(p,"!="); p1; p1=strstr(p1+1,"!=")) {
659
  for(p1=strstr(p,"!="); p1; p1=strstr(p1+1,"!=")) {
647
    if(p1>p && !isspace(*(p1-1))) continue;
660
    if(p1>p && !isspace(*(p1-1))) continue;
648
    string_modify(p,p1,p1+2,"%sneq",m_prefix);
661
    string_modify(p,p1,p1+2,"%sneq",m_prefix);
649
  }
662
  }
650
}
663
}