Re: Support alt text in LaTeX output

Charles Staats <[email protected]> Thu, 23 Jul 2026 22:31:13 -0700
Newsgroups gmane.comp.tex.texinfo.bugs
Message-ID <CAP-6jhEBpSqGZ0c8XewAig6CzkyJQQN8-SQZwKh117ASiJ0fhA@mail.gmail.com>
--000000000000feceb5065754aea8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

[Note: The last is a forwarded reply from David Carlisle via
https://github.com/latex3/tagging-project/issues/1491#issuecomment-50644330=
61
]

On Thu, Jul 23, 2026 at 10:30=E2=80=AFPM Charles Staats <
[email protected]> wrote:

> @charlesstaats  I think this is being CC'ed to the texinfo list
> (somewhere?) but as I'm seeing it on the github issue the original email
> context is stripped, but feel free to forward.
>
> > .  However, it looks like it was added in 2021,
>
> yes
>
> > What happens if graphicx is older with an unknown alt=3D passed?
>
> it would error but you could add code to the latex preamble to
> conditionally make it a defined (and no-op) or you could make all such
> accessibility additions conditional on `\DocumentMetadata`   being define=
d
> (that was also added in 2021)
>
> > In case it is possible to use \DocumentMetadata, which should be the
> format of the lang?  Some examples on the internet look like BCP 47
>
> yes or omit it and it defaults to `en`
>
> > Not sure that there is a use [for artifact] in Texinfo to LaTeX
> conversion.
>
> possibly not, it is for marking essentially decorative images which you
> want to drop entirely from the accessible view.
>
> > It seems to be actualtext=3D, not actual=3D.  We could use a file like
> image.txt that we use in Info output, for example for that.  It is not
> clear, however, how to specify it.  Is it an issue if there are end of
> line in it?  Blank lines?  The manual does not show any example.
>
> In the end it needs to resolve to a plain text string that is a PDF
> property value so ends of lines are OK, but are spaces as is normal in Te=
X.
> The PDF standard suggests this should be for small sections  of text
> typically replacing a custom symbol (or a textual image) not for paragrap=
h
> length
>
> > It is not clear to me why style=3Dnextline is incompatible with tagging=
.
> Is it really important, or should it be fixed someday?
>
> We'll fix that. Most of `enumitem` keys are emulated by the new built-in
> accessible list code however that one is currently document as `todo`
> so I added a quick workaround in this document, but just assume it works.
>
>
> > The noparboxtagging stuff seems obscure to me, but I can add it if ther=
e
> is some explanation,
>
> Please ignore that, it will go, we were just forcing in some markup to
> check that we could generate a PDF/UA-2 accessible file from the texinfo
> source. Now we know it's possible we can fix up the markup.
>
> > Regarding `\usepackage{unicode-math`}, I do not have a clear idea
> whether it is a good idea to use that instead of amsmath.
>
> It's just a lot easier to generate MathML accessible mathematics (which i=
s
> required to be in Unicode) if you use a Unicode engine and Unicode math
> fonts in the original. However it is possible to use legacy tex math font=
s
> and map to unicode so it's not essential, but in general accessibility is
> better from luatex than pdftex.
>
> ----
> so in short if you ignore the experimental ad-hoc commands added to fix u=
p
> the test document so it worked today, what would be good would be
>
> * an option or configuration or whatever that allowed you to choose
> accessibility options for latex, so
>
> ```
> \DocumentMetadata{
> lang=3D<document-language-from-texinfo>,
> pdfstandard=3Dua-2,
> tagging=3Don
> }
> ```
>
> there are other options that could be added there but keeping things
> simple....
>
> * then use `unicode-math` instead of `amsmath`  and pass the alt text
> argument on graphics through to `\includegraphics`
>
> it might be nice to have some way of saying to use that argument as
> actualtext instead of alt but if that doesn't really fit the texinfo inpu=
t
> syntax I don't think that's essential. If alt is OK for the html
> translation it's probably OK for pdf too.
>
> * set the pdf metadata dc:title based on information in the texinfo sourc=
e.
>
>
>
>
>
>
>
>
>
>
>
> On Thu, Jul 23, 2026 at 2:31=E2=80=AFPM Patrice Dumas <[email protected]> =
wrote:
>
>> On Thu, Jul 23, 2026 at 11:07:25AM -0600, Charles Staats wrote:
>> > Hello,
>> >
>> > Currently, `texi2any --latex` appears to discard any alt text tag, see
>> >
>> https://github.com/latex3/tagging-project/issues/1491#issuecomment-50610=
06949
>> .
>> > Would it be possible to change this?
>> >
>> > Ideally, there would be some sort of flag like `--accessible` or
>> > `--latex-tagging` that could be passed to the texi2any script that wou=
ld
>> > cause certain changes to the TeX and pdf output, such as the following=
:
>>
>> I do not think that a command-line should be used for that.  Maybe a
>> customization variable.
>>
>> > * Forward any alt text to the `\includegraphics` commands.
>>
>> This seems to be relevant independently of the remaining.  However, it
>> looks like it was added in 2021, according to
>>
>> https://ctan.tetaneutral.net/macros/latex/required/graphics/grfguide.pdf
>>
>> What happends if graphicx is older with an unknown alt=3D passed?
>>
>> > * Insert a `\DocumentMetadata` command (with appropriate settings) at
>> the
>> > beginning of the document.
>>
>> Which LaTeX version support \DocumentMetadata?  What happens if the
>> version used does not?
>>
>> In case it is possible to use \DocumentMetadata, which should be the
>> format of the lang?  Some examples on the internet look like BCP 47, but
>> it is not so clear.
>>
>> > * (For pdf output) compile with lualatex instead of pdflatex.
>>
>> texi2any does not compile the LaTeX file, just produces it.
>>
>> > * Ideally, we would also have "actual" and "artifact" tags as well. If=
 I
>> > understand correctly, the "actual=3D<stuff>" tag indicates to
>> screenreaders
>> > that the image should be treated as if it were the text "<stuff>";
>>
>> It seems to be actualtext=3D, not actual=3D.  We could use a file like
>> image.txt that we use in Info output, for example for that.  It is not
>> clear, however, how to specify it.  Is it an issue if there are end of
>> line in it?  Blank lines?  The manual does not show any example.
>>
>> Also it seems to be quite recent, end of 2024, similarly, what happens
>> with older graphicx with an unknown actualtext=3D passed?
>>
>> > the
>> > "artifact" tag tells the screenreader to ignore the image altogether
>> (used,
>> > e.g., for logos).
>>
>> Not sure that there is a use in Texinfo to LaTeX conversion.
>>
>> > There may be other changes needed, as discussed in the issue linked
>> above.
>> > (Note: Some of these may be better dealt with on the TeX side rather
>> than
>> > the texinfo side.)
>>
>> I think that \hypersetup{pdftitle=3D{}} could be added.  It looks like a
>> relevant addition in the default case.
>>
>> It is not clear to me why style=3Dnextline is incompatible with tagging.
>> Is it really important, or should it be fixed someday?
>>
>> The noparboxtagging stuff seems obscure to me, but I can add it if there
>> is some explanation, and also it is not clear to me if
>> \AssignTaggingSocketPlug
>> and \tagpdfparaOff are backward compatible enough.
>>
>> Regarding \usepackage{unicode-math}, I do not have a clear idea whether
>> it is a good idea to use that instead of amsmath.  It seems that the
>> \mathbf and similar commands should be changed, but it is not so clear
>> either.  Also it seems to require some specific fonts.  Maybe there
>> could be some customization option to generate LaTeX for an engine or
>> the other.
>>
>> --
>> Pat
>>
>

--000000000000feceb5065754aea8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">[Note: The last is a forwarded reply from David Carlisle v=
ia=C2=A0<a href=3D"https://github.com/latex3/tagging-project/issues/1491#is=
suecomment-5064433061">https://github.com/latex3/tagging-project/issues/149=
1#issuecomment-5064433061</a>]</div><br><div class=3D"gmail_quote gmail_quo=
te_container"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 23, 2026 at=
 10:30=E2=80=AFPM Charles Staats &lt;<a href=3D"mailto:charles.staats.iii@g=
mail.com">[email protected]</a>&gt; wrote:<br></div><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><p dir=3D"auto">@cha=
rlesstaats =C2=A0I think this is being CC&#39;ed to the texinfo list (somew=
here?) but as I&#39;m seeing it on the github issue the original email cont=
ext is stripped, but feel free to forward.<br><br>&gt; .=C2=A0 However, it =
looks like it was added in 2021,<br><br>yes<br><br>&gt; What happens if gra=
phicx is older with an unknown alt=3D passed?<br><br>it would error but you=
 could add code to the latex preamble to conditionally make it a defined (a=
nd no-op) or you could make all such accessibility additions conditional on=
 `\DocumentMetadata` =C2=A0 being defined (that was also added in 2021)<br>=
<br>&gt; In case it is possible to use \DocumentMetadata, which should be t=
he<br>format of the lang?=C2=A0 Some examples on the internet look like BCP=
 47<br><br>yes or omit it and it defaults to `en`<br><br>&gt; Not sure that=
 there is a use [for artifact] in Texinfo to LaTeX conversion.<br><br>possi=
bly not, it is for marking essentially decorative images which you want to =
drop entirely from the accessible view.<br><br>&gt; It seems to be actualte=
xt=3D, not actual=3D.=C2=A0 We could use a file like<br>image.txt that we u=
se in Info output, for example for that.=C2=A0 It is not<br>clear, however,=
 how to specify it.=C2=A0 Is it an issue if there are end of<br>line in it?=
=C2=A0 Blank lines?=C2=A0 The manual does not show any example.<br><br>In t=
he end it needs to resolve to a plain text string that is a PDF property va=
lue so ends of lines are OK, but are spaces as is normal in TeX.<br>The PDF=
 standard suggests this should be for small sections =C2=A0of text typicall=
y replacing a custom symbol (or a textual image) not for paragraph length <=
br><br>&gt; It is not clear to me why style=3Dnextline is incompatible with=
 tagging. Is it really important, or should it be fixed someday?<br><br>We&=
#39;ll fix that. Most of `enumitem` keys are emulated by the new built-in a=
ccessible list code however that one is currently document as `todo` <br>so=
 I added a quick workaround in this document, but just assume it works.<br>=
<br><br>&gt; The noparboxtagging stuff seems obscure to me, but I can add i=
t if there is some explanation,<br><br>Please ignore that, it will go, we w=
ere just forcing in some markup to check that we could generate a PDF/UA-2 =
accessible file from the texinfo source. Now we know it&#39;s possible we c=
an fix up the markup.<br><br>&gt; Regarding `\usepackage{unicode-math`}, I =
do not have a clear idea whether it is a good idea to use that instead of a=
msmath.<br><br>It&#39;s just a lot easier to generate MathML accessible mat=
hematics (which is required to be in Unicode) if you use a Unicode engine a=
nd Unicode math fonts in the original. However it is possible to use legacy=
 tex math fonts and map to unicode so it&#39;s not essential, but in genera=
l accessibility is better from luatex than pdftex.<br><br>----<br>so in sho=
rt if you ignore the experimental ad-hoc commands added to fix up the test =
document so it worked today, what would be good would be <br><br>* an optio=
n or configuration or whatever that allowed you to choose accessibility opt=
ions for latex, so <br><br>```<br>\DocumentMetadata{<br>lang=3D&lt;document=
-language-from-texinfo&gt;,<br>pdfstandard=3Dua-2,<br>tagging=3Don<br>}<br>=
```<br><br>there are other options that could be added there but keeping th=
ings simple....<br><br>* then use `unicode-math` instead of `amsmath` =C2=
=A0and pass the alt text argument on graphics through to `\includegraphics`=
<br><br>it might be nice to have some way of saying to use that argument as=
 actualtext instead of alt but if that doesn&#39;t really fit the texinfo i=
nput syntax I don&#39;t think that&#39;s essential. If alt is OK for the ht=
ml translation it&#39;s probably OK for pdf too.<br><br>* set the pdf metad=
ata dc:title based on information in the texinfo source.<br><br><br><br><br=
><br><br><br><br><br><br></p></div><br><div class=3D"gmail_quote"><div dir=
=3D"ltr" class=3D"gmail_attr">On Thu, Jul 23, 2026 at 2:31=E2=80=AFPM Patri=
ce Dumas &lt;<a href=3D"mailto:[email protected]" target=3D"_blank">pertusus=
@free.fr</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex">On Thu, Jul 23, 2026 at 11:07:25AM -0600, Charles Staats wrote:<br>
&gt; Hello,<br>
&gt; <br>
&gt; Currently, `texi2any --latex` appears to discard any alt text tag, see=
<br>
&gt; <a href=3D"https://github.com/latex3/tagging-project/issues/1491#issue=
comment-5061006949" rel=3D"noreferrer" target=3D"_blank">https://github.com=
/latex3/tagging-project/issues/1491#issuecomment-5061006949</a>.<br>
&gt; Would it be possible to change this?<br>
&gt; <br>
&gt; Ideally, there would be some sort of flag like `--accessible` or<br>
&gt; `--latex-tagging` that could be passed to the texi2any script that wou=
ld<br>
&gt; cause certain changes to the TeX and pdf output, such as the following=
:<br>
<br>
I do not think that a command-line should be used for that.=C2=A0 Maybe a<b=
r>
customization variable.<br>
<br>
&gt; * Forward any alt text to the `\includegraphics` commands.<br>
<br>
This seems to be relevant independently of the remaining.=C2=A0 However, it=
<br>
looks like it was added in 2021, according to<br>
=C2=A0 <a href=3D"https://ctan.tetaneutral.net/macros/latex/required/graphi=
cs/grfguide.pdf" rel=3D"noreferrer" target=3D"_blank">https://ctan.tetaneut=
ral.net/macros/latex/required/graphics/grfguide.pdf</a><br>
<br>
What happends if graphicx is older with an unknown alt=3D passed?<br>
<br>
&gt; * Insert a `\DocumentMetadata` command (with appropriate settings) at =
the<br>
&gt; beginning of the document.<br>
<br>
Which LaTeX version support \DocumentMetadata?=C2=A0 What happens if the<br=
>
version used does not?<br>
<br>
In case it is possible to use \DocumentMetadata, which should be the<br>
format of the lang?=C2=A0 Some examples on the internet look like BCP 47, b=
ut<br>
it is not so clear.<br>
<br>
&gt; * (For pdf output) compile with lualatex instead of pdflatex.<br>
<br>
texi2any does not compile the LaTeX file, just produces it.<br>
<br>
&gt; * Ideally, we would also have &quot;actual&quot; and &quot;artifact&qu=
ot; tags as well. If I<br>
&gt; understand correctly, the &quot;actual=3D&lt;stuff&gt;&quot; tag indic=
ates to screenreaders<br>
&gt; that the image should be treated as if it were the text &quot;&lt;stuf=
f&gt;&quot;;<br>
<br>
It seems to be actualtext=3D, not actual=3D.=C2=A0 We could use a file like=
<br>
image.txt that we use in Info output, for example for that.=C2=A0 It is not=
<br>
clear, however, how to specify it.=C2=A0 Is it an issue if there are end of=
<br>
line in it?=C2=A0 Blank lines?=C2=A0 The manual does not show any example.<=
br>
<br>
Also it seems to be quite recent, end of 2024, similarly, what happens<br>
with older graphicx with an unknown actualtext=3D passed?<br>
<br>
&gt; the<br>
&gt; &quot;artifact&quot; tag tells the screenreader to ignore the image al=
together (used,<br>
&gt; e.g., for logos).<br>
<br>
Not sure that there is a use in Texinfo to LaTeX conversion.<br>
<br>
&gt; There may be other changes needed, as discussed in the issue linked ab=
ove.<br>
&gt; (Note: Some of these may be better dealt with on the TeX side rather t=
han<br>
&gt; the texinfo side.)<br>
<br>
I think that \hypersetup{pdftitle=3D{}} could be added.=C2=A0 It looks like=
 a<br>
relevant addition in the default case.<br>
<br>
It is not clear to me why style=3Dnextline is incompatible with tagging.<br=
>
Is it really important, or should it be fixed someday?<br>
<br>
The noparboxtagging stuff seems obscure to me, but I can add it if there<br=
>
is some explanation, and also it is not clear to me if \AssignTaggingSocket=
Plug<br>
and \tagpdfparaOff are backward compatible enough.<br>
<br>
Regarding \usepackage{unicode-math}, I do not have a clear idea whether<br>
it is a good idea to use that instead of amsmath.=C2=A0 It seems that the<b=
r>
\mathbf and similar commands should be changed, but it is not so clear<br>
either.=C2=A0 Also it seems to require some specific fonts.=C2=A0 Maybe the=
re<br>
could be some customization option to generate LaTeX for an engine or<br>
the other.<br>
<br>
-- <br>
Pat<br>
</blockquote></div>
</blockquote></div>

--000000000000feceb5065754aea8--