Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-10092

Latex problem with some symbols

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.7, 1.7.1, 1.7.2, 1.8
    • 1.8.3, 1.9
    • Filters
    • None
    • MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

    Description

      Some symbols (< > &  ) Latex (in my case Tetex 3.0) display as text &lt, &gt, etc.As far as I understand Tex filter make some clenups, but only for mimetex section of code...
      Section of code that works in my case:
      <...>
      // try and render with latex first
      $latex = new latex();
      $density = $CFG->filter_tex_density;
      $background = $CFG->filter_tex_latexbackground;
      $texexp = $texcache->rawtext;
      $texexp = str_replace('<','<',$texexp);
      $texexp = str_replace('>','>',$texexp);
      $texexp = str_replace('&','&',$texexp);
      $texexp = str_replace(' ',' ',$texexp);
      $latex_path = $latex->render( $texexp, $md5, 12, $density, $background );
      if ($latex_path)

      { copy( $latex_path, $pathname ); $latex->clean_up( $md5 ); }

      else {
      // failing that, use mimetex
      $texexp = preg_replace('Unable to render embedded object: File (\r\n?) not found.',' ',$texexp);
      $texexp = '\Large ' . $texexp;
      $texexp = escapeshellarg($texexp);
      <...>

      Attachments

        Activity

          People

            howardsmiller Howard Miller
            aav Artem Andreev
            Nobody Nobody
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/Oct/07