summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/axessibility/axessibility.sty
blob: 6c13a24eb5550ad2987c2b1fa4e20712e93efed0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
%%
%% This is file `axessibility.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% axessibility.dtx 
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2018  by
%% Anna Capietto, Sandro Coriasco, Tiziana Armano,
%% Nadir Murru, Alice Ruighi, Eugenia Taranto,
%% Dragan Ahmetovic, Cristian Bernareggi, Michele Berra.
%% 
%% This work consists of the main source file axessibility.dtx
%% and the derived files
%%    axessibility.ins, axessibility.sty, axessibility.pdf, README,
%%    axessibilityExampleGoldenMean.tex
%% 
%% The Current Maintainer of this work is
%%                Sandro Coriasco
%% 
%% This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 License
%% http://creativecommons.org/licenses/by-nc/4.0/
%% 


\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{axessibility}
\RequirePackage{accsupp}
\RequirePackage{amsmath}
\RequirePackage{amssymb}
\pdfcompresslevel=0
\pdfoptionpdfminorversion=6
\input{glyphtounicode}
\pdfgentounicode=1


\makeatletter
\renewcommand*{\BeginAccSupp}[1]{%
  \begingroup
    \setkeys{ACCSUPP}{#1}%
    \edef\ACCSUPP@span{%
      /S/Span<<%
        \ifx\ACCSUPP@Lang\relax
        \else
          /Lang\ACCSUPP@Lang
        \fi
        \ifx\ACCSUPP@Alt\relax
        \else
          /Alt\ACCSUPP@Alt
        \fi
        \ifx\ACCSUPP@ActualText\relax
        \else
          /ActualText\ACCSUPP@ActualText
        \fi
        \ifx\ACCSUPP@E\relax
        \else
          /E\ACCSUPP@E
        \fi
      >>%
    }%
    \ACCSUPP@bdc
    \ACCSUPP@space
  \endgroup
}
\makeatother


\newcommand{\auxiliaryspace}{ }


\makeatletter
\long\def\wrap#1{
\BeginAccSupp{method=escape,ActualText=\detokenize\expandafter{#1}}
 #1
\EndAccSupp{}%
}
\makeatother


\makeatletter
\renewenvironment{equation}{%
 \incr@eqnum
  \mathdisplay@push
  \st@rredfalse \global\@eqnswtrue
 \mathdisplay{equation}%
  \collect@body\wrap\auxiliaryspace}{%
  \endmathdisplay{equation}%
  \mathdisplay@pop
  \ignorespacesafterend
}
\makeatother


\makeatletter
\renewenvironment{equation*}{%
  \mathdisplay@push
  \st@rredtrue \global\@eqnswfalse
  \mathdisplay{equation*}%
  \collect@body\wrap\auxiliaryspace}{%
  \endmathdisplay{equation*}%
  \mathdisplay@pop
  \ignorespacesafterend
}
\makeatother


\makeatletter
\protected\def\[#1\]{\begin{equation*}#1\end{equation*}}
\makeatother

\makeatletter
\newenvironment{tempenv}{%
  \relax\ifmmode\@badmath\else$\fi%
 \collect@body\wrap}{%
  \relax\ifmmode\ifinner$\else\@badmath\fi\else \@badmath\fi}
\protected\def\(#1\){\begin{tempenv}#1\end{tempenv}}
\makeatother


\endinput
%%
%% End of file `axessibility.sty'.