Skip to content
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

In contextFraction only use \textstyle for mixed numbers. #683

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

somiaj
Copy link
Contributor

@somiaj somiaj commented May 26, 2022

useTextstyle controls if the fraction's TeX output is displayed
using \textstyle or not. By default this is turned on to
match current behavior. It can now be turned off for users
who want to display fractions without \textstyle.

@Alex-Jordan
Copy link
Contributor

I have something like this on my school's server. Mine straight up removes the \textstyle and lets the output be what it would naturally be given where it is placed. However then it looks bad when it's display math and it prints a mixed number. So if it's showing mixed numbers, it still includes the \textstyle.

For me, I have too many exercises where I wanted the \textstyle to just go away and I wouldn't want to go through and set a context flag in all those exercise files. I'm not opposed to this change, I'd just leave my customized contextFraction.pl in place. But I thought I'd share what I do about this.

@drgrice1
Copy link
Member

I do the same thing as @Alex-Jordan. I use a custom version of this macro, and remove the \textstyle.

@somiaj
Copy link
Contributor Author

somiaj commented May 26, 2022

I agree, and would also prefer that textstyle wasn't used by default, though in the case of mixed fractions it is preferred. I did think of disabling it by default, and then turning it on if showMixedNumbers is set, and it might be worth updating it to do that.

I just went this route to not change the default behavior but allow users to be able to change this without having to use their own copy of the macro.

@somiaj somiaj force-pushed the fraction-usetextstyle branch from 6180326 to 7440023 Compare May 29, 2022 17:57
@somiaj somiaj changed the title Add useTextstyle option to contextFraction. In contextFraction only use \textstyle for mixed numbers. May 29, 2022
@somiaj
Copy link
Contributor Author

somiaj commented May 29, 2022

I updated the pull request. Adding an option that many might not know about or use may not be that useful in the long run. Instead I updated this to only include \textstyle in mixed numbers, otherwise the fraction's output will be formatted based on \displaystyle. This seems to be what most are doing, and this will allow other users who don't want to have a local copy of this macro get this behavior. If it doesn't get accepted, Users can just run a local copy of the macro like everyone who has commented seems to be doing anyways.

Copy link
Member

@pstaabp pstaabp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it and works as indicated.

Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, other than a minor quibble on indentation.

macros/contextFraction.pl Outdated Show resolved Hide resolved
  Only use \textstyle formating option in a fraction's TeX output for
  mixed numbers. For other cases don't include this to allow the size
  of the fraction to be formatted according to \displaystyle.
@somiaj somiaj force-pushed the fraction-usetextstyle branch from 7440023 to f28a548 Compare July 7, 2022 17:31
@somiaj
Copy link
Contributor Author

somiaj commented Jul 7, 2022

Tabs changed to being 4 spaces to match surrounding indentation.

@pstaabp pstaabp merged commit 8e1d524 into openwebwork:PG-2.17 Jul 8, 2022
@somiaj somiaj deleted the fraction-usetextstyle branch July 21, 2022 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants