Projekt

Allgemein

Profil

Accessibiliy Features » Historie » Version 27

Robert Hecht, 10.12.2024 14:29

1 1 Patrick Schulz
h1. Accessibiliy Features
2
3 20 Patrick Schulz
{{>toc}}
4
5 5 Patrick Schulz
h2. Activate Accessibility Features
6
7
Add @a11y@ to the documentclass options:
8 25 Robert Hecht
<pre><code>\documentclass[…,a11y]{cocotex}
9 1 Patrick Schulz
</code></pre>
10
For PDF 2.0 use @a11y20@, instead.
11 25 Robert Hecht
12
h2. Set main language
13
14 27 Robert Hecht
Add @lang-id=XXX@ to the documentclass options following "ISO 639-2":https://de.wikipedia.org/wiki/Liste_der_ISO-639-2-Codes, e.g. for German:
15 25 Robert Hecht
<pre><code>\documentclass[…,lang-id=deu]{cocotex}
16
</code></pre>
17 5 Patrick Schulz
18 21 Maren Pufe
h2. Artifact tagging
19
20
Images and other contents that fulfill decorational purposes only must be tagged as artifacts to be ignored by reading software. This can be achieved as follows:
21
22
<pre><code class="tex">
23
\ccaStructStart{Artifact}Linie\ccaStructEnd{Artifact}
24
</code></pre>
25
26
* there exists also an environment that is not yet thoroughly tested:
27
28
<pre><code class="tex">
29
\begin{ccaArtifact}…\end{ccaArtifact}
30
</code></pre>
31
32
* consider tagging *decorational images*
33
* *writing lines* (if not tagged as forms)
34
* tbc
35
36 6 Patrick Schulz
h2. Paragraph tagging
37 1 Patrick Schulz
38 22 Patrick Schulz
Until further notice, text paragraphs need to be tagged by the converter by adding @\ccaVstructStart{P}@ at the beginning of each paragraph (no whitespaces between the macro and subsequent text or other macros!) and @\ccaVstructEnd{P}@ at the end of each paragraph (no whitespaces before @\ccaVstructEnd@!):
39 6 Patrick Schulz
<pre>
40 22 Patrick Schulz
\ccaVstructStart{P}Ipsum Lorem … finis.\ccaVstructEnd{P}
41 6 Patrick Schulz
</pre>
42
43 14 Maren Pufe
This must also be done in broader contexts that may(!) contain multiple paragraphs of plain text, like footnotes, captions, list items, quotations, table cells or abstracts. Which ones exactly varies from publisher style to publisher style, so if in doubt, ask your friendly neighborhood TeX developer.
44 6 Patrick Schulz
45 7 Patrick Schulz
h2. Alternative Texts
46
47 8 Patrick Schulz
Figures and Math both need alternative texts.
48 7 Patrick Schulz
49
h4. Figures
50
51
For figures, there are two ways to encode alt-text: the @alt@ Parameter in the optional argument of @\includegraphics@ (needs texlive > 2021), e.g.
52
<pre>\incudegraphics[...,alt={This is what the image file shows}]{image.png}</pre>
53
or as @\tpAltText@ inside the @tpFigure@ or @tpSubFloat@ environments:
54
<pre>\begin{tpFigure}
55
  \tpCaption{This is the caption}
56
  \tpAltText{This is the alt text. It MUST NOT be the same as the caption!}
57
  \tpFig{\includegraphics{image.png}}
58 10 Patrick Schulz
\end{tpFigure}</pre>If both exist, the @alt@ in @\includegraphics@ takes precedence over the @\tpAltText@.
59 7 Patrick Schulz
60
h4. Math
61
62
both inline and display style math needs alternative texts. This is done with the @\ccaAddAltText@ macro:
63
<pre>
64
\begin{equation*}\ccaAddAltText{Z equals x minus mu divided by sigma}%
65
  \mathbf{Z}=\,\frac{\boldsymbol{x}-\mathbf{\mu }}{\mathbf{\sigma }}
66
\end{equation*}
67
</pre>
68
or, for inline math:
69
<pre>The Variable $x\addAltText{x}$ means...</pre>
70
71 1 Patrick Schulz
h2. XMP Meta Data
72 11 Patrick Schulz
73
* ***"Template.xmp":https://redmine.le-tex.de/attachments/27865***
74 1 Patrick Schulz
75 3 Patrick Schulz
PDF/UA requires meta data to be embedded into the PDF file. CoCoTeX provides two ways to do that: If the TeX run does not find a xmp file that has the same basename as the .tex document, it generates one from the data in the tpMeta environment. If there is a .xmp file (either because it was there from the beginning, or it was generated during a previous tex run), it includes that one. If the xmp file is to be generated by the converter, make sure to use the "attached template.xmp":https://redmine.le-tex.de/attachments/27865 (see below) and include the document specific meta data in line 24 instead of the comment.
76 1 Patrick Schulz
77 12 Patrick Schulz
***Important: Don't remove anything in that template, especially not the PIs at the beginning and end, and the blank spaces at the bottom of the template!***
78 1 Patrick Schulz
79
Also be cautious where to use @rdf:Bag@, @rdf:Alt@ and @rdf:Seq@!
80
81
Use the following XML tags for meta data:
82
83
84 4 Patrick Schulz
h4. Author
85 1 Patrick Schulz
86
is a list of the document's main authors or edtiors, one per line:
87
<pre><code class="xml">
88
<dc:creator>
89
  <rdf:Seq>
90
    <rdf:li>Firstname Lastname</rdf:li>
91
    <rdf:li>Firstname Lastname</rdf:li>
92
    ...
93
  </rdf:Seq>
94
</dc:creator>
95
</code></pre>
96
97 4 Patrick Schulz
h4. Document Title
98 1 Patrick Schulz
99
There can be more than one document title for various languages. The displayed title (e.g. in the pdf viewer window's top line) depends on the selected system language
100
101
<pre><code class="xml">
102
<dc:title>
103
  <rdf:Alt>
104
    <rdf:li xml:lang="x-default">Default title</rdf:li>
105
  </rdf:Alt>
106
</dc:title>
107
</code></pre>
108
109 4 Patrick Schulz
h4. Publisher
110 1 Patrick Schulz
111
<pre><code class="xml">
112
<dc:publisher>
113
  <rdf:Bag>
114
    <rdf:li>Publisher Name</rdf:li>
115
  </rdf:Bag>
116
</dc:publisher>
117
</code></pre>
118
119 4 Patrick Schulz
h4. Chapter authors/Contributors
120 1 Patrick Schulz
121
<pre><code class="xml">
122
<dc:contributor>
123
  <rdf:Bag>
124
    <rdf:li>Firstname Lastname</rdf:li>
125
    <rdf:li>Firstname Midname Lastname</rdf:li>
126
    ...
127
  </rdf:Bag>
128
</dc:contributor>
129
</code></pre>
130
131 4 Patrick Schulz
h4. Abstract
132 1 Patrick Schulz
133
Like @dc:title@, @dc:description@ allows multiple entries for different languages.
134
135
<pre><code class="xml">
136
<dc:description>
137
  <rdf:Alt>
138
    <rdf:li xml:lang="x-default">...</rdf:li>
139
  </rdf:Alt>
140
</dc:description>
141
</code></pre>
142
143 4 Patrick Schulz
h4. Keywords
144 1 Patrick Schulz
145
<pre><code class="xml">
146
<dc:subject>
147
  <rdf:Bag>
148
    <rdf:li>keyword 1</rdf:li>
149
    <rdf:li>keyword 2</rdf:li>
150
    ....
151
  </rdf:Bag>
152
</dc:subject>
153
</code></pre>
154
155
156 4 Patrick Schulz
h4. Copyright
157 1 Patrick Schulz
158
<pre><code class="xml">
159
<dc:rights>
160
  <rdf:Alt>
161
    <rdf:li xml:lang="x-default">Unless otherwise indicated, this work is licensed under a Creative Commons License Attribution 4.0 International. This does not apply to quoted content and works based on other permissions.</rdf:li>
162
  </rdf:Alt>
163
</dc:rights>
164
</code></pre>
165 4 Patrick Schulz
166
h4. Other
167
168
If you must, you can _alter_ the values of @<pdf:Producer>@ and @<xmp:CreatorTool>@, where @pdf:Producer@ is the tool that generated the PDF, and @xmp:CreatorTool@ is the Tool with which the original manuscript was created prior to any conversions or transformations.
169
170
The values of @xmp:ModifyDate@ and @xmp:CreateDate@ are generated and overwritten during the tex run by the ltpdfa package, so you can leave those fields as they are.
171 17 Patrick Schulz
172
h2. Colours and Embedded Images
173
174 18 Patrick Schulz
h3. Output Intent and Embedded ICC Colour Profiles
175
176
By default, CoCoTeX puts **CMYK** as output intent, but this can be overridden with the @color-env@ class option:
177
<pre><code class="latex">\documentclass[…,color-env=<space>,…]{cocotex}</code></pre>The Value @<space>@ should be one of the values in the left column of the following table:
178
179
|_. @<space>@ |_. icc profile|
180
| @srgb@, @rgb@ |  IEC 61966-2.1 Default RGB colour space - sRGB |
181
| @cmy@, @cmyk@ | Coated FOGRA39 |
182
| @grey@, @gray@ | ISO Coated v2 - GREY 1c - (basICColor) |
183
| @natural@, @none@ | (gray) |
184
185
Publisher-wide colour profile can be set with the @profile@ Property of the @titlepage@ Container:<pre><code class="latex">\ccAddToType{Properties}{titlepage}{%
186
    \ccSetProperty{output-intent}{%
187
      profile=<path to .icc file>;%
188
      components=<number of colour components>;%
189
      identifier=<name of colour profile>%
190
  }}</code></pre>with the following values:
191
* @<path to .icc file>@ is the path to the icc colour profile relative to the .tex file, including the file extension.
192
* @<number of colour components>@ is the number of colour components, e.g., @3@ for RGB, @4@ for CMYK, etc.
193
* @<name of colour profile>@ is the name of the colour profile (default values correspond to the right column in above's table)
194
195
A custom .icc profile valid only for the current document can be embedded with the following Components inside the @tpMeta@ environment:<pre><code class="latex">\begin{tpMeta}
196
197
  \tpIccProfileFile{<path to .icc file>}
198
  \tpIccComponents{<number of colour components>}
199
  \tpIccIdentifier{<name of colour profile>}
200
201
\end{tpMeta}</code></pre>
202
203
h3. Image files
204 1 Patrick Schulz
205 19 Patrick Schulz
The colour spaces of embedded images **must match the Output Indent of the PDF file** for the latter to be PDF/A2-a compatible. 
206 18 Patrick Schulz
207
A quick-and-dirty conversion can be done with imagemagick:<pre><code class="bash">magick <input>  -colorspace <color_space> -profile <path_to_icc> <output></code></pre>with
208
* @<input>@ the path to the input image
209
* @<color_space>@ the color space the image should be converted to (cmyk, rgb, etc)
210
* @<path_to_icc>@ the path to the icc profile that gets embedded into the image
211
* @<output>@ the name of the output image
212
213
h3. Custom Text Colours
214 17 Patrick Schulz
215
Custom document colours get automatically converted to the Output Intent color space by LaTeX, so they may be defined with any color model. The following colour definitions are roughly equivalent:<pre><code class="latex">\definecolor{myblue}{HTML}{3527FF}
216
\definecolor{myblue}{RGB}{53,39,255}
217
\definecolor{myblue}{rgb}{0.21,0.15,1}
218
\definecolor{myblue}{cmyk}{0.79,0.85,0,0}</code></pre>
219 24 Marcus Hottenroth
220
h2. Checking PDF/UA compliance on Linux
221
222
The main tool for validating the PDF/UA compliance of documents is the "PDF Accessibility Checker (PAC)":https://support.axes4.com/hc/de/articles/7371921627794-PDF-Accessibility-Checker-PAC-2024. Using it on Windows is rather straightforward but requires a few more steps to make it run on Linux. The following procedure has been tested successfully with Wine 7.0 and should work with later versions quite as well.
223
224
# Install <code>wine</code> and <code>winetricks</code> via your package manager. Ensure that it is at least Wine version 7.0.
225
# It is recommended to use a separate Wine prefix (i.e. a separate environment with its own configuration and installed Windows components/packages). To do so, issue <code>WINEPREFIX=~/.wine-pac wineboot --init</code>. The path <code>~/.wine_pac</code> is an example and may be replaced with a path to your liking.
226
# Install all fonts available for Wine (<code>corefonts</code> package won’t suffice) as well as .NET 4.8 by issuing <code>WINEPREFIX=~/.wine-pac winetricks --force dotnet48 allfonts</code>. The <code>--force</code> option is required, because <code>winetricks</code> will otherwise quit the installation with a warning, stating that the .NET 4.8 package may be broken since Wine release 5.0.
227
# After the installation routines of the aforementioned Windows software via Wine, you should now be able to run PAC via <code>WINEPREFIX=~/.wine-pac wine "/Path/to/your/PAC_directory/PAC.exe".