-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typeset noun form of basic arithmetic operators as regular infix operators. #1199
Comments
This idea is interesting to me! I like having finer control over how things are displayed, and I prefer to avoid having to construct my own tex strings. Another two examples that feel relevant/similar to me are:
I'm not even sure either of these would be fixed by something like Sean has suggested, but I like the spirit anyway! |
The substantive issue here is better support for selective simplification. I wrote a parallel elementary simplifier to support this answer test: https://docs.stack-assessment.org/en/Authoring/Answer_Tests/Rule_based/ This creates parallel "noun" forms of all the elementary operations, e.g. noun+ is a parallel infix +. This is to avoid the use of "+"(1,2) as a prefix notation. @mrseanman, sorry but I have no plans to typeset '"+"(1,2) as infix notation (as requested). I think that's a work-around, but that's not the right direction to go in. Instead, the plan is to expand the rule-based answer test functionality to expose this as a selective simplifier. Please look at that functionality first. Note that the parser we have in PHP does not currently allow teachers to use the (parallel) noun+ operators. That's by design, because the 1st draft of the rule-based simplifier was not designed for end-user use, rather it was designed to support internal computation in the answer test. We may change those decisions and expose the simplifier. Thanks for the comments @LukeLongworth but now we're conflating a lot of separate display requests into a single issue about selective simplification! You probably have no idea how difficult it was to get Maxima to display sin(x)^2 as sin^2(x), but I was persuaded to do this by a number of people to follow common practice in typesetting! The code starts here STACK already defines an nth root function |
Thanks for the response Chris, I did suspect that I was jumping around a few different things here. None of those issues were particularly important to me, I mostly commented because I was interested in the discussion here! I've not used those noun_simp.mac functions before and this has got me interested to play around with them. I'd happily have a look at writing a flag to switch between f^2(x) and f(x)^2, and write the texput for 'root. Should the latter live in assessment.mac? |
@LukeLongworth, I'll sort out the display of "root" should only be a few lines, and changes to existing unit tests. |
@sangwinc Many thanks for your reply. I would argue that maxima already has some sort of selective simplification, in the form of the |
@mrseanman, that's fair enough comment: maxima does have it's |
Just reviewing issues. I'm happy to add in code to STACK which would display noun prefix operators such as |
Hi @sangwinc, happy to have a look in to that. I'll first look in to a way to |
Thanks @mrseanman, this kind of contribution to STACK is very welcome. |
The STACK documentation recommends using
simp: false
for cases where you don't want certain expressions to be evaluated. I find this works OK, but it is often useful to have finer control of exactly what is and isn't evaluated. Also, havingsimp: false
looming around has obvious undesirable effects.I think using nouns and the
'
prefix would be a good alternative tosimp:false
. Unfortunately, the only way to access the noun form of basic arithmetic operators is to use them as prefix functions, e.g.'"+"(1,2)
.In maxima itself, using the noun form of simple arithmetic operators typesets nicely (in the command line). E.g.
'"+"(1,2)
returns1 + 2
. However the latex is typeset as{\it mplus}\left(1 , 2\right)
.This prefix tex typesetting is the only thing stopping me from using this as an alternative to
simp:false
. The slight added difficulty of using prefix functions is not so bad. I think this would be a nice feature, depending on how difficult it would be to change how'"+"
etc are typeset.The text was updated successfully, but these errors were encountered: