• Markup for continued fractions

    From Michael F. Stemper@michael.stemper@gmail.com to comp.text.tex on Sat Feb 28 09:00:53 2026
    From Newsgroup: comp.text.tex

    When using off-the-shelf "\frac" to display a continued fraction,
    such as in:
    a_0+\frac{1}{a_1+\frac{1}{\ldots+\frac{1}{a_k}}}

    things get unreadably small pretty quickly. I'd like to be able to
    display them with all coefficients the same size as the leading
    coefficient. An example of what I'm seeking is: <https://sites.millersville.edu/bikenaga/number-theory/finite-continued-fractions/finite-continued-fractions.html>

    (This certainly looks as if it was generated by TeX/LaTeX.) Does
    anybody here have an example of how to achieve this effect?
    --
    Michael F. Stemper
    If you take cranberries and stew them like applesauce they taste much
    more like prunes than rhubarb does.
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Nicola Talbot@lists@dickimaw-books.com to comp.text.tex on Sat Feb 28 15:14:26 2026
    From Newsgroup: comp.text.tex

    On 28/02/2026 15:00, Michael F. Stemper wrote:
    When using off-the-shelf "\frac" to display a continued fraction,
    such as in:
    -a a_0+\frac{1}{a_1+\frac{1}{\ldots+\frac{1}{a_k}}}
    things get unreadably small pretty quickly. I'd like to be able to
    display them with all coefficients the same size as the leading
    coefficient. An example of what I'm seeking is: <https://sites.millersville.edu/bikenaga/number-theory/finite-continued- fractions/finite-continued-fractions.html>

    (This certainly looks as if it was generated by TeX/LaTeX.) Does
    anybody here have an example of how to achieve this effect?


    The image alt text on the page you referenced contains LaTeX code, for example:

    $$\dfrac{4}{\pi} = 1 + \dfrac{1^2}{2 + \dfrac{3^2}{2 + \dfrac{5^2}{2 + \cdots}}}.$$

    \dfrac is provided by amsmath.

    Regards
    Nicola Talbot
    --
    LaTeX resources: https://www.dickimaw-books.com/latexresources.html
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Michael F. Stemper@michael.stemper@gmail.com to comp.text.tex on Sat Feb 28 10:28:42 2026
    From Newsgroup: comp.text.tex

    On 28/02/2026 09.14, Nicola Talbot wrote:
    On 28/02/2026 15:00, Michael F. Stemper wrote:
    When using off-the-shelf "\frac" to display a continued fraction,
    such as in:
    -a-a a_0+\frac{1}{a_1+\frac{1}{\ldots+\frac{1}{a_k}}}
    things get unreadably small pretty quickly. I'd like to be able to
    display them with all coefficients the same size as the leading
    coefficient. An example of what I'm seeking is:
    <https://sites.millersville.edu/bikenaga/number-theory/finite-continued- fractions/finite-continued-fractions.html>

    (This certainly looks as if it was generated by TeX/LaTeX.) Does
    anybody here have an example of how to achieve this effect?


    The image alt text on the page you referenced contains LaTeX code, for example:

    $$\dfrac{4}{\pi} = 1 + \dfrac{1^2}{2 + \dfrac{3^2}{2 + \dfrac{5^2}{2 + \cdots}}}.$$

    \dfrac is provided by amsmath.

    That works great. Thanks!

    Just out of curiousity, is it common to put TeX in as the alt attribute?
    Being lazy, I would have just put the whole pdf up. Screenshotting each equation or derivation and inserting them into an HTML replication of
    the original text is something that I never would have thought of.
    --
    Michael F. Stemper
    Outside of a dog, a book is man's best friend.
    Inside of a dog, it's too dark to read.

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Nicola Talbot@lists@dickimaw-books.com to comp.text.tex on Sat Feb 28 17:28:07 2026
    From Newsgroup: comp.text.tex

    On 28/02/2026 16:28, Michael F. Stemper wrote:
    On 28/02/2026 09.14, Nicola Talbot wrote:
    The image alt text on the page you referenced contains LaTeX code, for
    example:

    $$\dfrac{4}{\pi} = 1 + \dfrac{1^2}{2 + \dfrac{3^2}{2 + \dfrac{5^2}{2 +
    \cdots}}}.$$

    \dfrac is provided by amsmath.

    That works great. Thanks!

    Just out of curiousity, is it common to put TeX in as the alt attribute? Being lazy, I would have just put the whole pdf up. Screenshotting each equation or derivation and inserting them into an HTML replication of
    the original text is something that I never would have thought of.


    It's more likely that the HTML content was automatically created from
    TeX or LaTeX source. I think putting the source code in the alt text is
    fairly common with LaTeX to HTML generators. It's not particularly
    readable but it at least provides some information for users relying on
    screen readers or Braille displays.

    Regards
    Nicola Talbot
    --
    LaTeX resources: https://www.dickimaw-books.com/latexresources.html

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From ram@ram@zedat.fu-berlin.de (Stefan Ram) to comp.text.tex on Sat Feb 28 18:10:52 2026
    From Newsgroup: comp.text.tex

    "Michael F. Stemper" <michael.stemper@gmail.com> wrote or quoted:
    Just out of curiousity, is it common to put TeX in as the alt attribute? >Being lazy, I would have just put the whole pdf up. Screenshotting each >equation or derivation and inserting them into an HTML replication of
    the original text is something that I never would have thought of.

    LaTeX docs and formulas can be turned into HTML with special tools
    that keep the math looking good. MathJax and MathML are key for dis-
    playing complex math right in browsers.

    Pandoc is a pretty versatile tool for turning whole LaTeX documents
    into HTML, and it can do stuff like --mathjax to drop in LaTeX math
    delimiters (for inline and display) that render dynamically. TeX4-
    ht and lwarp compile LaTeX while making HTML, usually pairing with
    MathJax for formulas since they might output LaTeX source or images
    otherwise. Other routes include dedicated converters like Recovery-
    Tools TEX or Hyperlatex for batch work, though they differ in how
    they handle advanced packages.

    MathJax is a JavaScript library that renders LaTeX math directly in
    HTML by loading embedded code like E = mc^2 into browser-friendly for-
    mats such as SVG or HTML/CSS. It supports AMS-LaTeX extensions, con-
    figurable renderers (like via right-click menus), and works in tools
    like Quarto or RMarkdown without full document conversion. Include it
    with a CDN script tag for client-side rendering, keeping formulas as
    editable source while appearing typeset.

    MathML is a W3C standard for native math in HTML5, convertible
    from LaTeX via Pandoc's --mathml flag, producing semantic markup
    like <math><mi>x</mi></math> for accessibility and screen readers.
    Browsers like Firefox support it natively, while others use Math-
    Jax as a polyfill to convert LaTeX to MathML on the fly. This combo
    shines for EPUBs or standards-compliant sites but you need conver-
    sion tools for full LaTeX input.


    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Michael F. Stemper@michael.stemper@gmail.com to comp.text.tex on Wed Mar 4 10:20:33 2026
    From Newsgroup: comp.text.tex

    On 28/02/2026 11.28, Nicola Talbot wrote:
    On 28/02/2026 16:28, Michael F. Stemper wrote:
    On 28/02/2026 09.14, Nicola Talbot wrote:
    The image alt text on the page you referenced contains LaTeX code, for example:

    $$\dfrac{4}{\pi} = 1 + \dfrac{1^2}{2 + \dfrac{3^2}{2 + \dfrac{5^2}{2 + \cdots}}}.$$

    \dfrac is provided by amsmath.

    That works great. Thanks!

    Just out of curiousity, is it common to put TeX in as the alt attribute?
    Being lazy, I would have just put the whole pdf up. Screenshotting each
    equation or derivation and inserting them into an HTML replication of
    the original text is something that I never would have thought of.

    It's more likely that the HTML content was automatically created from TeX or LaTeX source. I think putting the source code in the alt text is fairly common with LaTeX to HTML generators. It's not particularly readable but it at least provides some information for users relying on screen readers or Braille displays.

    That possibility occurred to me a couple hours after posting. Thanks.
    --
    Michael F. Stemper
    Galatians 3:28

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Michael F. Stemper@michael.stemper@gmail.com to comp.text.tex on Wed Mar 4 10:24:00 2026
    From Newsgroup: comp.text.tex

    On 28/02/2026 12.10, Stefan Ram wrote:
    "Michael F. Stemper" <michael.stemper@gmail.com> wrote or quoted:
    Just out of curiousity, is it common to put TeX in as the alt attribute?
    Being lazy, I would have just put the whole pdf up. Screenshotting each
    equation or derivation and inserting them into an HTML replication of
    the original text is something that I never would have thought of.


    MathML is a W3C standard for native math in HTML5, convertible
    from LaTeX via Pandoc's --mathml flag, producing semantic markup
    like <math><mi>x</mi></math> for accessibility and screen readers.
    Browsers like Firefox support it natively, while others use Math-
    Jax as a polyfill to convert LaTeX to MathML on the fly. This combo
    shines for EPUBs or standards-compliant sites but you need conver-
    sion tools for full LaTeX input.

    I first heard of MATHML about twenty years ago. I played around with it briefly, but never got it to do anything. If it's an official part of
    HTML5, I might give it another shot.
    --
    Michael F. Stemper
    Galatians 3:28

    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From ram@ram@zedat.fu-berlin.de (Stefan Ram) to comp.text.tex on Wed Mar 4 16:55:45 2026
    From Newsgroup: comp.text.tex

    "Michael F. Stemper" <michael.stemper@gmail.com> wrote or quoted:
    I first heard of MATHML about twenty years ago. I played around with it >briefly, but never got it to do anything. If it's an official part of
    HTML5, I might give it another shot.

    HTML5 does not strictly require MathML support (there is
    a specification for MathML, but it's "optional"), but new
    major browsers support it.

    MathJax can render math in browsers that lack native MathML
    support by using JavaScript to output math in formats that
    those browsers can display, such as HTML/CSS or SVG.


    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Nuno Silva@nunojsilva@invalid.invalid to comp.text.tex on Wed Mar 4 23:19:05 2026
    From Newsgroup: comp.text.tex

    On 2026-03-04, Stefan Ram wrote:

    "Michael F. Stemper" <michael.stemper@gmail.com> wrote or quoted:
    I first heard of MATHML about twenty years ago. I played around with it >>briefly, but never got it to do anything. If it's an official part of >>HTML5, I might give it another shot.

    Does it even matter much? IIRC these technologies used to be defined separately, e.g. HTML <5 and CSS are different W3C specs.

    HTML5 does not strictly require MathML support (there is
    a specification for MathML, but it's "optional"), but new
    major browsers support it.

    MathJax can render math in browsers that lack native MathML
    support by using JavaScript to output math in formats that
    those browsers can display, such as HTML/CSS or SVG.

    Might be a good idea as far as fallback is done properly (i.e. that it
    doesn't require JS where MathML is natively supported). Fortunately HTML
    3 or what it was already had decent enough embedding support with
    possible fallbacks. Now I have no idea how is this being usually done
    out there, especially in these days of HTML5 "living "standards"".

    (MediaWiki at Wikipedia and Wikimedia allows rendering equations as png,
    and I think that's what I've got set in the preferences.)
    --
    Nuno Silva
    --- Synchronet 3.21d-Linux NewsLink 1.2