-
Notifications
You must be signed in to change notification settings - Fork 1
/
coco-accessibility.sty
85 lines (85 loc) · 3.08 KB
/
coco-accessibility.sty
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
%%
%% This is file `coco-accessibility.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% cocotex.dtx (with options: `a11y-sty')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from coco-accessibility.sty.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file cocotex.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%% Accessibility features for \textit{xerif} projects.
%%
%% Maintainer: [email protected]
%%
%% lualatex - texlive > 2018
%%
\NeedsTeXFormat{LaTeX2e}[2018/12/01]
\ProvidesPackage{coco-accessibility}
[2024/01/29 0.4.0 CoCoTeX accessibility module]
\def\tp@if@ally{\expandafter\@firstoftwo}
\RequirePackage[pdftex,pdflang=De]{ltpdfa}%,nodetree,dospaces,doparas,,debug
\hypersetup{linktoc=none}
\RequirePackage{coco-title}%
\directlua{ally = require('coco-accessibility')}
\def\tp@title@insert@xmp{%
\edef\tp@xmp@file@name{\tpUseGComp{titlepage}{XmpFile}.xmp}%
\IfFileExists{\tp@xmp@file@name}
{\addToConfig{metadata}{xmpfile=\tp@xmp@file@name}%
\directlua{ally.meta.extract()}}
{\tpPackageWarning{A11y}{File}{%
\tp@xmp@file@name\space not found.^^J
Note that the ltpdfa package will create one^^J
from the Components given in the tpMeta Container.}}}
\tpAddToType{Components}{titlepage}{%
\tpDeclareGComp{IccProfileFile}
\tpDeclareGComp{IccComponents}
\tpDeclareGComp{IccIdentifier}}
\tpAddToType{Properties}{titlepage}{%
\tpSetProperty{output-intent}{%
profile=\tpIfComp{IccProfileFile}{\tpUseComp{IccProfileFile}}{suppl/\tp@[email protected]};%
components=\tpIfComp{IccComponents}{\tpUseComp{IccComponents}}{\ifdefstring\tp@color@enc{cmyk}{4}{3}};%
identifier=\tpIfComp{IccIdentifier}{\tpUseComp{IccIdentifier}}{\ifdefstring\tp@color@enc{cmyk}{Coated FOGRA39}{sRGB IEC61966-2.1}}%
}}
\tpAddToHook[titlepage]{document-meta-hook}{\edef\x{\noexpand\addToConfig{intent}{\tpUseProperty{output-intent}}}\x}
\protected\def\pdfglyphtounicode{\pdfextension glyphtounicode}
\input glyphtounicode
\edef\pdfgentounicode{\pdfvariable gentounicode}
\pdfgentounicode = 1
\tpAddToType{Components}{titlepage}{%
\tpDeclareGComp[2]{PDFAID}%
\tpDeclareGComp[A]{PDFALevel}%
\tpDeclareGComp[1]{PDFUAID}}%
\tpAddToHook[titlepage]{document-meta-hook}{%
\tpIfCompEmpty{PDFAID}{}{\tpIfCompEmpty{PDFALevel}{}{%
\edef\x{\noexpand\setDocInfo{conformance}{%
pdfaid=\tpUseComp{PDFAID};%
level=\tpUseComp{PDFALevel}%
\tpIfCompEmpty{PDFUAID}{}{;pdfuaid=\tpUseComp{PDFUAID}}}}%
\x}}}
\AtBeginShipout{\directlua{ltpdfa.pageprocessor(tex.box["AtBeginShipoutBox"])}}%
\tpIfAlly{%
\ltOmitEnv{tpMeta}
\ltOmitEnv{tpAuthor}
\ltOmitEnv{tpEditor}
\ltOmitEnv{tpSeriesEditor}
\ltOmitEnv{tpAffil}
\ltOmitEnv{tpFunding}
\ltOmitEnv{heading}
}{}
\endinput
%%
%% End of file `coco-accessibility.sty'.