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

improve docs by writing chemical species upright #9

Open
Mo-Gul opened this issue Feb 28, 2022 · 10 comments
Open

improve docs by writing chemical species upright #9

Mo-Gul opened this issue Feb 28, 2022 · 10 comments

Comments

@Mo-Gul
Copy link

Mo-Gul commented Feb 28, 2022

Currently

```math
CH_4 + O_2 \to CO_2 + H_2 O
```

is rendered as

grafik

on https://zlatanvasovic.github.io/ChemEquations.jl/dev/.

But as you for sure know, chemical species should be written in an upright font. I think it should be possible to achieve that with the mhchem extensions of MathJax and KaTeX, depending on which renderer you are using. Please have a look at

https://mhchem.github.io/MathJax-mhchem/

@zlatanvasovic
Copy link
Owner

You're absolutely right, I'll check your proposal. If you manage to make a working solution, you're always welcome to submit a PR here. 😄

@Mo-Gul
Copy link
Author

Mo-Gul commented Mar 1, 2022

I'd love to provide a PR, but unfortunately I am an absolute newbie to Julia and thus have no clue how I would get the resulting HTML output from Documenter.jl. Said that I can't test if a proposal works ...

@longemen3000
Copy link

the text encased in math quotes is valid latex. you could write straight text by using \text{Text} or \textrm{Text}. for example:

 \text{CH}_4 + \text{O}_2 \to \text{CO}_2 + \text{H}_2 \text{O} 

renders as:
image

@ProfLeao
Copy link

Has anything been done in this direction? If not, I can try to do something.

@Mo-Gul
Copy link
Author

Mo-Gul commented May 13, 2024

Nope, the equation is still rendered as "pure math". Of course the trivial fix would be to apply longmen's solution (assuming it works). Would you be willing to have a look at mhchem or what is your plan?

@ProfLeao
Copy link

I plan to enable MathJax3 as the default math engine and then use mhchem. I believe this will provide a greater number of possibilities for writing chemical equations in the documentation.

@Mo-Gul
Copy link
Author

Mo-Gul commented May 14, 2024

That sounds great to me, but let's hope that @zlatanvasovic is still active and will approve your PR.
I keep my fingers crossed ...

@ProfLeao
Copy link

I've written him a few emails. In his own time he will.

But this is a little more complicated, the intervention in the documentation is a bit deeper. The language has changed a lot since the package was last updated.

Take the expected behavior of the equationmatrix method for example, it's not like that anymore.

jldoctest
julia> equationmatrix(ce"H2 + Cl2 → HCl")
2×3 Array{Int64,2}:
 2  0  1
 0  2  1

I'm currently tracking this kind of update, otherwise the build won't work.

@ProfLeao
Copy link

PR #11 to see the proposed updates.

@ProfLeao
Copy link

#11 (comment)

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

No branches or pull requests

4 participants