• HTML and Unicode notations

    From Stefan Ram@21:1/5 to All on Thu Mar 30 10:13:04 2023
    Is there be a reason to prefer one over the other notation?

    "x²" versus "x<sup>2</sup>"

    "𝑃" versus "<i>P</i>" for a mathematical variable

    ("𝑃" is U+1D443 "MATHEMATICAL ITALIC CAPITAL P".)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stewart Robert Hinsley@21:1/5 to Stefan Ram on Thu Mar 30 19:32:40 2023
    On 30/03/2023 11:13, Stefan Ram wrote:
    Is there be a reason to prefer one over the other notation?

    The original philosophy was for HTML to be used for semantics, not for formatting. Under that philosophy, in both cases the first form is
    preferred. (The argument strikes me as stronger for MATHEMATICAL ITALIC
    CAPITAL P.)

    Wikipedia has descriptions, with appropriate references.

    "x²" versus "x<sup>2</sup>"

    https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts

    "𝑃" versus "<i>P</i>" for a mathematical variable

    ("𝑃" is U+1D443 "MATHEMATICAL ITALIC CAPITAL P".)


    https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols

    Before UNICODE became prevalent that was an argument for using
    superscript markup, rather than superscript characters, as only square
    and cube were available as characters, and they often formatted
    differently from other powers implemented as markup. (It's seems that I
    have some pages that I have to go through and change to use UNICODE superscripts.)

    --
    SRH

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jukka K. Korpela@21:1/5 to Stefan Ram on Fri Mar 31 10:34:02 2023
    Stefan Ram wrote:

    Is there be a reason to prefer one over the other notation?

    "x²" versus "x<sup>2</sup>"

    The former results in an essentially better rendering, since a
    superscript glyph, as created by a font designed, is used for ², as
    opposite to using a glyph for 2 in some superscript style (which is poor
    by browser defaults and difficult to tune), normally causing uneven line spacing when used inside a paragraph.

    For complicated mathematical expressions, often with nested
    superscripts, use neither. Instead, choose between different non-HTML
    methods for rendering expressions. (These include MathML, which can be
    embedded into HTML, but not necessary the best solution.I

    "𝑃" versus "<i>P</i>" for a mathematical variable

    ("𝑃" is U+1D443 "MATHEMATICAL ITALIC CAPITAL P".)

    For relatively simple mathematical expressions, such as <i>x</i>², use
    the <i> markup, partly because it is simpler to create and works more
    robustly, without requiring fonts that have glyphs for Mathematical Alphanumeric Symbols.

    For more complicated mathematical expressions, this will be among the
    smallest problems you’ll face, and the choice of the tool will normally
    solve it. (It’ll let you type just P and have it rendered in italic,
    unless you do something special to have it rendered upright.)

    Yucca, https://jkorpela.fi

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Jukka K. Korpela on Fri Mar 31 09:43:20 2023
    "Jukka K. Korpela" <jukkakk@gmail.com> writes:
    The former results in an essentially better rendering, since a
    superscript glyph, as created by a font designed, is used for ², as
    opposite to using a glyph for 2 in some superscript style (which is poor
    by browser defaults and difficult to tune), normally causing uneven line >spacing when used inside a paragraph.

    (Thanks for all answers!)

    This is true, I did not think of this before.

    For more complicated mathematical expressions, this will be among the >smallest problems you’ll face, and the choice of the tool will normally >solve it. (It’ll let you type just P and have it rendered in italic,
    unless you do something special to have it rendered upright.)

    The impetus for writing my original post was a flashcard program
    I use for learning, in which one can create new flashcards.

    It allows one to use HTML for formatting and Unicode, but
    not much else. It does not support MathML nor LaTeX. (Some
    versions of this software indeed do support LaTeX, but not
    the one I'm using on a mobile device.)

    So, an example of where I am using this would be a flashcard
    I type in manually:

    | front side:
    |
    |the probability P that a detector would find a photon in
    |a beam with a probability amplitude α
    |
    | back side
    |
    |P = |α|².

    And then I have several choices when italicizing the variables.
    With HTML (source code view of the flashcard):

    | front side:
    |
    |the probability <i>P</i> that a detector would find a photon in
    |a beam with a probability amplitude <i>α</i>
    |
    | back side
    |
    |<i>P</i> = |<i>α</i>|<sup>2</sup>.

    Sometimes, I add an "italic correction":

    |<i>P</i> = |<i>α</i>&#8202;|<sup>2</sup>.

    With Unicode (source code view of the flashcard):

    | front side:
    |
    |the probability 𝑃 that a detector would find a photon in
    |a beam with a probability amplitude 𝛼
    |
    | back side
    |
    |𝑃 = |𝛼|².

    Actually, in the fonts in which I have seen it so far, the
    "MATHEMATICAL ITALIC SMALL ALPHA" 𝛼 from Unicode looks more like what
    I imagine an alpha would look like than "GREEK SMALL LETTER ALPHA" α.

    It is also possible that the "MATHEMATICAL ITALIC" symbols
    already have some italic correction built-in.

    (I am writing this message here in a text console editor,
    not in a GUI editor. That text console editor renders all
    characters monospaced and it has to compress the
    "MATHEMATICAL" symbols a bit, so that they are too small,
    but still recognizable.)

    On that mobile device I use special software to enter Unicode
    characters that helps me to do this quite easily, since it can
    show me a screen with "recently used characters", so I will find
    the "𝑃" and "𝛼" there and do not have to search for them again.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jukka K. Korpela@21:1/5 to Stefan Ram on Fri Mar 31 15:10:48 2023
    Stefan Ram wrote:

    Actually, in the fonts in which I have seen it so far, the
    "MATHEMATICAL ITALIC SMALL ALPHA" 𝛼 from Unicode looks more like what
    I imagine an alpha would look like than "GREEK SMALL LETTER ALPHA" α.

    That’s probably because you are used to seeing alpha in mathematics and
    other special usage rather than as a letter in Greek words. In
    mathematics, variables are written in italic by convention, and this
    applies to Greek letters, too. Even though Greek letters may look “italic-like” as such, there is a difference between upright and italic
    for them.

    Mathematical italic letters in Unicode are supposed to look like normal
    letters in an italic font, but they need not be identical. For example, mathematical italic small alpha can be expected to display much like <i>&alpha;</i>, but there can be differences. When you use mathematical
    italic letters, you effectively force the browser to (try to) use one of
    the few fonts that contain them, such as Cambria Math, and not the font
    it normally uses for the text. This may result in a better appearance,
    because such fonts are designed with the mathematical usage in mind. But
    when I tested this a little, I saw very small differences. But I was
    using just Cambria and Cambria Math.

    It is also possible that the "MATHEMATICAL ITALIC" symbols
    already have some italic correction built-in.

    They are effectively font variants of normal letters, though encoded as separate characters. It’s not a matter of correction but of design, by a typographer. These characters should not be italicized, as it would only
    be possible with algorithmic slanting, which produces poor results.

    Yucca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jukka K. Korpela@21:1/5 to Stefan Ram on Fri Mar 31 15:49:35 2023
    Stefan Ram wrote:

    Here's a clarification, but it requires a Newsreader that
    renders all spaces verbatim (even a sequence of several
    spaces at the beginning of a line) and a monospaced font.

    I was able to tune Thunderbird to display your message that way, but I
    am unable to recognize the difference.

    I tested
    &#x1D6fc; <i>&alpha;</i>
    using a large font size and could see only very small differences. They
    both differ, of course, considerably from plain &alpha;. (I used Cambria
    as the basic font. Declaring e.g. Arial as the basic font would have a
    drastic effect, since then <i>&alpha;</i> is very different whereas
    &#x1D6fc; still comes from Cambria Math font (on my computer).

    Yucca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Jukka K. Korpela on Fri Mar 31 12:33:57 2023
    "Jukka K. Korpela" <jukkakk@gmail.com> writes:
    Stefan Ram wrote:
    Actually, in the fonts in which I have seen it so far, the
    "MATHEMATICAL ITALIC SMALL ALPHA" 𝛼 from Unicode looks more like what
    I imagine an alpha would look like than "GREEK SMALL LETTER ALPHA" α. >That’s probably because you are used to seeing alpha in mathematics and >other special usage rather than as a letter in Greek words.

    Here's a clarification, but it requires a Newsreader that
    renders all spaces verbatim (even a sequence of several
    spaces at the beginning of a line) and a monospaced font.

    What I imagine an alpha would look like:

    .,=:;/;;;;;;=, .,-===-,.
    .,=/%XHM@HHHHH%:,. .,-;+X$%+:,
    -;$$XH%;=--,--=;+$;- ,=;%H#H%/=,
    .,=/XMHX%;- =/$/=.-;+$@#H+:-.
    -;%X@#H+:-. ,=;::=;+%XHM$/-,.
    =+H@M#X;,.. ..=;%$$XHH@%:,.
    ..:%@@@@%:.. -;%$XHHHH+=
    .,-;$@@HH+:.. ,:/%HM@HX/-
    .,=/$M@HX+=. .-:+XMH$+:-
    .,=/$M@HX+=. ,=/%H#H%;=,
    .,=/$M@HX+=. -;%X@#X+=-.
    .,-;$@@HH+=. =+HH@M$;,.
    .,;$@@@H%:.. .:%@@@@%:..
    .:%@@@M$;,. .,-;$@@@H%:,. .
    -/$HM#X/-,. ,=;+XM@HH%/=-. .,--,..
    .-:%H#@%;=, -/XHHH$+;/+$/=,=;+;-
    ..:+HXXX+:-,,,-=:/$@X%+:-.:+H$%++%$;-
    .-:/$@X$%%$%$$$%%$/=.. -;%X@MH%;=,
    .,-=:;;///;::=-,.. .,-=:/:-..
    .,,,,,... .,.

    . What it looks like in several fonts:

    .......... ..
    ,-=:;///+///;=-,. ,=;=-,.
    ,:/+$XHHHHXXXXXXXX+;-,. .,=/%H%:,.
    .-=/$H@MM@HX$%%%%%XH@H$%;-.-;+X@#$;..
    =+HH@@HX$/=,......,-=/XMX/=;%XHH@%=
    .,-/$M@@@$/=-. .-;+%$XHHHHHH+=
    ,:/%XM@HX/= .,;X#M@@HHX/-
    -/XHH@X$+:- .=+XHH@HX$;-
    =%MMM@X%;=, -;$XH@HX%;-
    :$##MMX+:-. -;%$H@H$%;-
    .:$MMMMX/=,. -;%XH@H$%;-
    ..;$MMMMX/-,. -;$XH@H$%;-
    ..;$MMMMX/-,. -/$XH@H$%;-
    .:$#MMMX/-,. -/XXH@H$%;-
    :$##MMX+=-. =/XHH@H$%;-
    :$#MM@X+;=, .:+HH@@H$%;-
    =+HH@@X$+:, .,-;$@@@@H$%;-
    ,:+$H@HXX/= ,=/%X@@@@HX$;-
    .-=/XM@@H%;=,. .,:/$$$$XH@HHX/=
    ..:+H@@@H$+;=,,,...,-:/+%$+/:+X@@@@$;-,..
    ,=;%XMMM@HX$%%++%%XHMX/--,,:%@@@M@X$+/;=,
    .,-:/+$XXHHHHXX$$%++:- ,=;/%$$%%%++:-
    ..,=:;/%%%%+/;=,. .,-=::::;;=,
    .....

    .
    .:*~*:._.:*~*:._.:*~*:._.:.

    This message was written to be viewed with a fixed-width
    (monospaced) font and verbatim rendition of spaces and line
    breaks. The two "T" in the following two lines should be
    at the same horizontal position.

    IIIIIII...........|||||||||||||||"T" WWWWWWWWWWWWWWWWWWWWWWWWMMMMMMMMMMMMMMMMMMMMMMM"T"

    Lines with up to 78 characters should not be wrapped
    automatically, so there should be exactly two lines
    following this paragraph, where each line ends with an "I",
    and the two "I" are directly on top of each other:

    WWWW WWWW WWWW WWWW WWWW WWWW WWWW WWWW WWWW WWWW WWWW WWWW WWWW WWWW WWWW WI
    WI

    The following lines are indented, one exactly one space
    more than the preceding line. When this message is viewed
    or quoted, this property should be retained. The uppercase
    I should be aligned directly on top of each other.

    not indented I
    indented by 1 space I
    indented by 2 spaces I
    indented by 3 spaces I
    0123 I

    not indented I

    indented by 1 space I

    indented by 2 spaces I

    indented by 3 spaces I

    0123 I

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Jukka K. Korpela on Fri Mar 31 13:12:59 2023
    "Jukka K. Korpela" <jukkakk@gmail.com> writes:
    I was able to tune Thunderbird to display your message that way, but I
    am unable to recognize the difference.

    Thanks for your efforts!

    Let me try to describe the difference in words then:

    An "alpha" is a line that describes a kind of semicircle on
    the left side.

    On the right sight, the two ends of that line meet in an
    intersection.

    I prefer them to intersect forming an angle of about 120
    to 150 degrees (on the left side of their intersection),
    not about 180 degrees.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Stefan Ram@21:1/5 to Stefan Ram on Fri Mar 31 13:36:30 2023
    ram@zedat.fu-berlin.de (Stefan Ram) writes:
    I prefer them to intersect forming an angle of about 120
    to 150 degrees (on the left side of their intersection),
    not about 180 degrees.

    Because if the angle is close to 180 degrees, the alpha
    looks too much like the way a latin "a" is written in
    handwriting here in Germany. I.e., such an alpha to me
    looks like an "a".

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jukka K. Korpela@21:1/5 to Stefan Ram on Sat Apr 1 13:43:26 2023
    Stefan Ram wrote:

    An "alpha" is a line that describes a kind of semicircle on
    the left side.

    On the right sight, the two ends of that line meet in an
    intersection.

    I prefer them to intersect forming an angle of about 120
    to 150 degrees (on the left side of their intersection),
    not about 180 degrees.

    This sounds like a font issue. The shape of α varies greatly by font,
    and in some fonts, it looks much the same as the Latin letter a in an
    italic typeface. I don’t think you can do much about this except select
    the fonts in your list accordingly. Generally, for mathematical
    expressions, you should in any case use a serif font with a rich
    repertoire of characters (so that you won’t need to mix fonts), and this restricts your choices a lot.

    In fonts like Cambria, Times New Roman, FreeSerif, and Noto Serif, the difference between italic a and italic alpha looks quite sufficient to
    my eyes.

    Yucca

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Helmut Richter@21:1/5 to Helmut Richter on Sat Apr 1 13:34:50 2023
    This message is in MIME format. The first part should be readable text,
    while the remaining parts are likely unreadable without MIME-aware tools.

    On Sat, 1 Apr 2023, Helmut Richter wrote:

    U+0251 ɑ vs. U+0061 a (which is a different sound)
    U+0361 ɡ vs. U+0067 g (which does not represent a sound in the other variant)

    Corr.: U+0261 ɡ

    --
    Helmut Richter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Helmut Richter@21:1/5 to Jukka K. Korpela on Sat Apr 1 13:15:54 2023
    This message is in MIME format. The first part should be readable text,
    while the remaining parts are likely unreadable without MIME-aware tools.

    On Sat, 1 Apr 2023, Jukka K. Korpela wrote:

    This sounds like a font issue. The shape of α varies greatly by font, and in some fonts, it looks much the same as the Latin letter a in an italic typeface. I don’t think you can do much about this except select the fonts in
    your list accordingly. Generally, for mathematical expressions, you should in any case use a serif font with a rich repertoire of characters (so that you won’t need to mix fonts), and this restricts your choices a lot.

    In fonts like Cambria, Times New Roman, FreeSerif, and Noto Serif, the difference between italic a and italic alpha looks quite sufficient to my eyes.

    The same problem arises with IPA phonetic symbols: An italic character is
    not the same as a slanted modern-form Antiqua character, and also
    conversely, an antiqua character is not just an unslanted italic
    character. In particular, an Antiqua “a” has an open roof over the circle, an italic “a” has not; an Antiqua “g” has often – not always – a closed
    oval below the closed circular body on the line, an italic “g” has never; an Antiqua “f” has no descender, an italic “f” has one. Whenever, for instance with phonetic symbols, the difference of shape implies a
    difference in meaning, these are indeed different characters and not only different shapes of the same character:

    U+0251 ɑ vs. U+0061 a (which is a different sound)
    U+0361 ɡ vs. U+0067 g (which does not represent a sound in the other variant)

    If one uses italic character for any purpose, e.g. for emphasis or for designating proper names or foreign-language words, one should use a basic script where the characters are definitely different from unslanted
    italics.

    --
    Helmut Richter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)