Skip to content

Conversation

@poke1024
Copy link
Contributor

I recently found that I like sans serif MathML fonts much better as they match the general Jupyter theme I use:

jupyter1
jupyter2

Maybe this is also interesting for #574, as this seems to use sans serif fonts for the code input? Here's what it looks like in the non-spiffified mathicsserver:

mathicsserver

I wonder where this should be configured;settings.py doesn't seem a good place to me.

@teaalltr
Copy link
Contributor

I like it too. We may use it as default output and use the current serif font for output in TraditionalForm.

@teaalltr
Copy link
Contributor

teaalltr commented Sep 25, 2016

I think the fraction doesn't look very good in Jupyter, unlike the traditional interface. It should have the same font size as the rest of the expression. In the traditional interface, the fraction bar seems a bit too think. There seems to be an option to control the fraction thinckess.

@poke1024
Copy link
Contributor Author

Turns out the fraction size depends on the display type of the <math> tag; if it's inline the fractions are vertically compressed, if it's block they are as they are in the traditional interface. As we do not specify display for <math>, I suppose Jupyter's default is different from the Mathics traditional default. So I now added display="block" to all <math> output to fix this:

jup2

@teaalltr
Copy link
Contributor

Looks better now 👍

# #convert_box(boxes)
mathml = '<math>%s</math>' % xml # convert_box(boxes)
if True: # configuration to be defined
xml = '<mstyle mathvariant="sans-serif">%s</mstyle>' % xml
Copy link
Member

Choose a reason for hiding this comment

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

can we add this as a settings option. Perhaps XML_FONT = None by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

@poke1024 I belive this is the only thing preventing us from merging the PR (?)

Copy link
Member

Choose a reason for hiding this comment

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

@GarkGarcia @sn6uv From a user standpoint, what is a "settings option" and how does one add this?

I like this feature.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please see PR #908

@mmatera
Copy link
Contributor

mmatera commented Sep 16, 2020

Would be possible to choose the output format as a command from inside Mathics?
Let's say
$UseSansserif=True;
from mathics turn the feature on, and

$UseSansserif=False;
brings to the default behavior.

I will try to take this on the weekend.

@rocky
Copy link
Member

rocky commented Sep 16, 2020

Good. The Mathematica way seems to be to do this as part of the web interface: https://community.wolfram.com/groups/-/m/t/402640

@mmatera mmatera mentioned this pull request Sep 19, 2020
@GarkGarcia GarkGarcia merged commit 83a5bc9 into mathics:master Sep 26, 2020
@axkr
Copy link

axkr commented Nov 6, 2020

Not sure, but it seems that here:

mstyle.setAttribute('displaystyle', 'true');

a new line:

mstyle.setAttribute('mathvariant', 'sans-serif');

is also necessary?

@rocky
Copy link
Member

rocky commented Nov 6, 2020

@axkr It would be helpful if you could upload before and after screenshots.

@mmatera I've been thinking about what you were saying about adding a PyMathics context and was wondering if $SansSerif too shouldn't be in some context. For example we could add a Mathics context for those things that are specific to Mathics and not in WL. I don't know. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants