texlive[49642] Master/texmf-dist: axessibility (8jan19)

commits+karl at tug.org commits+karl at tug.org
Tue Jan 8 22:54:03 CET 2019


Revision: 49642
          http://tug.org/svn/texlive?view=revision&revision=49642
Author:   karl
Date:     2019-01-08 22:54:02 +0100 (Tue, 08 Jan 2019)
Log Message:
-----------
axessibility (8jan19)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/latex/axessibility/README
    trunk/Master/texmf-dist/doc/latex/axessibility/axessibility.pdf
    trunk/Master/texmf-dist/doc/latex/axessibility/axessibilityExampleGoldenMean.tex
    trunk/Master/texmf-dist/source/latex/axessibility/axessibility.dtx
    trunk/Master/texmf-dist/source/latex/axessibility/axessibility.ins
    trunk/Master/texmf-dist/tex/latex/axessibility/axessibility.sty

Modified: trunk/Master/texmf-dist/doc/latex/axessibility/README
===================================================================
--- trunk/Master/texmf-dist/doc/latex/axessibility/README	2019-01-08 19:24:46 UTC (rev 49641)
+++ trunk/Master/texmf-dist/doc/latex/axessibility/README	2019-01-08 21:54:02 UTC (rev 49642)
@@ -1,7 +1,7 @@
 % axessibility - create pdf files with mathematical formulae accessible by assistive 
-%                technologies for visually impaired people with LaTeX
+%                      technologies for visually impaired people with LaTeX
 %
-% Copyright (C) 2018 by 
+% Copyright (C) 2018, 2019 by 
 % Anna Capietto, Sandro Coriasco, Tiziana Armano, 
 % Nadir Murru, Alice Ruighi, Eugenia Taranto,
 % Dragan Ahmetovic, Cristian Bernareggi, Michele Berra
@@ -19,7 +19,7 @@
 % This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 License 
 % http://creativecommons.org/licenses/by-nc/4.0/
 %
-This is version 1.0 of axessibility, a package which allows LaTeX to create 
+This is version 2.0 of axessibility, a package which allows LaTeX to create 
 pdf files with mathematical formulae accessible by assistive technologies 
 for visually impaired people.
 

Modified: trunk/Master/texmf-dist/doc/latex/axessibility/axessibility.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/latex/axessibility/axessibilityExampleGoldenMean.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/axessibility/axessibilityExampleGoldenMean.tex	2019-01-08 19:24:46 UTC (rev 49641)
+++ trunk/Master/texmf-dist/doc/latex/axessibility/axessibilityExampleGoldenMean.tex	2019-01-08 21:54:02 UTC (rev 49642)
@@ -1,5 +1,5 @@
 % 
-% Copyright (C) 2018 by 
+% Copyright (C) 2018, 2019 by 
 % Anna Capietto, Sandro Coriasco, Tiziana Armano, 
 % Nadir Murru, Alice Ruighi, Eugenia Taranto,
 % Dragan Ahmetovic, Cristian Bernareggi, Michele Berra

Modified: trunk/Master/texmf-dist/source/latex/axessibility/axessibility.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/axessibility/axessibility.dtx	2019-01-08 19:24:46 UTC (rev 49641)
+++ trunk/Master/texmf-dist/source/latex/axessibility/axessibility.dtx	2019-01-08 21:54:02 UTC (rev 49642)
@@ -1,7 +1,7 @@
 %
 % \iffalse meta-comment 
 % 
-% Copyright (C) 2018 by 
+% Copyright (C) 2018, 2019 by 
 % Anna Capietto, Sandro Coriasco, Tiziana Armano, 
 % Nadir Murru, Alice Ruighi, Eugenia Taranto,
 % Dragan Ahmetovic, Cristian Bernareggi, Michele Berra
@@ -29,7 +29,7 @@
 \CodelineIndex
 \RecordChanges\begin{document}
 \title{The \textsf{axessibility} package}
-\date{July 9, 2018}
+\date{January 8, 2019}
  \author{Dragan Ahmetovic, Tiziana Armano, Cristian Bernareggi, \\
  Michele Berra, Anna Capietto, Sandro Coriasco, Nadir Murru,\\
  Alice Ruighi, Eugenia Taranto \\ 
@@ -42,6 +42,7 @@
 %\fi
 %
 % \changes{v1.0}{2018/07/09}{Initial version} 
+% \changes{v2.0}{2019/01/08}{Added support for environments align, align*, alignat, alignat*, flalign, flalign*, gather, gather*, xalignat, xalignat*, and xxalignat, from the package \textbf{amsmath}} 
 %
 % \maketitle
 %
@@ -56,7 +57,7 @@
 %\section{Introduction}
 %This package focuses on the specific problem of the accessibility of PDF documents generated by \LaTeX\ for visually impaired people.
 %When a PDF document is generated starting from \LaTeX, formulae are not accessible by screen readers and braille displays. 
-% They can be made accessible by inserting a hidden comment, i.e., an actual text, similarly to the case of web pages. 
+% They can be made accessible by inserting a hidden comment, i.e., an ActualText, similarly to the case of web pages. 
 % This can be made, e.g., by using the \LaTeX\ package pdfcomment.sty. In any case, this task must be manually performed by the author and it is surely inefficient, 
 % since the author should write the formulae and, in addition, insert a description for each formula. 
 % Note also that the package pdfcomment.sty does not allow to insert special characters like `backslash', `brace', etc, in the comment. 
@@ -68,8 +69,8 @@
 % since the comment must be manually inserted by the author. The package accessibility$\_$meta.sty is an improved version of the package accessibility.sty. 
 % This package allows the possibility of inserting several tags for sections, links, figures and tables. 
 % However, even if these tags are recognized by the tool for checking tags of Acrobat Reader Pro, they are not always recognized by the screen readers. 
-% Moreover, this package does not manage formulae. Our package automatically produces an actual text corresponding to the \LaTeX\ commands that generate the formulae. 
-% This actual text is hidden in the PDF document, but the screen reader reads it without reading  any incorrect sequence before. 
+% Moreover, this package does not manage formulae. Our package automatically produces an ActualText corresponding to the \LaTeX\ commands that generate the formulae. 
+% This ActualText is hidden in the PDF document, but the screen reader reads it without reading  any incorrect sequence before. 
 %
 %\section{License}
 %
@@ -78,7 +79,7 @@
 %
 %\section{Prerequisites}
 %
-%The package \textbf{axessibility} requires the following packages: \textbf{accsupp, amsmath, amssymb}.
+%The package \textbf{axessibility} requires the following packages: \textbf{accsupp, amsmath, amssymb, xstring}.
 %
 %\section{Package specification}
 %
@@ -94,11 +95,13 @@
 %\item The command \\ \\
 %\indent $\backslash$\textbf{BeginAccSupp} 
 %\\ \\
-%contained in the package \textbf{accsupp} has been redefined so that the screen readers access the actual text created by this command. 
-%\item The new command \\ \\
-%\indent $\backslash$\textbf{wrap$\#$1}
+%contained in the package \textbf{accsupp}, has been redefined so that the screen readers access the ActualText created by this command. 
+%\item The new commands \\ \\
+%\indent $\backslash$\textbf{wrap$\#$1}\\
+%\indent $\backslash$\textbf{wrapml$\#$1}
 %\\ \\
-%allows to store its input into an actual text in the PDF document (e.g., the \LaTeX\ commands for generating a formula).
+%allow to store their input into an ActualText in the PDF document (e.g., the \LaTeX\ commands for generating a formula), 
+%for single line and multiple line formulae environments, respectively
 %
 %\item The environments \\ \\
 %\indent $\backslash$\textbf{begin}$\{$\textbf{equation}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{equation}$\}$ \\
@@ -106,31 +109,45 @@
 %\indent $\backslash$[ \dots $\backslash$]\\
 %\indent $\backslash$( \dots $\backslash$)\\ 
 %
-%have been redefined. In each environment listed above, the command \cs{wrap} is inserted together with
-%the command \cs{collect at body}, so that all the content of the environment is automatically stored into an ActualText in the PDF document.
+%have been redefined. In each environment listed above, the command \cs{wrap} is inserted, together with
+%the command \cs{collect at body}, so that all the content of the environment is automatically stored into an 
+% ActualText in the PDF document. The following multiline formula environments, defined in the \textbf{amsmath} package,\\ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{align}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{align}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{align*}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{align*}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{alignat}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{alignat}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{alignat*}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{alignat*}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{flalign}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{flalign}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{flalign*}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{flalign*}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{gather}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{gather}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{gather*}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{gather*}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{xalignat}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{xalignat}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{xalignat*}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{xalignat*}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{xxalignat}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{xxalignat}$\}$ \\
+%
+% have been similarly redefined, using the command \cs{wrapml}. The content of these environments, too, is now stored into an 
+% ActualText in the PDF document. The support for more multiline environments will be added in future versions of the package.
 %\end{itemize}
 %
 %\section{Usage}
 %
-%An author that wants to create an accessible PDF document for visually impaired people can add this package using the above environments for inserting the formulae. The \LaTeX\ code of the inserted formulae will be added as hidden comments in correspondence to the location of the formulae in the text. This will allow the user to access the formula code with the screen reader and with the braille refreshable display. Additionally, the package enables to copy the formula \LaTeX\ code from the PDF reader and paste it elsewhere.
+% An author that wants to create an accessible PDF document for visually impaired people can add this package and use the above 
+% environments for inserting the formulae. The \LaTeX\ code of the inserted formulae will be added as hidden comments in 
+% correspondence to the location of the formulae in the text. This will allow the user to access the formula code with the screen reader 
+% and with the braille refreshable display. Additionally, the package enables to copy the formula \LaTeX\ code from the PDF reader 
+% and paste it elsewhere.
 %
 %Note that, to preserve the compatibility with Acrobat Reader, our package discourages the use of the underscore character ($\_$), which is not correctly read using screen readers in combination with this PDF reader. Alternatively, we suggest to use the equivalent command \cs{sb}.
 %
 %Inline and displayed mathematical modes encoded by means of $\$$ and $\$\$$ are not supported by the package. However, external scripts, provided as companion 
-% software and described in the following section, can also address these cases. \\
+% software and described in the following section, can address, at least partly, these cases. Moreover, provided that also the package 
+% \textbf{eqnalign} is added, the (old) multiline formula environments\\ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{eqnarray}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{eqnarray}$\}$ \\
+%\indent $\backslash$\textbf{begin}$\{$\textbf{eqnarray*}$\}$ \dots $\backslash$\textbf{end}$\{$\textbf{eqnarray*}$\}$ \\
 %
-%While multiline environments like \\ \\
-%\indent \textbf{align}, \textbf{multline}, \dots
-%\\ \\
-%are, at present, not directly supported, it is of course possible to use \\ \\
-%\indent $\backslash$\textbf{begin}$\{$\textbf{equation}$\}$ $\backslash$\textbf{begin}$\{$\textbf{aligned}$\}$ \dots
-% $\backslash$\textbf{end}$\{$\textbf{aligned}$\}$ $\backslash$\textbf{end}$\{$\textbf{equation}$\}$ 
-%\\ \\
-%for typesetting multiline formulae. The environments
-%\begin{center} \textbf{eqnarray}/\textbf{eqnarray*} \end{center}
-% can be (partially) treated by using the preprocessing scripts (see below). The full treatment of the multiline environments, 
-% in particular those defined in the \textbf{amsmath} package, will be added in future versions.
+% \noindent will automatically generate the corresponding hidden ActualText.
+%
 
+
 %
 %\section{External scripts and screen reader integration}
 %
@@ -139,35 +156,52 @@
 %\subsection{Preprocessing scripts}
 %While we warmly suggest to follow the indications provided in the usage guide (suggested commands and environments), it is also possible to apply our package to an already existing \LaTeX\ document. In this case, it is necessary to preprocess the document in order to replace some of the unsupported commands and environments with the suggested ones. We provide a preprocessing script to handle some of these cases at our Github repository\footnote{\label{fn:repo}\url{www.integr-abile.unito.it/axessibility/?repository}}. %
 %\subsection{Expansion of user macros}
-%Note that custom macros used by the author within the formulae are copied as-is into the actual text in the hidden comment. This macros may bear no meaning for other readers, so it may be more meaningful to expand those macros into the original \LaTeX\ commands. We provide a script that can parse \LaTeX\ document and replace all the user macros within the formulae with their expanded definitions. You can download this script at our Github repository\footnotemark[\ref{fn:repo}].
+%Note that custom macros used by the author within the formulae are copied as-is into the ActualText in the hidden comment. This macros may bear no meaning for other readers, so it may be more meaningful to expand those macros into the original \LaTeX\ commands. We provide a script that can parse \LaTeX\ document and replace all the user macros within the formulae with their expanded definitions. You can download this script at our Github repository\footnotemark[\ref{fn:repo}].
 %
 %\subsection{Screen reader dictionaries}
-%\LaTeX\ commands that are included as actual text in the hidden comments corresponding to formulae may appear awkward when read by the screen reader. We provide dictionaries for JAWS and NVDA screen readers that convert \LaTeX\ commands into natural language. Please note that the braille refreshable display will still show the formulae in their original \LaTeX\ representations. The dictionaries can be downloaded at our Github repository\footnotemark[\ref{fn:repo}].
+%\LaTeX\ commands that are included as ActualText in the hidden comments corresponding to formulae may appear awkward when read by the screen reader. We provide dictionaries for JAWS and NVDA screen readers that convert \LaTeX\ commands into natural language. Please note that the braille refreshable display will still show the formulae in their original \LaTeX\ representations. The dictionaries can be downloaded at our Github repository\footnotemark[\ref{fn:repo}].
 %
 %\section{Implementation}
 %
-%
+
 % Standard file identification.
 
-% \begin{macrocode}
+%    \begin{macrocode}
 %
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{axessibility}
-%[2018/07/09 v1.0: Accessibility support by marked content for inline & displayed formulae]
+%[2019/01/08 v2.0: Accessibility support by marked content for inline, 
+%                  displayed, and various multiline formulae]
 \RequirePackage{accsupp}
 \RequirePackage{amsmath}
 \RequirePackage{amssymb}
-% PDF compression/unicode settings
+\RequirePackage{xstring}
+%
+%    \end{macrocode}
+
+% \noindent PDF compression/unicode settings.
+
+%    \begin{macrocode}
+%
 \pdfcompresslevel=0
 \pdfoptionpdfminorversion=6
 \input{glyphtounicode}
 \pdfgentounicode=1
 %
-% \end{macrocode}
+%    \end{macrocode}
+
+
+% \noindent Tokens used for the treatment of multiline formula environments.
+
+%    \begin{macrocode}
 %
+\newtoks\@mltext
+\newtoks\@mltexttmp
+%
+%    \end{macrocode}
 
 
-% Renewed command \cs{BeginAccSupp} defined in package \textbf{accsupp}  
+% \noindent Renewed command \cs{BeginAccSupp}, originally defined in the package \textbf{accsupp},
 % to add the string \cs{S} before \cs{span}. 
 % This makes the formula readable by voiceover technologies.
 
@@ -205,12 +239,11 @@
 %
 %    \end{macrocode}
 
+
 %    \noindent The next command creates a blank space to avoid clash with references (it appears to be a \cs{protect}...).
 %      Refer to https://tex.stackexchange.com/questions/57151/how-do-i-prevent-conflicts-between-accsupp-and-hyperref 
 %    for possible handling of such issues.)
 
-
-
 %    \begin{macrocode}
 %
 \newcommand{\auxiliaryspace}{ }
@@ -222,7 +255,7 @@
 % commands, to make the math-text available in comments.
 % \cs{detokenize} allows the formula to be parsed and read as a string.
 % \cs{expandafter} there applies to the token "\{" and allow \cs{detokenize} to be applied 
-% after argument \#1 is passed to \cs{AccSupp}.
+% after argument \#1 is passed to \cs{BeginAccSupp}.
 
 %    \begin{macrocode}
 %
@@ -237,6 +270,27 @@
 %    \end{macrocode}
 
 
+% \noindent The next wrapper, similar to the previous one, is used to handle multiline formula environments. 
+% Here some additional step is needed to obtain the desired content, to be stored via \cs{BeginAccSupp}.
+
+%    \begin{macrocode}
+%
+\makeatletter
+\long\def\wrapml#1{
+\def\@mltext{\detokenize\expandafter{#1}}
+\def\@mltexttmp{}
+\StrBehind[5]{\@mltext}{ }[\@mltexttmp]
+\StrGobbleRight{\@mltexttmp}{1}[\@mltext]
+\BeginAccSupp{method=escape,ActualText=\auxiliaryspace\@mltext}
+ #1
+\EndAccSupp{}%
+}
+\makeatother
+%
+%    \end{macrocode}
+
+
+
 % \noindent The next function redefines \cs{equation} by calling the above wrapper to its argument. 
 % This makes \cs{equation} accessible.
 
@@ -274,7 +328,6 @@
   \mathdisplay at pop
   \ignorespacesafterend
 }
-%
 \makeatother
 %
 %    \end{macrocode}
@@ -294,22 +347,117 @@
 
 % \noindent The next function redefines \cs{(} \cs{)} by means of a (temporary) 
 % math environment that calls the wrapper defined above.
-%
+
 %    \begin{macrocode}
 %
 \makeatletter
-%
 \newenvironment{tempenv}{%
   \relax\ifmmode\@badmath\else$\fi%
  \collect at body\wrap}{%
   \relax\ifmmode\ifinner$\else\@badmath\fi\else \@badmath\fi}
-%
 \protected\def\(#1\){\begin{tempenv}#1\end{tempenv}}
+\makeatother
 %
+%    \end{macrocode}
+
+
+% \noindent The next functions redefine the environments align, align*, alignat, alignat*, flalign, flalign*, gather, gather*,
+% xalignat, xalignat*, xxalignat, originally defined in the package \textbf{amsmath}, by calling the above multiline wrapper to their 
+% argument. The structure, as for the original macros, is essentially the same for all of them.
+
+%    \begin{macrocode}
+%
+\makeatletter
+
+\renewenvironment{alignat}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\z@\st at rredfalse
+}{%
+  \endalign
+}
+\renewenvironment{alignat*}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\z@\st at rredtrue
+}{%
+  \endalign
+}
+\renewenvironment{xalignat}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\@ne\st at rredfalse
+}{%
+  \endalign
+}
+\renewenvironment{xalignat*}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\@ne\st at rredtrue
+}{%
+  \endalign
+}
+\renewenvironment{xxalignat}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\tw@\st at rredtrue
+}{%
+  \endalign
+}
+
+\renewenvironment{align}{%
+  \collect at body\wrapml\auxiliaryspace
+ \start at align\@ne\st at rredfalse\m at ne
+}{%
+  \math at cr \black@\totwidth@
+  \egroup
+  \ifingather@
+    \restorealignstate@
+    \egroup
+    \nonumber
+    \ifnum0=`{\fi\iffalse}\fi
+  \else
+    $$%
+  \fi
+  \ignorespacesafterend
+}
+
+\renewenvironment{align*}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\@ne\st at rredtrue\m at ne
+}{%
+  \endalign
+}
+
+\renewenvironment{flalign}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\tw@\st at rredfalse\m at ne
+}{%
+  \endalign
+}
+
+\renewenvironment{flalign*}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\tw@\st at rredtrue\m at ne
+}{%
+  \endalign
+}
+
+\renewenvironment{gather}{%
+  \collect at body\wrapml\auxiliaryspace\auxiliaryspace
+  \start at gather\st at rredfalse
+}{%
+  \math at cr \black@\totwidth@ \egroup
+  $$\ignorespacesafterend
+}
+
+\renewenvironment{gather*}{%
+  \collect at body\wrapml\auxiliaryspace\auxiliaryspace
+  \start at gather\st at rredtrue
+}{%
+  \endgather
+}
+
 \makeatother
 %
 %    \end{macrocode}
 
+
 %
 %\section{History}
 %\noindent \textbf{[2018/07/09: v1.0] }
@@ -316,6 +464,10 @@
 %\begin{itemize}
 %	\item First version 
 %\end{itemize}
+%\noindent \textbf{[2019/01/08: v2.0] }
+%\begin{itemize}
+%	\item Added support for environments align, align*, alignat, alignat*, flalign, flalign*, gather, gather*, xalignat, xalignat*, and xxalignat, from the package \textbf{amsmath} 
+%\end{itemize}
 
 \endinput
 

Modified: trunk/Master/texmf-dist/source/latex/axessibility/axessibility.ins
===================================================================
--- trunk/Master/texmf-dist/source/latex/axessibility/axessibility.ins	2019-01-08 19:24:46 UTC (rev 49641)
+++ trunk/Master/texmf-dist/source/latex/axessibility/axessibility.ins	2019-01-08 21:54:02 UTC (rev 49642)
@@ -1,5 +1,5 @@
 %
-% Copyright (C) 2018 by 
+% Copyright (C) 2018, 2019 by 
 % Anna Capietto, Sandro Coriasco, Tiziana Armano, 
 % Nadir Murru, Alice Ruighi, Eugenia Taranto,
 % Dragan Ahmetovic, Cristian Bernareggi, Michele Berra
@@ -26,7 +26,7 @@
 
 This is a generated file. 
 
-Copyright (C) 2018  by
+Copyright (C) 2018, 2019  by
 Anna Capietto, Sandro Coriasco, Tiziana Armano, 
 Nadir Murru, Alice Ruighi, Eugenia Taranto,
 Dragan Ahmetovic, Cristian Bernareggi, Michele Berra.

Modified: trunk/Master/texmf-dist/tex/latex/axessibility/axessibility.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/axessibility/axessibility.sty	2019-01-08 19:24:46 UTC (rev 49641)
+++ trunk/Master/texmf-dist/tex/latex/axessibility/axessibility.sty	2019-01-08 21:54:02 UTC (rev 49642)
@@ -8,7 +8,7 @@
 %% 
 %% This is a generated file.
 %% 
-%% Copyright (C) 2018  by
+%% Copyright (C) 2018, 2019  by
 %% Anna Capietto, Sandro Coriasco, Tiziana Armano,
 %% Nadir Murru, Alice Ruighi, Eugenia Taranto,
 %% Dragan Ahmetovic, Cristian Bernareggi, Michele Berra.
@@ -26,11 +26,15 @@
 %% 
 
 
+
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{axessibility}
 \RequirePackage{accsupp}
 \RequirePackage{amsmath}
 \RequirePackage{amssymb}
+\RequirePackage{xstring}
+
+
 \pdfcompresslevel=0
 \pdfoptionpdfminorversion=6
 \input{glyphtounicode}
@@ -37,6 +41,10 @@
 \pdfgentounicode=1
 
 
+\newtoks\@mltext
+\newtoks\@mltexttmp
+
+
 \makeatletter
 \renewcommand*{\BeginAccSupp}[1]{%
   \begingroup
@@ -81,6 +89,19 @@
 
 
 \makeatletter
+\long\def\wrapml#1{
+\def\@mltext{\detokenize\expandafter{#1}}
+\def\@mltexttmp{}
+\StrBehind[5]{\@mltext}{ }[\@mltexttmp]
+\StrGobbleRight{\@mltexttmp}{1}[\@mltext]
+\BeginAccSupp{method=escape,ActualText=\auxiliaryspace\@mltext}
+ #1
+\EndAccSupp{}%
+}
+\makeatother
+
+
+\makeatletter
 \renewenvironment{equation}{%
  \incr at eqnum
   \mathdisplay at push
@@ -111,6 +132,7 @@
 \protected\def\[#1\]{\begin{equation*}#1\end{equation*}}
 \makeatother
 
+
 \makeatletter
 \newenvironment{tempenv}{%
   \relax\ifmmode\@badmath\else$\fi%
@@ -120,6 +142,95 @@
 \makeatother
 
 
+\makeatletter
+
+\renewenvironment{alignat}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\z@\st at rredfalse
+}{%
+  \endalign
+}
+\renewenvironment{alignat*}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\z@\st at rredtrue
+}{%
+  \endalign
+}
+\renewenvironment{xalignat}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\@ne\st at rredfalse
+}{%
+  \endalign
+}
+\renewenvironment{xalignat*}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\@ne\st at rredtrue
+}{%
+  \endalign
+}
+\renewenvironment{xxalignat}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\tw@\st at rredtrue
+}{%
+  \endalign
+}
+
+\renewenvironment{align}{%
+  \collect at body\wrapml\auxiliaryspace
+ \start at align\@ne\st at rredfalse\m at ne
+}{%
+  \math at cr \black@\totwidth@
+  \egroup
+  \ifingather@
+    \restorealignstate@
+    \egroup
+    \nonumber
+    \ifnum0=`{\fi\iffalse}\fi
+  \else
+    $$%
+  \fi
+  \ignorespacesafterend
+}
+
+\renewenvironment{align*}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\@ne\st at rredtrue\m at ne
+}{%
+  \endalign
+}
+
+\renewenvironment{flalign}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\tw@\st at rredfalse\m at ne
+}{%
+  \endalign
+}
+
+\renewenvironment{flalign*}{%
+  \collect at body\wrapml\auxiliaryspace
+  \start at align\tw@\st at rredtrue\m at ne
+}{%
+  \endalign
+}
+
+\renewenvironment{gather}{%
+  \collect at body\wrapml\auxiliaryspace\auxiliaryspace
+  \start at gather\st at rredfalse
+}{%
+  \math at cr \black@\totwidth@ \egroup
+  $$\ignorespacesafterend
+}
+
+\renewenvironment{gather*}{%
+  \collect at body\wrapml\auxiliaryspace\auxiliaryspace
+  \start at gather\st at rredtrue
+}{%
+  \endgather
+}
+
+\makeatother
+
+
 \endinput
 %%
 %% End of file `axessibility.sty'.



More information about the tex-live-commits mailing list