Thursday, April 28, 2011

Mathematical set symbols in HTML

I wanted to put a bar over my variable such as not(x) and also some set symbols in my web page? How do I incorporate that in my html page.

From stackoverflow
  • For the set symbols, you ought to use unicode HTML entities.

    For the line over a variable (p), I'd rather use an alternate symbol for not, such as:
    ¬p (¬p)

    You may also, as a commenter pointed out, use the combining diacritical unicode HTML entity like so:
    p̅ (p̅)

    Lastly, you may use one of the CSS methods provided.

    Michael Haren : Those are great for the symbols but how about the bar?
    Michael Haren : Good point, I like that better, too.
    Paul Dixon : For a bar you could use the combining diacritic 0x0305 (see http://unicode.org/charts/PDF/U0300.pdf)
    Triptych : Very cool Paul; I didn't know about this. Added to my answer.
    Dominic Rodger : FWIW, that diacritic doesn't work in Google Chrome.
    Triptych : @Dominic - for what it's worth, I'm looking at it right now in Google Chrome.
    David Dorward : I'd rather track down a tool designed to enter mathematical symbols and then use straight Unicode rather than entities. It will result in more readable source code.
  • <div style="text-decoration: overline">X</div>
    

0 comments:

Post a Comment