This site is supported by donations to The OEIS Foundation.

Template:Tilde/doc

From OeisWiki
Jump to: navigation, search

This documentation subpage contains instructions, categories, or other information for Template:Tilde. [<Edit> Template:Tilde]

[⧼Purge⧽ Template:Tilde/doc]

The {{tilde}} or {{~}} (tilde accent) diacritics template returns the UTF-16 HTML [hexadecimal] numeric character entity for a precomposed character with a tilde accent diacritic. (As a fallback, it returns a combining character for any Latin or Cyrillic character.)

With the tex option, the template returns the LaTeX code for the acute accent character.

Note: This is for XHTML5 future proofing, where named character entities should not be used, except the following four

Named entity Glyph
&amp; &
&lt; <
&gt; >
&quot; "

Numeric character entities or glyphs (except the four above glyphs, which have a special meaning in HTML) should be used instead.[1]

Usage

HTML

{{~|alphabetic character}}

or

{{~|alphabetic character|htm}}

where character is either from

  • {A, N, O, a, n, o}: to get a precomposed character;
  • any other character from the Latin alphabet: to get a combining character (where an almost perfect accented character is created);
  • or any character from the Cyrillic alphabet: to get a combining character (where an almost perfect accented character is created).

LaTeX

{{~|any Latin or Cyrillic character|tex}}

Tests

The code

{{math|{{~}},{{sp|quad}}{{~}}''a'',{{sp|quad}}''a''{{~}},{{sp|quad}}''{{~|a}}''|&}}

yields

̃, ̃a, ã, ã

The code

{{math|{{~||tex}},{{sp|quad|tex}}{{~||tex}}''a'',{{sp|quad|tex}}''a''{{~||tex}},{{sp|quad|tex}}''{{~|a|tex}}''|$}}

yields

The code (because we use the \scriptstyle kludge to get a smaller font, \tilde{a} renders almost the same as \bar{a}, e.g. {{math|\bar{a},\, \tilde{a}|$}} gives)

{{math|\tilde{a},\quad { \textstyle \tilde{a} },\quad { \textstyle \tilde{\scriptstyle a} },\quad <!-- -->{ \textstyle \tilde{\scriptstyle B} }|$}}

yields

Examples

Precomposed characters

Precomposed characters (HTML)
HTML
code
HTML
result
LaTeX
code
LaTeX
result
{{tilde|A}}, ''{{tilde|A}}'' Ã, Ã {{math|{{tilde|A|tex}}|$}}
{{tilde|N}}, ''{{tilde|N}}'' Ñ, Ñ {{math|{{tilde|N|tex}}|$}}
{{tilde|O}}, ''{{tilde|O}}'' Õ, Õ {{math|{{tilde|O|tex}}|$}}
{{tilde|a}}, ''{{tilde|a}}'' ã, ã {{math|{{tilde|a|tex}}|$}}
{{tilde|n}}, ''{{tilde|n}}'' ñ, ñ {{math|{{tilde|n|tex}}|$}}
{{tilde|o}}, ''{{tilde|o}}'' õ, õ {{math|{{tilde|o|tex}}|$}}

Combining characters

Cyrillic letters

Cyrillic letters
(combining characters for HTML)
Cyrillic letter
(without tilde)
HTML
code
HTML
result
а {{tilde|a}} а̃
е {{tilde|е}} е̃
и {{tilde|и}} и̃
о {{tilde|о}} о̃
у {{tilde|у}} у̃

Examples of improper usage

HTML
code
HTML
result
HTML
code
HTML
result
{{~|B}} {{~|b}}
{{~|W}} {{~|w}}
{{~|X}} {{~|x}}
{{~|Z}} {{~|z}}
{{~|4}} {{~|7}}
{{~|?}}  ?̃ {{~|!}}  !̃

Notes

See also