+1
COMPLETADO

Latex math mode support in article titles

Greg Christian hace 9 años actualizado por Mark C. Wilson hace 4 años 9
First, let me say that this is an amazing service and I really appreciate all of the effort going into it. One suggestion for making it even better is to enable support for math mode in article titles. For example, at present the title
"Three-body correlations in the ground-state decay of $^26\mathrmO$."

renders literally, while I would like it to display as
"Three-body correlations in the ground-state decay of 26O."

In my field, using math mode is extremely common in article titles, so my publications page is full of dollar signs and Latex commands. It's readable enough (and most visitors can process the latex in their heads), but would look better with the math rendered.

Note that support for greek letters would be nice too - not just superscripts.

Thanks!

Respuesta

Respuesta
COMPLETADO
Greg,

Thanks, I think that was a really good idea, and thanks for pointing me to mathjax. I didn't know about that.

I've already gone ahead and made the necessary changes. In fact, bibbase itself will now load mathjax and translate math latex to mathml/html+css.

Your bibtex entry now looks like this:



I was testing with your site (http://people.physics.tamu.edu/christian/test/cv.html) but there are still some issues there (e.g. \mathrm is not interpreted correctly). Perhaps these are because we are now both calling mathjax, so please see whether this resolves when you remove that separate call from your page. Also, I noticed that you use "\(.. \)" in one instance. That is not implemented (or at least the brackets within those environments will still be removed). But if you replace that with $...$ then it should work.

Thanks again for a great suggestion. I'm sure other bibbase users will be happy to use the new feature.

I looked into this some more myself, and by including a call to MathJax on my page I am able to get math to display in my title. However, all of the curly brackets are getting stripped out before MathJax has a chance to run, so I'm still left with strange looking titles because something like $^{26}\mathrm{O}$ gets turned into $^26\mathrmO$ which MathJax renders as 26\mathrmO.

Perhaps a simple solution is to allow an option where the curly brackets are not stripped out, for people who want to run MathJax on their pages?
Respuesta
COMPLETADO
Greg,

Thanks, I think that was a really good idea, and thanks for pointing me to mathjax. I didn't know about that.

I've already gone ahead and made the necessary changes. In fact, bibbase itself will now load mathjax and translate math latex to mathml/html+css.

Your bibtex entry now looks like this:



I was testing with your site (http://people.physics.tamu.edu/christian/test/cv.html) but there are still some issues there (e.g. \mathrm is not interpreted correctly). Perhaps these are because we are now both calling mathjax, so please see whether this resolves when you remove that separate call from your page. Also, I noticed that you use "\(.. \)" in one instance. That is not implemented (or at least the brackets within those environments will still be removed). But if you replace that with $...$ then it should work.

Thanks again for a great suggestion. I'm sure other bibbase users will be happy to use the new feature.

PS: I realized that the difference of appearance on your site vs. my test site was just due to a caching issue. It now appears just right, except that you will see that mathjax does not support some commands like \ensuremath (and the issue of using "\(" instead of "$" remains, too).

This is excellent, thank you!

I've cleaned up the few instances of commands that don't work, switched the \(...\) back to $...$ (that was just me testing out different things, since $...$ isn't supported by default in MathJax), and now all the titles look great.

Please check out the top publication at 

http://www.michaelbeeson.com/research/papers/pubs.html

which contains $3 \alpha + 2\beta = \pi$ in the title.  It is incorrectly rendered.

Also scroll down that page for other examples of incorrect rendering.  

For example G{\"o}del,  which in Ticket 76  Christian advised me to fix by inserting the braces,

but they did not help, and I got no further reply.   There is also a French title with a completely 

garbled word,  which uses TeX for the accented characters.   (After all it comes from a bibTeX file! so 

it has to use TeX.)   

Please, please fix this issue.    By the way,  it's also not rendering correctly on BibBase's website, if I go to 

My Publications,  though the alpha and beta work there,  the pi does not.   On my website it's just 

the other way around,  pi works but alpha and beta do not.   There is a mathjax call on my page,  without it

the pi also doesn't render.  

I am having similar problems with MathJax rendering. See https://markcwilson.site/Research/Outputs/papers.html

which embeds the result of processing my bibfile via bibbase.org. The output looks great on bibbase.org but not when embedded (e.g. abstract for 3rd paper in 2019). I have tried using the MathJax-related code from the source of the version on  bibbase.org, but no luck.

By the way Michael Beeson's example renders perfectly for me on bibbase.org, including alpha, beta, pi and French accents.

+1

For completeness the answer for my problem was to add:

<meta charset = "UTF-8"> to the head of the calling page. Thanks Christian!