• 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