Skip to content

gh-113664: Improve style of Big O notation (math) #113724

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

Closed

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jan 5, 2024

Use :math: to render them as mathematic formulas.


📚 Documentation preview 📚: https://cpython-previews--113724.org.readthedocs.build/

Use :math: to render them as mathematic formulas.
@hugovk
Copy link
Member

hugovk commented Jan 5, 2024

Does :math: also work with PDF, EPUB and plain text builds?

https://docs.python.org/3/download.html

Copy link
Contributor

Choose a reason for hiding this comment

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

Digression: the Big O notation in select.rst is ... untraditional. I've never seen O(n) written as O(name of some variable). IIRC, all off these should be written as O(n). One can of course clarify n in a follow-up sentence in the docs.

@serhiy-storchaka
Copy link
Member Author

I cannot build EPUB due to unrelated error.

In PDF it renders naturally, except cases in select.rst where spaces between words are swallowed: $O(highest file descriptor)$. I tried different variants, like \text{} or \mathrm{}, but they do not work in HTML. Perhaps the best way is to simply use italic font here.

In plain text it is rendered literally, e.g. O(n\log{n}).

@hugovk
Copy link
Member

hugovk commented Jan 5, 2024

This PR with EPUB (in macOS Books):

image

image

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants