On 7/27/2025 12:38 AM, Matthias Weber wrote:
Hmm, when I try (as hacker.tex)


\setupexternalfigures[location=default]

\startsetups[document:start]
     \setupinteraction[
         title=\documentvariable{title},
         author=\documentvariable{author},
     ]
\stopsetups

\setupbackend[export=yes,xhtml=yes]

\setupexport
   [svgstyle=mathtest-style,
    hyphen=yes,
    width=60em]

the next upload will support the hyphen option (was disabled in lmtx although we can actually do it there too)

  \enabledirectives[export.css.hyphens=yes]
\enabledirectives[export.css.textwidth=100em]
\starttext


\placefigure
[force]
[figure:crc2]
{Hacker}
{\externalfigure[hacker.jpg][width=.6\textwidth,
alternativetext={
A lot of math: $\int_0^\infty e^{-x^2}\, dx=\frac12 \sqrt\pi$
}]}

\stoptext


The exported file hacker-div.html

— is missing something like <html lang="en" data-theme="light”>

— links only

<link type="text/css" rel="stylesheet" href=“styles/hacker-defaults.css" />
<link type="text/css" rel="stylesheet" href="styles/hacker-images.css" />
<link type="text/css" rel="stylesheet" href="styles/hacker-fonts.css" />
<link type="text/css" rel="stylesheet" href="styles/hacker-styles.css" />
but should also link to>
<link type="text/css" rel="stylesheet" href="styles/hacker-templates.css" />

ok, i'll add it

— has the following for the image

<div class="floatcontent"><div alt=" A lot of math: $\\\\int _0^\\\\infty e^{-x^2}\\\\, dx=\\\\frac 12 \\\\sqrt \\\\pi $ " 
class="image label-hacker.jpg" id="Exporttest-image-1" image="Exporttest-image-1"><!--empty--></div></div>

This shows the image, but the alt tag is not readable. One can test this by 
removing/renaming hacker.jpg from the images directory.
It seems the alt tag only works inside <img>. So changing <div alt …>  <img alt … 
> works.
It might break other things.
And then there is the question whether alt texts should contain math. It’s 
probably best to just use plain text in alt texts.

indeed, Mikael and I were just discussing this and came to the conclusion that it's way better to generate an accessible version instead, so in the case of images, we just render the explanation and export that .. there can be more to make the document more accessible (more explicit labeling and such) as the intended audience deserves better than the unpredictable

so: what qualifies for soem treatment

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to