Skip to content

Commit

Permalink
actualtext and artifact fo #1552
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcarlisle committed Dec 31, 2024
1 parent 5dbc00a commit e0742dc
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 5 deletions.
10 changes: 9 additions & 1 deletion base/doc/ltnews41.tex
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,15 @@ \subsection{Prevent \texttt{cmd} hook from defining an undefined command}

%\section{Changes to packages in the \pkg{amsmath} category}

%\section{Changes to packages in the \pkg{graphics} category}
\section{Changes to packages in the \pkg{graphics} category}

\subsection{More accessibility keys in \pkg{graphicx}}
The \cs{includegraphics} command now accepts \verb|actualtext| and
\verb|artifact| keys, which by default do nothing but are used by the
tagging code to provide an ActualText string and a boolean flag that the
graphic is an artifact.
%
\githubissue{1552}

\section{Changes to packages in the \pkg{tools} category}

Expand Down
5 changes: 5 additions & 0 deletions required/graphics/changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ are not part of the distribution.
All changes above are only part of the development branch for the next release.
================================================================================

2024-12-31 David Carlisle <[email protected]>

* grfguide.tex:
Add actualtex and artifact keys for gh/1552

#########################
# 2024-11-01 Release
#########################
Expand Down
28 changes: 25 additions & 3 deletions required/graphics/graphicx.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
%<driver> \ProvidesFile{graphicx.drv}
% \fi
% \ProvidesFile{graphicx.dtx}
[2021/09/16 v1.2d Enhanced LaTeX Graphics (DPC,SPQR)]
[2024/12/31 v1.2e Enhanced LaTeX Graphics (DPC,SPQR)]
%
% \iffalse
%<*driver>
Expand Down Expand Up @@ -170,7 +170,10 @@
% \item[page] The page of a multi-page PDF graphic to be used.
% \item[interpolate] Enables interpolation of bitmap images by viewers.
% \item[pagebox] Specifies which PDF box should be used for the natural image size, one of
% mediabox, cropbox, bleedbox, trimbox, artbox. The default is driver-specific.
% mediabox, cropbox, bleedbox, trimbox, artbox. The default is driver-specific.
% \item[alt] Alternative text in accessibility uses.
% \item[actualtext] Alternative text in accessibility uses.
% \item[artifact] Boolean to mark graphics as an artifact in accessibility uses.
% \end{description}
%
% The arguments are interpreted left to right. |clip|, |draft|, |bb|,,
Expand Down Expand Up @@ -566,14 +569,33 @@
% \end{key}
%
% \begin{key}{Gin}{alt}
% \changes{v1.2d}{2021/09/16 }{alt key gh/651}
% \changes{v1.2d}{2021/09/16}{alt key gh/651}
% By default the |alt| key does nothing but may be used
% for alternative text for accessibility uses in extensions.
% \begin{macrocode}
\define@key{Gin}{alt}{}
% \end{macrocode}
% \end{key}
%
% \begin{key}{Gin}{actualtext}
% \changes{v1.2e}{2024/12/31}{actualtext key gh/1552}
% By default the |actualtext| key does nothing but may be used
% for ActualText text for accessibility uses in extensions.
% \begin{macrocode}
\define@key{Gin}{actualtext}{}
% \end{macrocode}
% \end{key}
%
% \begin{key}{Gin}{artifact}
% \changes{v1.2e}{2024/12/31}{artifact key gh/1552}
% By default the |artifact| key does nothing but may be used
% to mark graphicas as an artifact for accessibility uses in extensions.
% \begin{macrocode}
\define@key{Gin}{artifact}[true]{%
\lowercase{\Gin@boolkey{#1}}{artifact}}
% \end{macrocode}
% \end{key}
%
% \begin{macro}{\Gin@boolkey}
% Helper function for defining boolean valued functions. The order of
% arguments allows |\lowercase| to only act on the user-supplied
Expand Down
10 changes: 9 additions & 1 deletion required/graphics/grfguide.tex
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
\title{Packages in the `graphics' bundle}
\author{D. P. Carlisle \and The \LaTeX\ Project}

\date{2024-05-22}
\date{2024-12-31}

\maketitle

Expand Down Expand Up @@ -633,6 +633,14 @@ \subsection{Including Graphics Files}
Alternative text for accessibility uses. By default this key is not used
but users are encouraged to add descriptive text here that may be used in
tagged PDF or as the |alt| attribute in conversions to HTML.
\item[actualtext]\NEWfeature{2024/12/31}
ActualText text for accessibility uses. By default this key is not used
but users are encouraged to add text here that may be used in
tagged PDF or as the text to use in formats that do not use the image.
\item[artifact]\NEWfeature{2024/12/31}
Boolean to mark the graphic as an artifact for accessibility uses. By default this key is not used
but users are encouraged to flac decorative or other non structural images as an artifact for
tagged PDF.
\end{description}

For the keys specifying the original size (i.e., the bounding box,
Expand Down
10 changes: 10 additions & 0 deletions required/graphics/testfiles/github-1552.lvt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
\documentclass{article}
\usepackage[demo]{graphicx}
\input{test2e}
\begin{document}

\START
% this should not error
\includegraphics[artifact,actualtext=test image showing an A and lines]{a}

\END
2 changes: 2 additions & 0 deletions required/graphics/testfiles/github-1552.tlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This is a generated file for the LaTeX2e validation system.
Don't change this file in any respect.

0 comments on commit e0742dc

Please sign in to comment.