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

Latex problem with some symbols

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 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
    • Fix Version/s: 1.8.3, 1.9
    • Component/s: Filters
    • Labels:
      None
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      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

            • Assignee:
              howardsmiller Howard Miller
              Reporter:
              aav Artem Andreev
              Tester:
              Nobody
              Participants:
              Component watchers:
              Jake Dallimore, Jun Pataleta
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Oct/07