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

Allow named units to have a LaTeX representation (WIP) #1069

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rieder
Copy link
Member

@rieder rieder commented Sep 3, 2024

No description provided.

@rieder rieder requested a review from a team as a code owner September 3, 2024 14:15
@rieder
Copy link
Member Author

rieder commented Sep 3, 2024

Meant to allow for nice LaTeX representations like R_{\odot} instead of RSun

@rieder
Copy link
Member Author

rieder commented Sep 4, 2024

@spzwart @LourensVeen I'd like your thoughts on this.
The aim is to allow us to use this in e.g. axes for plots, where using "RSun" just looks stupid and manually putting in the unit leads to potential unit errors (I just found one in the book).

@LourensVeen
Copy link
Collaborator

Sounds like a good idea. The one thing that comes to mind is that these symbols are probably in Unicode, and that we could do that. But I'm not sure how well Unicode works in LaTeX, although it will probably work in plotting software.

Maybe something to test, it's nicer and more modern. On the other hand, LaTeX is still very widely used in science, so if Unicode doesn't solve the problem then it'll be good to have for sure.

@rieder
Copy link
Member Author

rieder commented Sep 11, 2024

Unicode can work (☉ for \odot etc), but some older LaTeX implementations don't accept unicode. Also, unicode doesn't do sub/superscript etc.
We could easily also add a unicode representation, where we write L☉ instead of LSun for example, but I think that wouldn't be as directly beneficial (matplotlib parses LaTeX, so that immediately works).

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.

2 participants