jsMath and accented characters

  • Igor

    Igor - 2008-06-07


    I'm using jsMath (btw, it's a great tool) daily on my website and I had no problems with it. Until now.

    Let me explain, I'm from Central Europe and in our alphabet we have also accented characters, which I need to use in the mathematical texts. I've tried to use usual Latex syntax e.g. \v{c}, but jsMath returns "Unknown control sequence".

    Any ideas how to solve this?


    Best regards,

    • Davide P. Cervone

      The reason for this is that jsMath only implements math-mode commands, and \v (and its cousins \', \`, \=, etc) are text-mode commands.  Indeed, they are explicitly disallowed in math mode (see the TeXbook, bottom of page 135), except within an \hbox, but jsMath does not process ANY commands within \hbox's.  So your \v{c} would not work in math mode even in TeX (unless it was in an \hbox).

      Instead, you should use the math-mode equivalents:  \hat, \acute, \grave, \check, \tilde, \dot, \ddot, \brev, and \bar.  E.g., $$\rm\check c$$ should get what you are looking for.

      Alternatively, you could enter the accented characters directly using unicode, as in č for the lower-case c with caron.  Or you could enter the character using our keyboard as you normally would in typing text.  Any characters jsMath doesn't recognize it just renders as themselves, so you should be able to include them just by typing them in with accents already in place.  But they might not fit in quite so well with the other math characters.  If you are using them as part of a word, put the whole word in an \hbox and the characters should all come from the default serif font.

      Hope one of these works for you.


      • Igor

        Igor - 2008-06-10

        Thanks for the quick answer., "\check" did the trick.

        All the best,


Log in to post a comment.