## WeBWorK Main Forum

### Macros for GT LT, etc are rendered as code

by Bob Mahar -
Number of replies: 11

We recently set up a brand new WW server with the latest appliance image and generally everything is OK.    We do have one residual problem, $LTE and so on macros display as code. I have confirmed that the MathJax js files from localOverrides.con is accessible and it "seems" as if MathJax is installed - and given its from the pe-made appliance image I would assume its working? The problem file itself uses the PG macros for these symbols:$mc = new_multiple_choice();
$mc->qa('Determine the domain of the function.', "$$x {\not =} -int$$");$mc->extra("$$x GTE -int$$", "$$x LTE -int$$", "all Real numbers");

( Also... I'm just the friendly neighborhood IT person, not a WW guru, so please be gentle if this is a stupid question. )

Thanks!

-- Bob

### Re: Macros for GT LT, etc are rendered as code

by Glenn Rice -
What version of WeBWorK is this? If you are using a version of WeBWorK prior to version 2.16 (the latest), then you will need to make sure that you have the legacy-v2 MathJax branch. Go to the MathJax directory (usually /opt/webwork/MathJax) and run "git status" and see what branch it shows. That command will show something like "On branch ....". If it doesn't show the legacy-v2 branch, then run "git checkout legacy-v2".

If you are using WeBWorK 2.16 things work a bit differently.  In that case go to /opt/webwork/webwork2/htdocs and run "npm ci".  That is assuming you have npm installed.  If not, then you will need to run "sudo apt install npm" first.

Although, none of this may help you.  Something odd is going on as your screenshot shows that some of the math has rendered.  I believe the problem that you are showing is Library/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/1_Precalculus_Review/1.3_The_Basic_Classes_of_Functions/1.3.5.pg. I tested that problem, and don't have those display issues.

### Re: Macros for GT LT, etc are rendered as code

by Bob Mahar -
We are running 2.16 downloaded as an appliance. Ran nmp ci as indicated and it did update. However the issue persists.

wwadmin@webwork:/opt/webwork/webwork2/htdocs$npm ci npm WARN prepare removing existing node_modules/ before installation> @fortawesome/fontawesome-free@5.15.2 postinstall /opt/webwork/webwork2/htdocs/node_modules/@fortawesome/fontawesome-free> node attribution.jsFont Awesome Free 5.15.2 by @fontawesome - https://fontawesome.comLicense - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)added 8 packages in 1.827s How would I go about troubleshooting this further? Any other common modes by which this breaks? Thanks! -- Bob In reply to Bob Mahar ### Re: Macros for GT LT, etc are rendered as code by Glenn Rice - This shouldn't be an issue or break anything. The "appliance" you downloaded apparently already had the javascript installed via "npm ci" or "npm install". I am not sure why npm warned about removing the existing node_modules, but it then proceeded to install the 8 javascript libraries that it should have installed. In reply to Glenn Rice ### Re: Macros for GT LT, etc are rendered as code by Bob Mahar - Incidentally on changing the "Using what display mode?" option to "Images" for a given problem problem appears to display correctly. So what is this setting actually doing? ( I assume bypassing MathJax and using latex to render? ) Is there a way to test MathJax directly? I am looking in the apache. lighttp, and ww logs and cannot find any errors that correlate with the failed rendering. -- Bob In reply to Bob Mahar ### Re: Macros for GT LT, etc are rendered as code by Alex Jordan - For you, "x$GTE-$int" is being interpolated as x<U>&gt;</U>-$int

in this setting. But for me (and it sounds like Glenn), it is interpolated as

x\ge -$int I'm not sure what is going on. This is math content within HTML output. I see from https://github.com/openwebwork/pg/blob/37637e2f880bccbbb8781b5d669421849ac81267/macros/PGbasicmacros.pl#L1547 that HTML mode interpolates$GTE using the U tag.

So what is making it so that for me and Glenn, it actually comes out as "\ge" instead? If someone knows where that is controlled, maybe it gives a clue to where something should be changed on Bob's server.