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

customize equations #718

Merged
merged 5 commits into from
Jun 13, 2022
Merged

customize equations #718

merged 5 commits into from
Jun 13, 2022

Conversation

12rambau
Copy link
Collaborator

Fix #699

I force the equation wrapper to fit the article width. I needed to tweek the display of equations number and link to display them on the same line.

The math element is done in the following order:

  • number
  • link
  • equation

Unless we use obsolute positionning (what was previously done) the number need to be displayed first. IMO that's not disturbing at all but if people are used to scientific publication they will surely complain. Let me know

@12rambau 12rambau marked this pull request as ready for review June 11, 2022 12:44
Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

I think that this would get the numbers back on the right side, would that work? I think folks will definitely prefer equation numbers on the right (it also looks better with the hyperlink that way)

@choldgraf
Copy link
Collaborator

Also at least on my phone, the header button still goes off to the right. This is because the hyperlink in this text:

presented here are just a sample of the many reStructuredText Directives. For others, please see: http://docutils.sourceforge.net/docs/ref/rst/directives.html.

spills off to the right of the page. So it seems like it isn't just equations?

12rambau and others added 2 commits June 11, 2022 16:07
Co-authored-by: Chris Holdgraf <choldgraf@gmail.com>
@12rambau
Copy link
Collaborator Author

So it seems like it isn't just equations?

In my case I see the btn even though article is more that 100% width:

Capture d’écran 2022-06-11 à 16 23 29

That being said I don't think we want to cut long link names, instead, people should wrap them in readable links. Let me do it in our docs

@choldgraf
Copy link
Collaborator

So for some reason, I can only replicate this on my computer when I do two things:

  1. Make the screen width narrow
  2. Set the "device type" to "mobile"

Here's an example:

chrome_uMBt6DQMyZ

@12rambau
Copy link
Collaborator Author

I'm unable to reproduce it on Safari or my iphone, and I'm not sure we want to go down every edge case in this PR. On the other hand the main issue is not being able to see the full navbar and specifically the menu btn. In my last commit I forced the max-width of the navbar to never exceed the width of the viewport. Could you test it and let me know ?

If it works I would say we merge this one and deal with the edge cases in other issues.

Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

That seems to have worked! This LGTM

@12rambau 12rambau merged commit 7602aa3 into pydata:main Jun 13, 2022
@12rambau 12rambau deleted the math branch June 13, 2022 06:11
@larsoner
Copy link
Contributor

I think this PR (and specifically the display:flex made inline rendered objects display on a new line:

https://github.com/pydata/pydata-sphinx-theme/blame/4791bd83eb52a12c08f1d81390f7ab3e8bc2ac97/src/pydata_sphinx_theme/assets/styles/content/_math.scss#L6

For example https://mne.tools/dev/overview/implementation.html#the-forward-solution produces something wrong

Screen Shot 2022-07-13 at 3 28 36 PM

Removing the display: flex from CSS fixes it

Screen Shot 2022-07-13 at 3 29 00 PM

@12rambau any ideas on a correct fix?

@drammock
Copy link
Collaborator

is there a way to target just display math and not inline math? Looking at the browser inspector, it looks like display math is a div and inline is a span... but the first child mjx-container has a display="true" attribute that maybe is what we want to detect?

@choldgraf
Copy link
Collaborator

I opened an issue to track this one! #809

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.

Mobile view with wide content causes the navbar button to disappear to the right
4 participants