Comments (15)
@Alex-Jordan suggested removing the HTML_tth
code from pg:
But either way in time for the next release, it would be healthier for the code base to spend time in pg clearing away the references to retired output modes.
Note: since fallback uses HTML_hhh
before plain HTML
, this will require care to avoid unexpected changes to what will be rendered in the active modes.
from pg.
I found this bug in testing an .ova version I'm putting together (Ubuntu 20.04 Server, WW 2.15, Apache2, Lighttpd, Rserver, cronjob for temp file removal, timing.log rotation, etc.). Hopefully this will work in a lot of setting. The original version (from VirtualBox) now on the web doesn't work well on other platforms. Hopefully the new one I'm testing (from VMware) will work. My point is I don't like to distribute things with known bugs so I think I'll distribute an edited version of PGbasicmacros.pl with the change:
HTML_MathJax => [ "HTML", "HTML_dpng", "HTML_tth", ],
which (as Nathan suggested) fixes the immediate bug.
When a fix (hot or not) uploaded, this can get over written but probably many people don't apply hot fixes or update their system.
from pg.
I'm with Alex in that in the long term I'd like to see all of the references to LaTeX2HTML and HTML_tth removed. We are no longer supporting them. (I don't think either of them has implementation code distributed with webwork anymore. I think we should also remove references to jsMath unless someone thinks that still works faster than MathJax in certain cases.
It looks to me as if the assumption was that the tex codes for MathJax (HTML_MathJax) were assumed to be exactly the same as the tex codes for HTML_tth. Hence no specific references for HTML_MathJax were added. Is that not true? what are the correct codes for MathJax for these items? How does that compare to the codes for PTX?
from pg.
I guess I am not so concerned about removing these old display modes and it breaking a problem. Because webwork2
isn't supposed to be supporting these anyway. So if removal breaks a problem, it means that the problem was "supposed" to be broken and was only passing by because of an accident. And we could go the extra mile and proactively examine the OPL problems that mention tth
(there are 31, plus 6 macro libraries).
from pg.
Most (if not all) of the time it is part of a MODES command, so if the user is not using tth, it will not come up.
from pg.
To answer Nathan's question, this is an old bug. At least it appears in WW2.13 which is the only older version I tested. My "patch" is to use
HTML_MathJax => [ "HTML_dpng", "HTML", "HTML_tth", ],
In PGbasicmacros.pl, basically the only places HTML_tth appears are in the macros that cause problems (LB, etc) so at least as far as PGbasicmacros.pl is concerned, the above should cause no problems.
from pg.
I think this is more complicated than we had hoped.
@mgage wrote:
It looks to me as if the assumption was that the tex codes for MathJax (HTML_MathJax) were assumed to be exactly the same as the tex codes for HTML_tth. Hence no specific references for HTML_MathJax were added. Is that not true? what are the correct codes for MathJax for these items? How does that compare to the codes for PTX?
@apizer wrote:
In PGbasicmacros.pl, basically the only places HTML_tth appears are in the macros that cause problems (LB, etc) so at least as far as PGbasicmacros.pl is concerned, the above should cause no problems.
Yes, most of the use of a HTML_tth
definition seems to be in the macros which were broken, but not all of them. The patch was mainly intended to verify that the fall-back order was the reason that MathJax "mode" was give "tth" output. Thinking about all the macros of this style which have HTML_tth
definitions leads me to think that we may be oversimplifying the issue and thus also the patch. There are 8 macros marked with either not for use in math mode
or only for use in math mode
and these are the macros which have a HTML_tth
setting and are making problems.
Four of the macros @apizer had problems with ($LBRACE
, $RBRACE
, $LB
, $RB
) are intended for use only outside math mode - so should be generating "plain HTML" and not something to be handled by MathJax inside a WW math block. For those 4 macros, it seems that HTML_MathJax
should be acting like plain HTML
mode, and that is the effect of the change in fall-back order.
However, the other two ($LTE
, $GTE
) @apizer mentioned as well as $LTS
and $GTS
are intended for use in math mode, so apparently should prefer the LaTeX style output - so should behave like HTML_tth
did (as in the prior fallback order) and should not be creating "plain HTML" output rather than a LaTeX macro.
It seems that any real fix which handles all 8 macros properly will require adding a HTML_MathJax
setting to at least 4 of these 8 MODES
based definitions.
from pg.
For some history, those markings (like "for math mode only") are comments I added when adding the PTX output. It did not make sense to me that someone would use something like $LBRACE
inside math mode. Why wouldn't they use \{
? And in PTX, outside math mode, it would just be {
while inside it would be \{
, so they are distinguished. These macros are "unaware" of whether they are being executed inside math mode, so the question was how to make them have different outputs depending on use in or out of math?
There were similar issues with the others. It's possible that my declarations for these to be used "only in math mode" (or not) are incorrect. I'm grateful for any second opinions on those declarations.
from pg.
It has been a very long time since I thought about any of this, but I do not think any of these macros were intended to be used in math mode. In a math expression, people should use LaTeX. There is probably documentation on this somewhere.
from pg.
It has been a very long time since I thought about any of this, but I do not think any of these macros were intended to be used in math mode. In a math expression, people should use LaTeX. There is probably documentation on this somewhere.
That is what I would have thought. But I was led to believe these for are for use inside math:
sub LTS { MODES(TeX => '<', Latex2HTML => '\\lt ', HTML => '<', HTML_tth => '<', PTX => '\lt' ); }; #only for use in math mode
sub GTS { MODES(TeX => '>', Latex2HTML => '\\gt ', HTML => '>', HTML_tth => '>', PTX => '\gt' ); }; #only for use in math mode
sub LTE { MODES(TeX => '\\le ', Latex2HTML => '\\le ', HTML => '<U><</U>', HTML_tth => '\\le ', PTX => '\leq' ); }; #only for use in math mode
sub GTE { MODES(TeX => '\\ge ', Latex2HTML => '\\ge ', HTML => '<U>></U>', HTML_tth => '\\ge ', PTX => '\geq' ); }; #only for use in math mode
because of things like the TeX => '\\ge ',
. Outside of math in TeX, that macro is undefined by default. And unless you use the math font, are you even going to have a character for $GTE
outside of math mode with vanilla pdflatex?
And also TeX => '>',
. IIRC, in older pdflatex (contemporary with when these were written), outside of math mode, these come out as inverted question marks or something like that.
from pg.
I agree that there seems to be some confusion about these 4 macros ($LTS
, $GTS
, $LTE
, $GTE
). The comment added into PGbasicmaros.ps
about them being meant for use in math mode seems not to make much sense, as the we have TeX notation to use. In fact, I did some digging in the Wiki to see what is written about them - and found that all 4 are marked as deprecated in https://webwork.maa.org/wiki/Display_Macros .
A Google search also found
https://query.libretexts.org/Assessment_Gallery/Mathematics/WeBWorK_Import/WeBWorK/WeBWorK_tutorial/Fort_Lewis_tutorial_2011/120-pg-special-characters.pg which does not mention these macros and directs to use math mode.
It does seem that there may be some "legitimate" need for these macros in text mode, for use inside popup menus, which is one of the use cases found in the OPL.
I found some 140 occurrences in the OPL using grep
and some use these macros inside math and some outside (particular inside Popup answers). The use inside popup's make sense, as as far as I recall math notation can not be used in them, but HTML entities should work. The list of what I found is in a following post.
Wherever these macros are used in the OPL inside Math mode, they could be replaced by the TeX alternative.
It seems to me that as long as they exist in the code-base - they should probably be designed to work outside math mode, where they are arguable needed, even if they will not behave as nicely in math mode or in PDF output, For TeX
mode we would want some "reasonable" definition that works outside of Math mode (<=
for $LTE
???).
If we do leave active patched definitions for these 4 macros, I recommend redefining the HTML
setting for $LTE
and $GTE
to take advantage of the Unicode support in modern browsers and just use the HTML entities ≤
and ≥
rather than the old hack using an underline.
I ran into a site with a table of many math symbols from Unicode at https://www.toptal.com/designers/htmlarrows/math/
from pg.
Found in the OPL (note that one hit also used $LBRACE
and $RBRACE
in math mode):
./Contrib/Keele/NuclearPhysics/Particles/BD_lepton_1_original.pg:66:$GTS \{ $muon->menu() \}
./Contrib/Keele/NuclearPhysics/Particles/BD_lepton_1_original.pg:67:$GTS \{ $electron->menu() \}
./Contrib/Keele/NuclearPhysics/Particles/BD_lepton_1_original.pg:68:$GTS \{ $neutrino->menu() \}
./Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg:42:$symbol = $GTS; #Don't use < or > directly.
./Contrib/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph20.pg:42:$symbol = $LTS; #Don't use < or > directly.
./Contrib/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers20.pg:78: [`[$frac]\, [$LTS]\,[$integer]`]
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg:60: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg:65: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg:70: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg:78:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg:60: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg:65: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg:70: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg:79:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions80.pg:60: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions80.pg:65: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions80.pg:70: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions80.pg:78:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg:55: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg:60: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg:65: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg:74:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg:60: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg:65: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg:70: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg:79:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions90.pg:61: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions90.pg:66: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions90.pg:71: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions90.pg:78:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions40.pg:55: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions40.pg:60: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions40.pg:65: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions40.pg:74:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg:55: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg:60: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg:65: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg:74:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions70.pg:65: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions70.pg:70: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions70.pg:75: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./Contrib/PCC/BasicMath/FractionsCalculation/CompareFractions70.pg:84:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality130.pg:77:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality130.pg:78:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg:77:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction60.pg:78:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg:133:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation20.pg:134:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SetNotationToGraph10.pg:40:$symbol = $GTS; #Don't use < or > directly.
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd40.pg:81:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd40.pg:82:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg:133:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation30.pg:134:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg:85:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd70.pg:86:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd80.pg:82:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd80.pg:83:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality10.pg:72:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality10.pg:73:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality110.pg:77:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality110.pg:78:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality40.pg:71:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality40.pg:72:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd50.pg:83:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd50.pg:84:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality310.pg:75:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality310.pg:76:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg:73:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality170.pg:74:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg:134:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation10.pg:135:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality240.pg:78:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality240.pg:79:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg:77:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction10.pg:78:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg:133:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/GraphToSetAndIntervalNotation40.pg:134:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality20.pg:72:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality20.pg:73:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality180.pg:73:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality180.pg:74:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality60.pg:87:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality60.pg:88:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg:78:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction70.pg:79:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality320.pg:78:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality320.pg:79:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality70.pg:71:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequality70.pg:72:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg:92:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/SolveInequalityWithFraction30.pg:93:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg:79:* *[$GTS]=* for [`\geq`],
./OpenProblemLibrary/PCC/BasicAlgebra/LinearInequalities/CompoundInequalityAnd60.pg:80:* and *[$LTS]=* for [`\leq`]
./OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers10.pg:50:$popup = PopUp(['?', $LTS, $GTS, '='], $LTS);
./OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers10.pg:77:If you have trouble differentiate between [$GTS] and [$LTS], remember this trick: The alligator eats the bigger number. That's why we write [`2[$GTS]1`], or [`1[$LTS]2`].
./OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations10.pg:60: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations10.pg:65: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations10.pg:70: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareFractionOperations10.pg:89:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./OpenProblemLibrary/PCC/BasicAlgebra/ComparisonsAndBasicInequalities/CompareNumbers20.pg:75: [`[$frac]\, [$LTS]\,[$integer]`]
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg:57: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg:62: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg:67: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions60.pg:75:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg:57: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg:62: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg:67: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions30.pg:76:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg:52: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg:57: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg:62: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions10.pg:71:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg:57: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg:62: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg:67: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions50.pg:76:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg:52: $popup = PopUp(["?", $LTS, $GTS, "="], $LTS);
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg:57: $popup = PopUp(["?", $LTS, $GTS, "="], $GTS);
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg:62: $popup = PopUp(["?", $LTS, $GTS, "="], "=");
./OpenProblemLibrary/PCC/BasicMath/FractionsCalculation/CompareFractions20.pg:71:Choose [`[$LTS]`], [`[$GTS]`], or [`=`] to make a true statement.
./OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/CompareNumbers50.pg:78: $popups[$i] = PopUp(['?', $LTS, $GTS, '='], $GTS);
./OpenProblemLibrary/PCC/BasicMath/IntegerAndSquareRoot/CompareNumbers50.pg:81: $popups[$i] = PopUp(['?', $LTS, $GTS, '='], $LTS);
./OpenProblemLibrary/270/setDerivatives12MVT/c3s2p1.pg:81:\{ ans_rule(10) \}\( $LTE \) \{ ans_rule(10) \}
./OpenProblemLibrary/Rochester/setDiscrete5Algorithms/ur_dis_5_1.pg:35:$BBOLD while $EBOLD n \( $GTS \) 0 $BR
./OpenProblemLibrary/Rochester/setDiscrete5Algorithms/ur_dis_5_1.pg:50:$BBOLD while $EBOLD n \( $GTE \) 0 $BR
./OpenProblemLibrary/Rochester/setDiscrete5Algorithms/ur_dis_5_1.pg:73:$BBOLD while $EBOLD i \( $LTS \) 10 $BR
./OpenProblemLibrary/Rochester/setAlgebra16FunctionGraphs/c0s5p4.pg:30: \(-1 $LTS x $LTS 1\) $BR
./OpenProblemLibrary/Rochester/setAlgebra16FunctionGraphs/c0s5p4.pg:31: and \(x\in[-1,1]\) means \(-1 $LTE x $LTE 1\).
./OpenProblemLibrary/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/1_Precalculus_Review/1.3_The_Basic_Classes_of_Functions/1.3.1.pg:32:$mc->qa('Determine the domain of the function.', "\( x $GTE 0 \)");
./OpenProblemLibrary/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/1_Precalculus_Review/1.3_The_Basic_Classes_of_Functions/1.3.1.pg:33:$mc->extra("\( x $LTE 0 \)", "all Real numbers");
./OpenProblemLibrary/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/1_Precalculus_Review/1.3_The_Basic_Classes_of_Functions/1.3.5.pg:32:$mc->extra("\( x $GTE -$int \)", "\( x $LTE -$int \)", "all Real numbers");
./OpenProblemLibrary/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/4_Applications_of_the_Derivative/4.4_The_Shape_of_a_Graph/4.4.9.pg:77: $int1_fsign = "$GTS 0";
./OpenProblemLibrary/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/4_Applications_of_the_Derivative/4.4_The_Shape_of_a_Graph/4.4.9.pg:81: $int1_fsign = "$LTS 0";
./OpenProblemLibrary/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/4_Applications_of_the_Derivative/4.4_The_Shape_of_a_Graph/4.4.9.pg:86: $int2_fsign = "$GTS 0";
./OpenProblemLibrary/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/4_Applications_of_the_Derivative/4.4_The_Shape_of_a_Graph/4.4.9.pg:91: $int2_fsign = "$LTS 0";
./OpenProblemLibrary/WHFreeman/Rogawski_Calculus_Early_Transcendentals_Second_Edition/4_Applications_of_the_Derivative/4.4_The_Shape_of_a_Graph/4.4.47.pg:176:Let \[f(x) = \{$f->reduce->TeX\}, \; 0 $LTE x $LTE 2 \pi\]
./OpenProblemLibrary/NAU/setFoundations/MAT320_0403.pg:53:Determine whether the given equality is true (T) or false (F). We use standard notation for intervals (open, closed, or half-open) in the set of real numbers. For instance, \( [a,b)=$LBRACE x \in {\mathbb R} \ | \ a $LTE x $LTS b $RBRACE \), and \( (a,\infty)=$LBRACE x \in {\mathbb R} \ | \ x $GTS a $RBRACE \). The set of positive integers is denoted by \( {\mathbb N} \). $BR
./OpenProblemLibrary/Michigan/Chap17Sec5/Q15.pg:94:with angle brackets: e.g., as $BBOLD${LTS}${SPACE}1 + s + t, s - t, 3 - t$SPACE$GTS$EBOLD.)$EITALIC
./OpenProblemLibrary/Michigan/Chap17Sec5/Q17.pg:86:$BBOLD${LTS}${SPACE}1 + s + t, s - t, 3 - t$SPACE$GTS$EBOLD.)$EITALIC
./OpenProblemLibrary/Michigan/Chap13Sec2/Q19.pg:84:\( \vec v = ${LTS}$midscores$GTS \).
./OpenProblemLibrary/Michigan/Chap13Sec2/Q19.pg:86:\( \vec w = $LTS$finscores$GTS \). If the final counts twice as much as the
./OpenProblemLibrary/Dartmouth/setStewartCh13S1/problem_5.pg:48:$LTS, $LTS =, =, $GTS =, $GTS\)
from pg.
Why wouldn't they use
\{
?
Just for the record and people who Google when they have issues, when coding in the "old" style (not using PGML, ex. using BEGIN_TEXT
and END_TEXT
) \{
does not work inside math (between \(
and \)
) as it is used to denote the start of embedded Perl code. Instead use \lbrace
in math mode.
Using \{
as in
\( \displaystyle \left\{ (x,y) \rule{0pt}{12pt} \right| \)
\{ $ansA1->ans_rule(8) \}
causes the MathJax no to render and triggers the WeBWorK Warnings
similar to
ERROR in old_safe_ev, PGbasicmacros.pl:
## There is an error occuring inside evaluation brackets \{ ...code... \}
## somewhere in an EV2 or EV3 or BEGIN_TEXT block.
## Code evaluated:
## (x,y) \\rule{0pt}{12pt} \\right| \\)
\\{ $ansA1->ans_rule(8)
##syntax error at line 3 of (eval 8348), at EOF
(Might be a runaway multi-line )) string starting on line 2)
##
from pg.
I have looked into this thoroughly.
First, there is no possible way to make PG work to output these correctly in both math mode and not in math mode in any reliable way. I have looked at the code closely and analyzed the possibilities, and it is clear that it simply can not be done.
Now, there really is no doubt that none of $LBRACE
, $RBRACE
, $LB
, or $RB
should ever be used in math mode.
Also, it seems clear that $LTE
, $GTE
, $LTS
, and $GTS
should be removed from the code and never used at all.
The only way to fix this is to fix the problems and stop authors from continuing to use the first set of variables in math mode and the rest at all. Fortunately there are less than 390 problems in the OPL and Contrib combined (and a few more in Pending) that even use any of these variables. I am not sure how many of those use the variables incorrectly in math mode. Most of the problems that I looked at seemed to be using these variables incorrectly.
Now don't think that incorrect usage in the OPL is a sign that the correct think to do is to go the other direction and only allow the usage in math mode, because that is simply wrong. The only reason these are working in math mode now is because things are so broken that in fact the only output from the subroutines that define these variables are always (well except in PTX output and HTML output) outputting the TeX result. Note that the HTML (plainText) output mode is not seriously used by anyone directly. It is really just a fallback mode.
The discussion about using \{
causing problems in PG should be disregarded. Just use \lbrace
instead. That is what $LBRACE
gives you anyway. Furthermore, in math mode in actual TeX \{
just calls \lbrace
(the definition in latex.ltx is \protected\def\{{\ifmmode\lbrace\else\textbraceleft\fi}
). In MathJax these are also the same.
So the point is that it is entirely pointless to use these in math mode. Furthermore, making it so these work in math mode additionally makes the existence of the variables in PGbasicmacros.pl pointless.
from pg.
On a side note, why do we define LTE
by <U><</U>
and GTE
by <U>></U>
in HTML output mode? Why not use ≤
and ≥
which are more proper.
from pg.
Related Issues (20)
- Bug when a matrix Math Object is reused as an answer HOT 10
- PGML.pl has lines that should have been removed. HOT 1
- checkboxlist within a RadioMultiAnswer HOT 4
- Using upToConstant with complex numbers HOT 4
- keyboard issue with GraphTool HOT 8
- inconsistency in multiple choice macros HOT 4
- run-perltidy deletes .bak files
- Error answers now are escaped when they shouldn't be. HOT 1
- Cropping from pgfplots is not always working for final SVG output HOT 13
- variables declared with `my` lead to errors HOT 1
- student answers get spaces normalized
- iframeResizer, feedback popover, and mqeditor HOT 16
- Updating AnswerFormatHelp.pl HOT 5
- Viewing all correct answers at the same time HOT 4
- PTX "image" tag getting changed to "img" HOT 5
- error with brace and x HOT 9
- PG editor not decoding as expecting HOT 1
- macros/graph/PGnauGraphics.pl doesn't use unique name, which can break tests. HOT 1
- CheckboxList reveals the correct answers HOT 3
- MathQuill toolbar placement in a relatively positioned parent - bug when in an RTL course. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pg.