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

Tex filter to use localised /tmp instead of shared storage

XMLWordPrintable

    • MOODLE_400_STABLE, MOODLE_401_STABLE
    • MOODLE_400_STABLE, MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-77592-401
    • MDL-77592-master
    • Hide

      Setup

      1. You need to have latex dependencies installed. On Debian-based systems, you can run the following command to install them.

        sudo apt-get install mimetex texlive-latex-base imagemagick
        

      Manual testing

      1. Log in as admin
      2. Go to "Site administration > Plugins > Filters > Manage filters" and enable the "TeX notation" filter.
      3. Disable MathJax
      4. Go to the settings of the "TeX notation" filter
      5. Set filter_tex | convertformat to SVG
      6. Make sure that the following settings are configured

        Path of latex binary
        Path of dvips binary
        Path of convert binary
        Path of dvisvgm binary
        

      7. Access /filter/tex/texdebug.php page
      8. Select Show command execution output from the algebraic expression rendered with Tex/Ghostscript and click Do it!
      9. In the log window below Confirm, that /tmp/requestdir/ path is used for both /usr/bin/dvips and /usr/bin/dvisvgm
      10. Create a test course with a page activity
      11. Add the following as the page content (switch to HTML mode to make sure auto-added HTML tags won't break the code):

        \[ \tan x=\frac{\sin x}{\cos x} \] 
        

      12. View the page activity
      13. Confirm, that the image with the formula is displayed as SVG.
      14. Go to the settings of the "TeX notation" filter
      15. Set filter_tex | convertformat to PNG
      16. View the page activity
      17. Confirm, that the image with the formula is displayed as PNG.
      Show
      Setup You need to have latex dependencies installed. On Debian-based systems, you can run the following command to install them. sudo apt-get install mimetex texlive-latex-base imagemagick Manual testing Log in as admin Go to "Site administration > Plugins > Filters > Manage filters" and enable the "TeX notation" filter. Disable MathJax Go to the settings of the "TeX notation" filter Set filter_tex | convertformat to SVG Make sure that the following settings are configured Path of latex binary Path of dvips binary Path of convert binary Path of dvisvgm binary Access /filter/tex/texdebug.php page Select Show command execution output from the algebraic expression rendered with Tex/Ghostscript and click Do it! In the log window below Confirm , that /tmp/requestdir/ path is used for both /usr/bin/dvips and /usr/bin/dvisvgm Create a test course with a page activity Add the following as the page content (switch to HTML mode to make sure auto-added HTML tags won't break the code): \[ \tan x=\frac{\sin x}{\cos x} \] View the page activity Confirm , that the image with the formula is displayed as SVG. Go to the settings of the "TeX notation" filter Set filter_tex | convertformat to PNG View the page activity Confirm , that the image with the formula is displayed as PNG.

      It's been found that LaTeX may produce high load on shared storage due to lots of LaTeX conversions running at the same time.

      It looks like LaTeX temporary files stored in shared temp dir https://github.com/moodle/moodle/blob/556208417deb47ccea80d00849aae6fb4d47f228/filter/tex/latex.php#L22-L23 only persist for the life of a single request.

      Could a new local temp dir config be implemented with a default value of /tmp so Moodle subsystems like LaTeX could take advantages of it and use local temp dir when practicable?

            mikhailgolenkov Misha Golenkov
            mikhailgolenkov Misha Golenkov
            Brendan Heywood Brendan Heywood
            Andrew Lyons Andrew Lyons
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 56 minutes
                1h 56m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.