├── README ├── examples ├── axessibilityExampleAlignA.tex ├── axessibilityExampleAlignT.tex ├── axessibilityExampleSingleLineA.tex └── axessibilityExampleSingleLineT.tex └── package ├── axessibility.lua ├── axessibility.pdf └── axessibility.sty /README: -------------------------------------------------------------------------------- 1 | % 2 | % Copyright (C) 2018, 2019, 2020 by 3 | % Anna Capietto, Sandro Coriasco, Boris Doubrov, Alexander Koslovski, 4 | % Tiziana Armano, Nadir Murru, Dragan Ahmetovic, Cristian Bernareggi 5 | % 6 | % Based on accsupp and tagpdf 7 | % 8 | % This work consists of the main source files and axessibility.lua, 9 | % and the derived files 10 | % axessibility.sty, axessibility.pdf, README, 11 | % axessibilityExampleSingleLineT.tex, axessibilityExampleSingleLineA.tex, 12 | %. axessibilityExampleAlignT.tex, axessibilityExampleAlignA.tex 13 | % 14 | % This work may be distributed and/or modified under the 15 | % conditions of the LaTeX Project Public License, either version 1.3 16 | % of this license or (at your option) any later version. 17 | % The latest version of this license is in 18 | % http://www.latex-project.org/lppl.txt 19 | % and version 1.3 or later is part of all distributions of LaTeX 20 | % version 2005/12/01 or later. 21 | % 22 | % This work has the LPPL maintenance status `maintained'. 23 | % 24 | % The Current Maintainer of this work is 25 | % Sandro Coriasco 26 | % 27 | 28 | This is version 3.0 of axessibility, a package which allows LaTeX to create 29 | pdf files with mathematical formulae accessible by assistive technologies 30 | for visually impaired people and people with special educational needs. 31 | 32 | On GitHub, the following files are enclosed. 33 | 34 | README - This file. 35 | package/axessibility.sty - The axessibility package. 36 | package/axessibility.pdf - The package documentation. 37 | package/axessibility.lua - Lua code module for the automatic replacement of $ and $$ Tex markers 38 | with their LaTeX equivalents, automatic tagging of paragraphs, and more. 39 | examples/axessibilityExampleSingleLineT - A sample LaTeX file which uses the axessibility package, 40 | with inline and single line displayed formulae, employing 41 | the tagpdf package option. 42 | examples/axessibilityExampleSingleLineA - Same as above, employing the accsupp option. 43 | examples/axessibilityExampleAlignT - A sample LaTeX file which uses the axessibility package, 44 | with inline and multiline displayed formulae, 45 | employing the tagpdf option. 46 | examples/axessibilityExampleAlignA - Same as above, employing the accsupp option. 47 | 48 | Installation notes: 49 | Move `axessibility.sty` and `axessibility.lua` to the correct folders of your local `texmf` directory 50 | -------------------------------------------------------------------------------- /examples/axessibilityExampleAlignA.tex: -------------------------------------------------------------------------------- 1 | % 2 | % Copyright (C) 2018, 2019, 2020 by 3 | % Anna Capietto, Sandro Coriasco, Boris Doubrov, Alexander Koslovski, 4 | % Tiziana Armano, Nadir Murru, Dragan Ahmetovic, Cristian Bernareggi 5 | % 6 | % Based on accsupp and tagpdf 7 | % 8 | % This work consists of the main source files axessibility.dtx and axessibility.lua, 9 | % and the derived files 10 | % axessibility.ins, axessibility.sty, axessibility.pdf, README, 11 | % axessibilityExampleSingleLineT.tex, axessibilityExampleSingleLineA.tex, 12 | %. axessibilityExampleAlignT.tex, axessibilityExampleAlignA.tex 13 | % 14 | % This work may be distributed and/or modified under the 15 | % conditions of the LaTeX Project Public License, either version 1.3 16 | % of this license or (at your option) any later version. 17 | % The latest version of this license is in 18 | % http://www.latex-project.org/lppl.txt 19 | % and version 1.3 or later is part of all distributions of LaTeX 20 | % version 2005/12/01 or later. 21 | % 22 | % This work has the LPPL maintenance status `maintained'. 23 | % 24 | % The Current Maintainer of this work is 25 | % Sandro Coriasco 26 | % 27 | 28 | \documentclass[a4paper,11pt]{article} 29 | 30 | \usepackage[accsupp]{axessibility} 31 | 32 | \title{Algebraic equations of second degree:\\ 33 | relation between roots and coefficients} 34 | \author{} 35 | \date{} 36 | 37 | 38 | \begin{document} 39 | 40 | 41 | 42 | \maketitle 43 | 44 | 45 | Given the equation \( a x^2 + bx + c= 0, a\not=0 \), 46 | we have the following relations between its roots 47 | \( x_{1,2} \): 48 | 49 | \begin{align*} 50 | x_1+x_2 & = -\frac{b}{a},\\ 51 | x_1\cdot x_2 &= \phantom{-}\frac{c}{a}. 52 | \end{align*} 53 | 54 | 55 | 56 | \end{document} 57 | -------------------------------------------------------------------------------- /examples/axessibilityExampleAlignT.tex: -------------------------------------------------------------------------------- 1 | % 2 | % Copyright (C) 2018, 2019, 2020 by 3 | % Anna Capietto, Sandro Coriasco, Boris Doubrov, Alexander Koslovski, 4 | % Tiziana Armano, Nadir Murru, Dragan Ahmetovic, Cristian Bernareggi 5 | % 6 | % Based on accsupp and tagpdf 7 | % 8 | % This work consists of the main source files axessibility.dtx and axessibility.lua, 9 | % and the derived files 10 | % axessibility.ins, axessibility.sty, axessibility.pdf, README, 11 | % axessibilityExampleSingleLineT.tex, axessibilityExampleSingleLineA.tex, 12 | %. axessibilityExampleAlignT.tex, axessibilityExampleAlignA.tex 13 | % 14 | % This work may be distributed and/or modified under the 15 | % conditions of the LaTeX Project Public License, either version 1.3 16 | % of this license or (at your option) any later version. 17 | % The latest version of this license is in 18 | % http://www.latex-project.org/lppl.txt 19 | % and version 1.3 or later is part of all distributions of LaTeX 20 | % version 2005/12/01 or later. 21 | % 22 | % This work has the LPPL maintenance status `maintained'. 23 | % 24 | % The Current Maintainer of this work is 25 | % Sandro Coriasco 26 | % 27 | 28 | \documentclass[a4paper,11pt]{article} 29 | 30 | \usepackage{axessibility} 31 | 32 | \title{Algebraic equations of second degree:\\ 33 | relation between roots and coefficients} 34 | \author{} 35 | \date{} 36 | 37 | 38 | \begin{document} 39 | 40 | 41 | 42 | \maketitle 43 | 44 | 45 | \tagstructbegin{tag=P} 46 | \tagmcbegin{tag=P} 47 | Given the equation \auxiliaryspace 48 | \tagmcend 49 | \tagstructend 50 | \( a x^2 + bx + c= 0, a\not=0 \), 51 | \tagstructbegin{tag=P} 52 | \tagmcbegin{tag=P} 53 | we have the following relations between its roots \auxiliaryspace 54 | \tagmcend 55 | \tagstructend 56 | \( x_{1,2} \): 57 | 58 | \begin{align*} 59 | x_1+x_2 & = -\frac{b}{a},\\ 60 | x_1\cdot x_2 &= \phantom{-}\frac{c}{a}. 61 | \end{align*} 62 | 63 | 64 | 65 | \end{document} 66 | -------------------------------------------------------------------------------- /examples/axessibilityExampleSingleLineA.tex: -------------------------------------------------------------------------------- 1 | % 2 | % Copyright (C) 2018, 2019, 2020 by 3 | % Anna Capietto, Sandro Coriasco, Boris Doubrov, Alexander Koslovski, 4 | % Tiziana Armano, Nadir Murru, Dragan Ahmetovic, Cristian Bernareggi 5 | % 6 | % Based on accsupp and tagpdf 7 | % 8 | % This work consists of the main source files axessibility.dtx and axessibility.lua, 9 | % and the derived files 10 | % axessibility.ins, axessibility.sty, axessibility.pdf, README, 11 | % axessibilityExampleSingleLineT.tex, axessibilityExampleSingleLineA.tex, 12 | %. axessibilityExampleAlignT.tex, axessibilityExampleAlignA.tex 13 | % 14 | % This work may be distributed and/or modified under the 15 | % conditions of the LaTeX Project Public License, either version 1.3 16 | % of this license or (at your option) any later version. 17 | % The latest version of this license is in 18 | % http://www.latex-project.org/lppl.txt 19 | % and version 1.3 or later is part of all distributions of LaTeX 20 | % version 2005/12/01 or later. 21 | % 22 | % This work has the LPPL maintenance status `maintained'. 23 | % 24 | % The Current Maintainer of this work is 25 | % Sandro Coriasco 26 | % 27 | 28 | \documentclass[a4paper,11pt]{article} 29 | 30 | \usepackage[accsupp]{axessibility} 31 | 32 | \title{The golden mean} 33 | \author{} 34 | \date{} 35 | 36 | \begin{document} 37 | 38 | \maketitle 39 | 40 | The golden mean is the number 41 | \[\frac{1 + \sqrt{5}}{2},\] 42 | that is the root larger in modulus of 43 | \begin{equation} x^2 - x - 1. \end{equation} 44 | It is usually defined as the ratio of two lengths \(a\) and \(b\) such that 45 | \begin{equation*} (a+b) : a = a : b. \end{equation*} 46 | Let \(x\) be the ratio \( \frac{a}{b} \), we have \( \frac{a+b}{a} = 1 + \frac{1}{x} \), from which we get the equation \(x^2 = x + 1\). 47 | 48 | 49 | \end{document} -------------------------------------------------------------------------------- /examples/axessibilityExampleSingleLineT.tex: -------------------------------------------------------------------------------- 1 | % 2 | % Copyright (C) 2018, 2019, 2020 by 3 | % Anna Capietto, Sandro Coriasco, Boris Doubrov, Alexander Koslovski, 4 | % Tiziana Armano, Nadir Murru, Dragan Ahmetovic, Cristian Bernareggi 5 | % 6 | % Based on accsupp and tagpdf 7 | % 8 | % This work consists of the main source files axessibility.dtx and axessibility.lua, 9 | % and the derived files 10 | % axessibility.ins, axessibility.sty, axessibility.pdf, README, 11 | % axessibilityExampleSingleLineT.tex, axessibilityExampleSingleLineA.tex, 12 | %. axessibilityExampleAlignT.tex, axessibilityExampleAlignA.tex 13 | % 14 | % This work may be distributed and/or modified under the 15 | % conditions of the LaTeX Project Public License, either version 1.3 16 | % of this license or (at your option) any later version. 17 | % The latest version of this license is in 18 | % http://www.latex-project.org/lppl.txt 19 | % and version 1.3 or later is part of all distributions of LaTeX 20 | % version 2005/12/01 or later. 21 | % 22 | % This work has the LPPL maintenance status `maintained'. 23 | % 24 | % The Current Maintainer of this work is 25 | % Sandro Coriasco 26 | % 27 | 28 | \documentclass[a4paper,11pt]{article} 29 | 30 | \usepackage{axessibility} 31 | 32 | \title{The golden mean} 33 | \author{} 34 | \date{} 35 | 36 | \begin{document} 37 | 38 | \maketitle 39 | 40 | \tagstructbegin{tag=P} 41 | \tagmcbegin{tag=P} 42 | The golden mean is the number 43 | \tagmcend 44 | \tagstructend 45 | \[\frac{1 + \sqrt{5}}{2},\] 46 | \tagstructbegin{tag=P} 47 | \tagmcbegin{tag=P} 48 | that is, the root larger in modulus of 49 | \tagmcend 50 | \tagstructend 51 | \begin{equation} x^2 - x - 1. \end{equation} 52 | \tagstructbegin{tag=P} 53 | \tagmcbegin{tag=P} 54 | It is usually defined as the ratio of two lengths \auxiliaryspace 55 | \tagmcend 56 | \tagstructend 57 | \(a\) 58 | \tagstructbegin{tag=P} 59 | \tagmcbegin{tag=P} 60 | and \auxiliaryspace 61 | \tagmcend 62 | \tagstructend 63 | \(b\) 64 | \tagstructbegin{tag=P} 65 | \tagmcbegin{tag=P} 66 | such that 67 | \tagmcend 68 | \tagstructend 69 | \begin{equation*} (a+b) : a = a : b. \end{equation*} 70 | \tagstructbegin{tag=P} 71 | \tagmcbegin{tag=P} 72 | Let \auxiliaryspace 73 | \tagmcend 74 | \tagstructend 75 | \(x\) 76 | \tagstructbegin{tag=P} 77 | \tagmcbegin{tag=P} 78 | be the ratio \auxiliaryspace 79 | \tagmcend 80 | \tagstructend 81 | \( \frac{a}{b} \). 82 | \tagstructbegin{tag=P} 83 | \tagmcbegin{tag=P} 84 | We have \auxiliaryspace 85 | \tagmcend 86 | \tagstructend 87 | \( \frac{a+b}{a} = 1 + \frac{1}{x} \), 88 | \tagstructbegin{tag=P} 89 | \tagmcbegin{tag=P} 90 | from which we get the equation \auxiliaryspace 91 | \tagmcend 92 | \tagstructend 93 | \(x^2 = x + 1\). 94 | 95 | \end{document} -------------------------------------------------------------------------------- /package/axessibility.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2018, 2019, 2020 by 2 | -- Anna Capietto, Sandro Coriasco, Boris Doubrov, Alexander Koslovski, 3 | -- Tiziana Armano, Nadir Murru, Dragan Ahmetovic, Cristian Bernareggi 4 | -- 5 | -- Based on accsupp and tagpdf 6 | -- 7 | -- This work consists of the main source files axessibility.dtx and axessibility.lua, 8 | -- and the derived files 9 | -- axessibility.ins, axessibility.sty, axessibility.pdf, README, 10 | -- axessibilityExampleSingleLineT.tex, axessibilityExampleSingleLineA.tex, 11 | --. axessibilityExampleAlignT.tex, axessibilityExampleAlignA.tex 12 | -- 13 | -- This work may be distributed and/or modified under the 14 | -- conditions of the LaTeX Project Public License, either version 1.3 15 | -- of this license or (at your option) any later version. 16 | -- The latest version of this license is in 17 | -- http://www.latex-project.org/lppl.txt 18 | -- and version 1.3 or later is part of all distributions of LaTeX 19 | -- version 2005/12/01 or later. 20 | -- 21 | -- This work has the LPPL maintenance status `maintained'. 22 | -- 23 | -- The Current Maintainer of this work is 24 | -- Sandro Coriasco 25 | -- 26 | 27 | 28 | local open_dls = false 29 | local open_double_dls = false 30 | 31 | --[[ The function replace_dls_and_double_dls() switches on or off automatic replacement of $$ and $. 32 | The boolean argument a (true/false) specifies if the package should do the replacements. 33 | ]] 34 | 35 | function replace_dls_and_double_dls(a) 36 | if a and not luatexbase.in_callback("process_input_buffer", "process_input_buffer") then 37 | luatexbase.add_to_callback("process_input_buffer", replace_chars_callback, "process_input_buffer") 38 | elseif not a and luatexbase.in_callback("process_input_buffer", "process_input_buffer") then 39 | luatexbase.remove_from_callback("process_input_buffer", "process_input_buffer") 40 | end 41 | end 42 | 43 | -- the callback that performs the replacement 44 | function replace_chars_callback(a) 45 | if status.input_ptr == 1 then 46 | -- variable to save comments if any 47 | local comment="" 48 | -- we delete all comments 49 | a = a:gsub("(\\*)(%%.*)", function(group1, group2) 50 | -- check,if we have even number of backslash characters 51 | if #group1 % 2 == 0 then 52 | comment=group1..group2 53 | return "" 54 | end 55 | return group1..group2 56 | end) 57 | 58 | -- We must replace empty lines by some value, eg % character 59 | if(open_double_dls or open_dls) and a == "" then 60 | return "%" 61 | end 62 | 63 | local replace_happened = false 64 | a = a:gsub("(\\*)(%$+)", function(group1, group2) 65 | -- if after \$ we have one or more $,algorithm will not do replacement,so we must be check this situation 66 | local b = "" 67 | if #group1 % 2 == 1 and #group2 >1 then 68 | b="\\$" 69 | group1 = group1:sub(2) 70 | group2 = group2:sub(2) 71 | end 72 | 73 | -- if we have even number of backslash characters in front of $$ or $, we do replacement of $$ or $ 74 | if #group1 % 2 == 0 then 75 | replace_happened = true 76 | if group2 == "$$" then 77 | group2 = open_double_dls and "\\]" or "\\[" 78 | open_double_dls = not open_double_dls 79 | elseif group2 == "$" then 80 | group2 = open_dls and "\\)" or "\\(" 81 | open_dls = not open_dls 82 | end 83 | end 84 | return group1..b..group2 85 | end) 86 | 87 | --return comments back to the line 88 | a = a..comment 89 | -- this might be useful for debug 90 | --[[ if replace_happened then 91 | texio.write_nl("the line after replacement is: "..a) 92 | end]] 93 | return a 94 | end 95 | end -------------------------------------------------------------------------------- /package/axessibility.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/integr-abile/axessibility/3e9291689235d35a767ab03d45bbd5b8684423fd/package/axessibility.pdf -------------------------------------------------------------------------------- /package/axessibility.sty: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `axessibility.sty', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% axessibility.dtx 8 | %% 9 | %% This is a generated file. 10 | %% 11 | %% Copyright (C) 2018, 2019, 2020 by 12 | %% Anna Capietto, Sandro Coriasco, Boris Doubrov, Alexander Koslovski, 13 | %% Tiziana Armano, Nadir Murru, Dragan Ahmetovic, Cristian Bernareggi 14 | %% 15 | %% Based on accsupp and tagpdf 16 | %% 17 | %% This work consists of the main source files axessibility.dtx and axessibility.lua, 18 | %% and the derived files 19 | %% axessibility.ins, axessibility.sty, axessibility.pdf, README, 20 | %% axessibilityExampleSingleLineT.tex, axessibilityExampleSingleLineA.tex, 21 | %% . axessibilityExampleAlignT.tex, axessibilityExampleAlignA.tex 22 | %% 23 | %% This work may be distributed and/or modified under the 24 | %% conditions of the LaTeX Project Public License, either version 1.3 25 | %% of this license or (at your option) any later version. 26 | %% The latest version of this license is in 27 | %% http://www.latex-project.org/lppl.txt 28 | %% and version 1.3 or later is part of all distributions of LaTeX 29 | %% version 2005/12/01 or later. 30 | %% 31 | %% This work has the LPPL maintenance status `maintained'. 32 | %% 33 | %% The Current Maintainer of this work is 34 | %% Sandro Coriasco 35 | %% 36 | 37 | 38 | 39 | 40 | \NeedsTeXFormat{LaTeX2e} 41 | \ProvidesPackage{axessibility} 42 | 43 | %% 'tagpdf' or 'accsupp' option 44 | \newif\iftagpdfopt 45 | 46 | \DeclareOption{accsupp}{ 47 | \tagpdfoptfalse 48 | } 49 | 50 | \DeclareOption{tagpdf}{ 51 | \tagpdfopttrue 52 | } 53 | 54 | \ExecuteOptions{tagpdf} 55 | 56 | \ProcessOptions\relax 57 | 58 | \RequirePackage{amsmath} 59 | \RequirePackage{amssymb} 60 | \RequirePackage{xstring} 61 | 62 | %%% 63 | %%% 64 | \makeatletter 65 | \long\def\@macronestedifalign{ 66 | \ifingather@ 67 | \restorealignstate@ 68 | \egroup 69 | \nonumber 70 | \ifnum0=`{\fi\iffalse}\fi 71 | \else 72 | $$% 73 | \fi 74 | } 75 | 76 | \long\def\@macronestedifmultline{ 77 | \iftagsleft@ \@xp\lendmultline@ \else \@xp\rendmultline@ \fi 78 | } 79 | \makeatother 80 | 81 | \iftagpdfopt 82 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 83 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 84 | % tagpdf option code (default) % 85 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 86 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 87 | 88 | 89 | \RequirePackage{tagpdf} 90 | \tagpdfsetup{tabsorder=structure,uncompress,activate-all,interwordspace=true} 91 | \tagpdfifpdftexT 92 | { 93 | %set language / can also be done with hyperref 94 | \pdfcatalog{/Lang (en-US)} 95 | \usepackage[T1]{fontenc} 96 | \input glyphtounicode 97 | \pdfgentounicode=1 98 | } 99 | \tagpdfifluatexT 100 | { 101 | %set language / can also be done with hyperref 102 | \pdfextension catalog{/Lang (en-US)} 103 | \RequirePackage{fontspec} 104 | \RequirePackage{luacode} 105 | \newfontface\zerowidthfont{freeserif} 106 | \directlua{ 107 | require("axessibility.lua") 108 | } 109 | } 110 | 111 | 112 | \makeatletter 113 | 114 | \newtoks\@mltext 115 | \newtoks\@mltexttmp 116 | 117 | 118 | 119 | \newcommand{\doreplacement}[1]{ 120 | \tagpdfifluatexT 121 | \directlua { replace_dls_and_double_dls(#1) } 122 | } 123 | 124 | 125 | \let\begin@document=\document 126 | \let\end@document=\enddocument 127 | \renewcommand{\document}{\begin@document\tagstructbegin{tag=Document}} 128 | \renewcommand{\enddocument}{\tagstructend\end@document} 129 | \makeatother 130 | 131 | 132 | \makeatletter 133 | \newenvironment{temp@env}{% 134 | \relax\ifmmode\@badmath\else$\fi% 135 | \collect@body\wrap}{% 136 | \relax\ifmmode\ifinner$\else\@badmath\fi\else \@badmath\fi} 137 | \protected\def\(#1\){\begin{temp@env}#1\end{temp@env}} 138 | \makeatother 139 | 140 | 141 | \newcommand{\auxiliaryspace}{ } 142 | 143 | 144 | \makeatletter 145 | \long\def\wrap#1{ 146 | \tagstructbegin{tag=P,alttext-o=\detokenize\expandafter{#1}, 147 | actualtext-o=\detokenize\expandafter{#1}} 148 | \tagmcbegin{tag=P,alttext-o=\detokenize\expandafter{#1}, 149 | actualtext-o=\detokenize\expandafter{#1}} 150 | #1 151 | \tagmcend 152 | \tagstructend 153 | } 154 | \makeatother 155 | 156 | 157 | \makeatletter 158 | \renewenvironment{equation}{% 159 | \incr@eqnum 160 | \mathdisplay@push 161 | \st@rredfalse \global\@eqnswtrue 162 | \mathdisplay{equation}% 163 | \collect@body\wrap\auxiliaryspace}{% 164 | \endmathdisplay{equation}% 165 | \mathdisplay@pop 166 | \ignorespacesafterend 167 | } 168 | \makeatother 169 | 170 | 171 | \makeatletter 172 | \renewenvironment{equation*}{% 173 | \mathdisplay@push 174 | \st@rredtrue \global\@eqnswfalse 175 | \mathdisplay{equation*}% 176 | \collect@body\wrap\auxiliaryspace}{% 177 | \endmathdisplay{equation*}% 178 | \mathdisplay@pop 179 | \ignorespacesafterend 180 | } 181 | \makeatother 182 | 183 | 184 | \makeatletter 185 | \protected\def\[#1\]{\begin{equation*}#1\end{equation*}} 186 | \makeatother 187 | 188 | 189 | \makeatletter 190 | 191 | \long\def\wrapml#1{ 192 | \def\@mltext{\detokenize\expandafter{#1}} 193 | \def\@mltexttmp{} 194 | \StrBehind[6]{\@mltext}{ }[\@mltexttmp] 195 | \StrGobbleRight{\@mltexttmp}{1}[\@mltext] 196 | \tagstructbegin{tag=P,alttext-o=\detokenize\expandafter{\@mltext}, 197 | actualtext-o=\detokenize\expandafter{\@mltext}} 198 | \tagmcbegin{tag=P,alttext-o=\detokenize\expandafter{\@mltext}, 199 | actualtext-o=\detokenize\expandafter{\@mltext}} 200 | #1 201 | } 202 | 203 | \long\def\wrapmlstar#1{ 204 | \def\@mltext{\detokenize\expandafter{#1}} 205 | \def\@mltexttmp{} 206 | \StrBehind[5]{\@mltext}{ }[\@mltexttmp] 207 | \StrGobbleRight{\@mltexttmp}{1}[\@mltext] 208 | \tagstructbegin{tag=P,alttext-o=\detokenize\expandafter{\@mltext}, 209 | actualtext-o=\detokenize\expandafter{\@mltext}} 210 | \tagmcbegin{tag=P,alttext-o=\detokenize\expandafter{\@mltext}, 211 | actualtext-o=\detokenize\expandafter{\@mltext}} 212 | #1 213 | } 214 | 215 | \long\def\wrapmlalt#1{ 216 | \def\@mltext{\detokenize\expandafter{#1}} 217 | \def\@mltexttmp{} 218 | \StrBehind[5]{\@mltext}{ }[\@mltexttmp] 219 | \StrGobbleRight{\@mltexttmp}{1}[\@mltext] 220 | \tagstructbegin{tag=P,alttext-o=\detokenize\expandafter{\@mltext}, 221 | actualtext-o=\detokenize\expandafter{\@mltext}} 222 | \tagmcbegin{tag=P,alttext-o=\detokenize\expandafter{\@mltext}, 223 | actualtext-o=\detokenize\expandafter{\@mltext}} 224 | #1 225 | } 226 | 227 | \makeatother 228 | 229 | 230 | \makeatletter 231 | 232 | \renewenvironment{align}{% 233 | \collect@body\wrapml\auxiliaryspace 234 | \start@align\@ne\st@rredfalse\m@ne 235 | }{% 236 | \math@cr \black@\totwidth@ 237 | \egroup 238 | \@macronestedifalign 239 | \ignorespacesafterend 240 | \tagmcend 241 | \tagstructend 242 | } 243 | 244 | \renewenvironment{align*}{% 245 | \collect@body\wrapmlstar\auxiliaryspace 246 | \start@align\@ne\st@rredtrue\m@ne 247 | }{% 248 | \endalign 249 | } 250 | 251 | \renewenvironment{alignat}{% 252 | \collect@body\wrapml\auxiliaryspace\auxiliaryspace 253 | \start@align\z@\st@rredfalse 254 | }{% 255 | \endalign 256 | } 257 | 258 | \renewenvironment{alignat*}{% 259 | \collect@body\wrapmlstar\auxiliaryspace 260 | \start@align\z@\st@rredtrue 261 | }{% 262 | \endalign 263 | } 264 | 265 | \renewenvironment{xalignat}{% 266 | \collect@body\wrapmlalt\auxiliaryspace 267 | \start@align\@ne\st@rredfalse 268 | }{% 269 | \endalign 270 | } 271 | 272 | \renewenvironment{xalignat*}{% 273 | \collect@body\wrapmlstar\auxiliaryspace 274 | \start@align\@ne\st@rredtrue 275 | }{% 276 | \endalign 277 | } 278 | 279 | \renewenvironment{xxalignat}{% 280 | \collect@body\wrapmlalt\auxiliaryspace 281 | \start@align\tw@\st@rredtrue 282 | }{% 283 | \endalign 284 | } 285 | 286 | \renewenvironment{flalign}{% 287 | \collect@body\wrapml\auxiliaryspace 288 | \start@align\tw@\st@rredfalse\m@ne 289 | }{% 290 | \endalign 291 | } 292 | 293 | \renewenvironment{flalign*}{% 294 | \collect@body\wrapmlstar\auxiliaryspace 295 | \start@align\tw@\st@rredtrue\m@ne 296 | }{% 297 | \endalign 298 | } 299 | 300 | \renewenvironment{gather}{% 301 | \collect@body\wrapmlalt\auxiliaryspace\auxiliaryspace 302 | \start@gather\st@rredfalse 303 | }{% 304 | \math@cr \black@\totwidth@ \egroup 305 | $$\ignorespacesafterend 306 | \tagmcend 307 | \tagstructend 308 | } 309 | 310 | \renewenvironment{gather*}{% 311 | \collect@body\wrapmlstar\auxiliaryspace\auxiliaryspace 312 | \start@gather\st@rredtrue 313 | }{% 314 | \endgather 315 | } 316 | 317 | \renewenvironment{multline}{% 318 | \collect@body\wrapmlalt\auxiliaryspace\auxiliaryspace 319 | \start@multline\st@rredfalse 320 | }{% 321 | \@macronestedifmultline 322 | \ignorespacesafterend 323 | \tagmcend 324 | \tagstructend 325 | } 326 | 327 | \renewenvironment{multline*}{ 328 | \collect@body\wrapmlstar\auxiliaryspace\auxiliaryspace 329 | \start@multline\st@rredtrue 330 | }{ 331 | \endmultline 332 | } 333 | 334 | \makeatother 335 | 336 | %%%% 337 | %%%% 338 | 339 | \else 340 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 341 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 342 | % accsupp option code % 343 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 344 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 345 | 346 | \RequirePackage{accsupp} 347 | 348 | 349 | \pdfcompresslevel=0 350 | \pdfoptionpdfminorversion=6 351 | \input{glyphtounicode} 352 | \pdfgentounicode=1 353 | 354 | 355 | 356 | \makeatletter 357 | 358 | \newtoks\@mltext 359 | \newtoks\@mltexttmp 360 | 361 | \makeatother 362 | 363 | 364 | \makeatletter 365 | \renewcommand*{\BeginAccSupp}[1]{% 366 | \begingroup 367 | \setkeys{ACCSUPP}{#1}% 368 | \edef\ACCSUPP@span{% 369 | /S/Span<<% 370 | \ifx\ACCSUPP@Lang\relax 371 | \else 372 | /Lang\ACCSUPP@Lang 373 | \fi 374 | \ifx\ACCSUPP@Alt\relax 375 | \else 376 | /Alt\ACCSUPP@Alt 377 | \fi 378 | \ifx\ACCSUPP@ActualText\relax 379 | \else 380 | /ActualText\ACCSUPP@ActualText 381 | \fi 382 | \ifx\ACCSUPP@E\relax 383 | \else 384 | /E\ACCSUPP@E 385 | \fi 386 | >>% 387 | }% 388 | \ACCSUPP@bdc 389 | \ACCSUPP@space 390 | \endgroup 391 | } 392 | \makeatother 393 | 394 | 395 | \newcommand{\auxiliaryspace}{ } 396 | 397 | 398 | \makeatletter 399 | \long\def\wrap#1{ 400 | \BeginAccSupp{method=escape,ActualText=\detokenize\expandafter{#1}} 401 | #1 402 | \EndAccSupp{}% 403 | } 404 | \makeatother 405 | 406 | 407 | \makeatletter 408 | \long\def\wrapml#1{ 409 | \def\@mltext{\detokenize\expandafter{#1}} 410 | \def\@mltexttmp{} 411 | \StrBehind[5]{\@mltext}{ }[\@mltexttmp] 412 | \StrGobbleRight{\@mltexttmp}{1}[\@mltext] 413 | \BeginAccSupp{method=escape,ActualText=\auxiliaryspace\@mltext} 414 | #1 415 | \EndAccSupp{}% 416 | } 417 | \makeatother 418 | 419 | 420 | \makeatletter 421 | \renewenvironment{equation}{% 422 | \incr@eqnum 423 | \mathdisplay@push 424 | \st@rredfalse \global\@eqnswtrue 425 | \mathdisplay{equation}% 426 | \collect@body\wrap\auxiliaryspace}{% 427 | \endmathdisplay{equation}% 428 | \mathdisplay@pop 429 | \ignorespacesafterend 430 | } 431 | \makeatother 432 | 433 | 434 | \makeatletter 435 | \renewenvironment{equation*}{% 436 | \mathdisplay@push 437 | \st@rredtrue \global\@eqnswfalse 438 | \mathdisplay{equation*}% 439 | \collect@body\wrap\auxiliaryspace}{% 440 | \endmathdisplay{equation*}% 441 | \mathdisplay@pop 442 | \ignorespacesafterend 443 | } 444 | \makeatother 445 | 446 | 447 | \makeatletter 448 | \protected\def\[#1\]{\begin{equation*}#1\end{equation*}} 449 | \makeatother 450 | 451 | 452 | \makeatletter 453 | \newenvironment{tempenv}{% 454 | \relax\ifmmode\@badmath\else$\fi% 455 | \collect@body\wrap}{% 456 | \relax\ifmmode\ifinner$\else\@badmath\fi\else \@badmath\fi} 457 | \protected\def\(#1\){\begin{tempenv}#1\end{tempenv}} 458 | \makeatother 459 | 460 | 461 | \makeatletter 462 | 463 | \renewenvironment{align}{% 464 | \collect@body\wrapml\auxiliaryspace 465 | \start@align\@ne\st@rredfalse\m@ne 466 | }{% 467 | \math@cr \black@\totwidth@ 468 | \egroup 469 | \@macronestedifalign 470 | \ignorespacesafterend 471 | } 472 | 473 | \renewenvironment{align*}{% 474 | \collect@body\wrapml\auxiliaryspace 475 | \start@align\@ne\st@rredtrue\m@ne 476 | }{% 477 | \endalign 478 | } 479 | 480 | \renewenvironment{alignat}{% 481 | \collect@body\wrapml\auxiliaryspace 482 | \start@align\z@\st@rredfalse 483 | }{% 484 | \endalign 485 | } 486 | \renewenvironment{alignat*}{% 487 | \collect@body\wrapml\auxiliaryspace 488 | \start@align\z@\st@rredtrue 489 | }{% 490 | \endalign 491 | } 492 | \renewenvironment{xalignat}{% 493 | \collect@body\wrapml\auxiliaryspace 494 | \start@align\@ne\st@rredfalse 495 | }{% 496 | \endalign 497 | } 498 | \renewenvironment{xalignat*}{% 499 | \collect@body\wrapml\auxiliaryspace 500 | \start@align\@ne\st@rredtrue 501 | }{% 502 | \endalign 503 | } 504 | \renewenvironment{xxalignat}{% 505 | \collect@body\wrapml\auxiliaryspace 506 | \start@align\tw@\st@rredtrue 507 | }{% 508 | \endalign 509 | } 510 | \renewenvironment{flalign}{% 511 | \collect@body\wrapml\auxiliaryspace 512 | \start@align\tw@\st@rredfalse\m@ne 513 | }{% 514 | \endalign 515 | } 516 | 517 | \renewenvironment{flalign*}{% 518 | \collect@body\wrapml\auxiliaryspace 519 | \start@align\tw@\st@rredtrue\m@ne 520 | }{% 521 | \endalign 522 | } 523 | 524 | \renewenvironment{gather}{% 525 | \collect@body\wrapml\auxiliaryspace\auxiliaryspace 526 | \start@gather\st@rredfalse 527 | }{% 528 | \math@cr \black@\totwidth@ \egroup 529 | $$\ignorespacesafterend 530 | } 531 | 532 | \renewenvironment{gather*}{% 533 | \collect@body\wrapml\auxiliaryspace\auxiliaryspace 534 | \start@gather\st@rredtrue 535 | }{% 536 | \endgather 537 | } 538 | 539 | \renewenvironment{multline}{% 540 | \collect@body\wrapml\auxiliaryspace\auxiliaryspace 541 | \start@multline\st@rredfalse 542 | }{% 543 | %\iftagsleft@ \@xp\lendmultline@ \else \@xp\rendmultline@ \fi 544 | \@macronestedifmultline 545 | \ignorespacesafterend 546 | } 547 | 548 | \renewenvironment{multline*}{ 549 | \collect@body\wrapml\auxiliaryspace\auxiliaryspace 550 | \start@multline\st@rredtrue 551 | }{ 552 | \endmultline 553 | } 554 | 555 | %%} 556 | %% 557 | \makeatother 558 | %%%% 559 | %%%% 560 | \fi 561 | 562 | \endinput 563 | %% 564 | %% End of file `axessibility.sty'. 565 | --------------------------------------------------------------------------------