mathjax / MathJax-node

MathJax for Node
Apache License 2.0
616 stars 97 forks source link

Accented i in TeX font #362

Closed wrvc3000 closed 7 years ago

wrvc3000 commented 7 years ago

Hi, thanks for your hard work in this library!

We are having a small issue with the accented i with TeX font. The i is rendered with the dot and also with the accent symbol so it looks very strange (I'm attaching an screenshot). It should be rendered with the accent symbol and without the dot like in í

Thank you!

screen shot 2017-09-27 at 09 26 03

pkra commented 7 years ago

Can you please provide some example code?

wrvc3000 commented 7 years ago

Of course, this should work:

var mjAPI = require("mathjax-node");
mjAPI.config({
    MathJax: {
    SVG: {
        font: 'TeX'
    }
    }
});
mjAPI.start();

mjAPI.typeset({
    math: 'C=\{x | x\ es\ un\ pa\acute{i}s\}',
    format: 'TeX',
    svg: true
    }, function (data) {
    if (!data.errors) {
        //add data.svg to html page ...    
    }   
    });

All other accented vowels (á, é, ó, ú) look good, it's just the accented i ( í ) that looks strange.

Thank you!

pkra commented 7 years ago

This is expected behavior and matches real TeX layout.

You could use \imath instead of i to get what you're after but it would generally be better to wrap text in \text{} and use the appropriate Unicode í or html entity, e.g., í.

wrvc3000 commented 7 years ago

It's solved thanks! just for the record math should be:

C=\{x | x\ es\ un\ pa\acute{\imath}s\}

in order to render:

screen shot 2017-09-27 at 15 04 46