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

tex filter: problem with paths of TeX binaries under Windows

    Details

    • Testing Instructions:
      Hide

      This is modification is to fix a bug affecting Windows platforms with PHP > 5.3; however, all platforms may need to be regression tested to verify that the implementation works on currently supported systems. Specific tests should be performed on PHP 5.3 systems ( Moodle 2.6), and PHP 5.4,5.5 (required by Moodle 2.7).

      1. Move or rename TeX binaries latex, dvips, and convert to have spaces in the paths if necessary. Ideally use MikTeX 2.9 on Windows which has spaces in default path.
      2. Verify no php errors occur on install.
      3. Go to admin settings, set paths, save, and verify executables are found.
      4. Try to add quotes around paths and save. Quotes should be removed automatically.
      5. Enable TeX filter, disable MathJaxloader, and view page with TeX code to verify GIF images are generated.
      6. Go to texdebug.php and run generate images with latex, dvips and show commands. Verify executables are found and correct images displayed.
      7. Change setting for converformat to PNG retest and make sure PNGs are displayed.
      8. Try with hard coded values for paths in config.php with quotes around paths and verify that everything still works. Then go to TeX admin settings. Paths should be displayed with quotes, but should be marked as invalid since quotes are present.
      Show
      This is modification is to fix a bug affecting Windows platforms with PHP > 5.3; however, all platforms may need to be regression tested to verify that the implementation works on currently supported systems. Specific tests should be performed on PHP 5.3 systems ( Moodle 2.6), and PHP 5.4,5.5 (required by Moodle 2.7). Move or rename TeX binaries latex, dvips, and convert to have spaces in the paths if necessary. Ideally use MikTeX 2.9 on Windows which has spaces in default path. Verify no php errors occur on install. Go to admin settings, set paths, save, and verify executables are found. Try to add quotes around paths and save. Quotes should be removed automatically. Enable TeX filter, disable MathJaxloader, and view page with TeX code to verify GIF images are generated. Go to texdebug.php and run generate images with latex, dvips and show commands. Verify executables are found and correct images displayed. Change setting for converformat to PNG retest and make sure PNGs are displayed. Try with hard coded values for paths in config.php with quotes around paths and verify that everything still works. Then go to TeX admin settings. Paths should be displayed with quotes, but should be marked as invalid since quotes are present.
    • Workaround:
      Hide

      \

      Show
      \
    • Affected Branches:
      MOODLE_25_STABLE, MOODLE_26_STABLE, MOODLE_27_STABLE
    • Fixed Branches:
      MOODLE_26_STABLE, MOODLE_27_STABLE
    • Pull from Repository:
    • Pull 2.7 Branch:
      MDL-45044-m27-master
    • Pull Master Branch:
      MDL-45044-master

      Description

      See this discussion https://moodle.org/mod/forum/discuss.php?d=258109

      The problem is that

      • path enclosed in double quotes will be reported as wrong (this is also true for default paths like "c:\texmf\miktex\bin\latex.exe" , ...) so you will get crosses on the settings page and more important you can't set convert output format to PNG because filter_tex_updatedcallback function will revert it back to GIF but inaries will be called correctly and the image will be generated by latex, dvips and convert
      • path without double quotes will be reported as correct on the settings page and you can set convert output format to PNG, but commands will only work if they don't contain any space. This is not a good thing as all recent MikTeX versions are installed by default in c:\program files (x86)\miktex 2.9

      I think this is a bug and should be fixed but I am not sure of the right way to fix it.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  9 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    8/Sep/14