πŸ’Ύ Archived View for dj-chase.com β€Ί documents β€Ί re-sub-sup-gemtext.html captured on 2024-08-18 at 18:17:00.

View Raw

More Information

⬅️ Previous capture (2024-03-21)

-=-=-=-=-=-=-

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <title>
      Re: Subscripts And Superscripts In Gemtext
    </title>
    <meta name="generator" content="//dj-chase.com/Make.py">
    <link rel="stylesheet" href="../style.css?cache-bust=2024-02-15">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
  </head>
  <body>
    <!-- whitespace to right of nav -->
    <nav>
      <a href="#start">Skip to start</a> <!-- screen-reader–only p -->
      <p>
        You are here:
      </p>
      <ol>
        <li>
          <a href="/" aria-label="home">βŒ‚&nbsp;<span>β€Ί</span></a>
        </li>
        <li>
          <a href="/documents/">documents&nbsp;<span>β€Ί</span></a>
        </li>
        <li>
          <a href="/documents/re-sub-sup-gemtext.gmi">re-sub-sup-gemtext.gmi</a>
        </li>
      </ol>
    </nav>
    <main id="start">
      <h1>
        Re: Subscripts And Superscripts In Gemtext
      </h1>
      <p>
        <a href="gemini://gemi.dev/gemlog/2022-06-06-unicode-sub-sup.gmi">In reply to: Curiouser</a>
      </p>
      <p>
        Curiouser wrote:
      </p>
      <blockquote>
        Math formulas are especially challenging, not only because they can have so many symbols (such as sigma 'Ξ£'), but those symbols must be rendered in a certain layout (e.g. Ξ£ used to sum a series has the variable and its starting value, as well as the value its going to, arranged in 2 different rows to the right of the Ξ£).
      </blockquote>
      <p>
        As a further example, sigma notation only behaves that way when it’s inline. β€˜Block-level’ sigma notation places one row above the sigma and the other below, and makes the sigma like twice as large as the rest of the text. This holds true for a lot of other operations as well, such as integrals (∫), sequential products (∏), and sometimes unions (βˆͺ). Limits also follow the same rules, except they’re not extra-large because they don’t have their own symbol.
      </p>
      <blockquote>
        In fact, text layout of formulas and symbols is such a complicate domain that Donald Knuth literally created TeX, an entire digital typesetting system, while he was writing "The Art of Computer Programming."
      </blockquote>
      <blockquote>
        Given all this complexity, I didn't even try to represent math formulas in gemtext.
      </blockquote>
      <p>
        This is what made me reply to this post. You see, I quite like math, so I envision writing some here at times. So as part of working on the back-end, I needed to think about how to typeset math in Gemtext, and I think I’ve come up with a workable solution.
      </p>
      <p>
        Basically, we can use preformatted blocks to approximate block-level mathematics and put plaintext math using unicode’s extensive set of math symbols in the alt-text as a mostly accessible fallback.
      </p>
      <p>
        <mark><strong>Note</strong>: This is still not completely accessible, so it’s important to also provide an accessible format.</mark>
      </p>
      <h2>
        Examples
      </h2>
      <p>
        For these examples, I have put the alt text as the summary and a properly marked-up preformatted block in the details. This more closely resembles the Gemtext expirence.
      </p>
      <details>
        <summary>
          Ξ£α΅’β‚Œβ‚ƒβ· iΒ²
        </summary>
        <pre role="img" alt="Above equation rendered in Unicode art">
 ₇
 Ξ£ 𝑖²
ᢀ⁼³
</pre>
      </details>
      <hr class="light">
      <details>
        <summary>
          ∫ _(Ο€/6) ^Ο€ sin ΞΈ dΞΈ = [βˆ’cos ΞΈ] _(Ο€/6) ^Ο€ = 1 + (√3)/2
        </summary>
        <pre role="img" alt="Above equations rendered in Unicode art">
 Ο€
 ⌠               ⎑         ⎀ Ο€
 ⌑  sin πœƒ dπœƒ  =  ⎒ βˆ’ cos πœƒ βŽ₯
Ο€/6              ⎣         ⎦ Ο€/6

                       √3
              =  1  +  ──
                       2
</pre>
      </details>
      <hr class="light">
      <details>
        <summary>
          Dβ‚“ cos(xy) = Dβ‚“ (1 + sin y)
        </summary>
        <pre role="img" alt="Above equation rendered using Unicode art">
     Dβ‚“ cos(π‘₯𝑦)  =  Dβ‚“ (1 + sin 𝑦)
</pre>
      </details>
      <details>
        <summary>
          βˆ’sin(xy)yy' = y' cos y
        </summary>
        <pre role="img" alt="Above equation rendered using Unicode art">
     sin(π‘₯𝑦)𝑦𝑦′
   βˆ’ ──────────  =  1
      𝑦′ cos 𝑦
</pre>
      </details>
      <details>
        <summary>
          - ""[sin(xy)y / cos y]"" (y'/y') = 1
        </summary>
        <pre role="img" alt="Above equation rendered using Unicode art">
   sin(π‘₯𝑦)𝑦  𝑦′
βˆ’  ────────  ──  =  1
    cos 𝑦    𝑦′
</pre>
      </details>
      <details>
        <summary>
          y' (1 Γ— 1ΒΉ) = βˆ’ cos y / [sin(xy)y]
        </summary>
        <pre role="img" alt="Above equation rendered using Unicode art">
                       cos 𝑦
    𝑦′ (1 Γ— 1ΒΉ)  =  - ────────
                      sin(π‘₯𝑦)𝑦
</pre>
      </details>
      <details>
        <summary>
          y' = βˆ’ cos y / [sin(xy)y]
        </summary>
        <pre role="img" alt="Above equation rendered using Unicode art">
                       cos 𝑦
             𝑦′  =  - ────────
                      sin(π‘₯𝑦)𝑦
</pre>
      </details><!-- html code generated by txt2tags 3.3 (http://txt2tags.org) -->
      <footer>
        <p>
          Questions, comments, or wrote a reply? <a href="mailto:u9000@posteo.mx">Email me</a>.
        </p>
        <p>
          Β©&nbsp;DJ Chase 2023-11-21. Licensed under the Academic Free License (AFL&nbsp;3.0).
        </p>
        <p>
          <a href="/cgi-bin/cite.sh">Cite this page</a>
        </p>
        <p>
          <a href="https://u9.tel/gemtext-math">Short link</a>
        </p>
      </footer><!-- cmdline: txt2tags  -->
    </main>
  </body>
</html>