Skip to content

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

Merged
pstaabp merged 1 commit into
openwebwork:PG-2.17from
somiaj:fraction-usetextstyle
Jul 8, 2022
Merged

In contextFraction only use \textstyle for mixed numbers.#683
pstaabp merged 1 commit into
openwebwork:PG-2.17from
somiaj:fraction-usetextstyle

Conversation

@somiaj

@somiaj somiaj commented May 26, 2022

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Member

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

@somiaj

somiaj commented May 26, 2022

Copy link
Copy Markdown
Contributor Author

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

somiaj commented May 29, 2022

Copy link
Copy Markdown
Contributor Author

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.

@pstaabp pstaabp left a comment

Copy link
Copy Markdown
Member

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.

@drgrice1 drgrice1 left a comment

Copy link
Copy Markdown
Member

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.

Comment thread macros/contextFraction.pl Outdated
  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

somiaj commented Jul 7, 2022

Copy link
Copy Markdown
Contributor Author

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.

5 participants