Projekt

Allgemein

Profil

Accessibiliy Features » Historie » Version 23

Patrick Schulz, 21.11.2024 09:34

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
<pre><code>
9
\documentclass[…,a11y]{cocotex}
10
</code></pre>
11 23 Patrick Schulz
For PDF 2.0 use @a11y20@, instead.
12 5 Patrick Schulz
13 21 Maren Pufe
h2. Artifact tagging
14
15
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:
16
17
<pre><code class="tex">
18
\ccaStructStart{Artifact}Linie\ccaStructEnd{Artifact}
19
</code></pre>
20
21
* there exists also an environment that is not yet thoroughly tested:
22
23
<pre><code class="tex">
24
\begin{ccaArtifact}…\end{ccaArtifact}
25
</code></pre>
26
27
* consider tagging *decorational images*
28
* *writing lines* (if not tagged as forms)
29
* tbc
30
31 6 Patrick Schulz
h2. Paragraph tagging
32 1 Patrick Schulz
33 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@!):
34 6 Patrick Schulz
<pre>
35 22 Patrick Schulz
\ccaVstructStart{P}Ipsum Lorem … finis.\ccaVstructEnd{P}
36 6 Patrick Schulz
</pre>
37
38 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.
39 6 Patrick Schulz
40 7 Patrick Schulz
h2. Alternative Texts
41
42 8 Patrick Schulz
Figures and Math both need alternative texts.
43 7 Patrick Schulz
44
h4. Figures
45
46
For figures, there are two ways to encode alt-text: the @alt@ Parameter in the optional argument of @\includegraphics@ (needs texlive > 2021), e.g.
47
<pre>\incudegraphics[...,alt={This is what the image file shows}]{image.png}</pre>
48
or as @\tpAltText@ inside the @tpFigure@ or @tpSubFloat@ environments:
49
<pre>\begin{tpFigure}
50
  \tpCaption{This is the caption}
51
  \tpAltText{This is the alt text. It MUST NOT be the same as the caption!}
52
  \tpFig{\includegraphics{image.png}}
53 10 Patrick Schulz
\end{tpFigure}</pre>If both exist, the @alt@ in @\includegraphics@ takes precedence over the @\tpAltText@.
54 7 Patrick Schulz
55
h4. Math
56
57
both inline and display style math needs alternative texts. This is done with the @\ccaAddAltText@ macro:
58
<pre>
59
\begin{equation*}\ccaAddAltText{Z equals x minus mu divided by sigma}%
60
  \mathbf{Z}=\,\frac{\boldsymbol{x}-\mathbf{\mu }}{\mathbf{\sigma }}
61
\end{equation*}
62
</pre>
63
or, for inline math:
64
<pre>The Variable $x\addAltText{x}$ means...</pre>
65
66 1 Patrick Schulz
h2. XMP Meta Data
67 11 Patrick Schulz
68
* ***"Template.xmp":https://redmine.le-tex.de/attachments/27865***
69 1 Patrick Schulz
70 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.
71 1 Patrick Schulz
72 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!***
73 1 Patrick Schulz
74
Also be cautious where to use @rdf:Bag@, @rdf:Alt@ and @rdf:Seq@!
75
76
Use the following XML tags for meta data:
77
78
79 4 Patrick Schulz
h4. Author
80 1 Patrick Schulz
81
is a list of the document's main authors or edtiors, one per line:
82
<pre><code class="xml">
83
<dc:creator>
84
  <rdf:Seq>
85
    <rdf:li>Firstname Lastname</rdf:li>
86
    <rdf:li>Firstname Lastname</rdf:li>
87
    ...
88
  </rdf:Seq>
89
</dc:creator>
90
</code></pre>
91
92 4 Patrick Schulz
h4. Document Title
93 1 Patrick Schulz
94
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
95
96
<pre><code class="xml">
97
<dc:title>
98
  <rdf:Alt>
99
    <rdf:li xml:lang="x-default">Default title</rdf:li>
100
  </rdf:Alt>
101
</dc:title>
102
</code></pre>
103
104 4 Patrick Schulz
h4. Publisher
105 1 Patrick Schulz
106
<pre><code class="xml">
107
<dc:publisher>
108
  <rdf:Bag>
109
    <rdf:li>Publisher Name</rdf:li>
110
  </rdf:Bag>
111
</dc:publisher>
112
</code></pre>
113
114 4 Patrick Schulz
h4. Chapter authors/Contributors
115 1 Patrick Schulz
116
<pre><code class="xml">
117
<dc:contributor>
118
  <rdf:Bag>
119
    <rdf:li>Firstname Lastname</rdf:li>
120
    <rdf:li>Firstname Midname Lastname</rdf:li>
121
    ...
122
  </rdf:Bag>
123
</dc:contributor>
124
</code></pre>
125
126 4 Patrick Schulz
h4. Abstract
127 1 Patrick Schulz
128
Like @dc:title@, @dc:description@ allows multiple entries for different languages.
129
130
<pre><code class="xml">
131
<dc:description>
132
  <rdf:Alt>
133
    <rdf:li xml:lang="x-default">...</rdf:li>
134
  </rdf:Alt>
135
</dc:description>
136
</code></pre>
137
138 4 Patrick Schulz
h4. Keywords
139 1 Patrick Schulz
140
<pre><code class="xml">
141
<dc:subject>
142
  <rdf:Bag>
143
    <rdf:li>keyword 1</rdf:li>
144
    <rdf:li>keyword 2</rdf:li>
145
    ....
146
  </rdf:Bag>
147
</dc:subject>
148
</code></pre>
149
150
151 4 Patrick Schulz
h4. Copyright
152 1 Patrick Schulz
153
<pre><code class="xml">
154
<dc:rights>
155
  <rdf:Alt>
156
    <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>
157
  </rdf:Alt>
158
</dc:rights>
159
</code></pre>
160 4 Patrick Schulz
161
h4. Other
162
163
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.
164
165
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.
166 17 Patrick Schulz
167
h2. Colours and Embedded Images
168
169 18 Patrick Schulz
h3. Output Intent and Embedded ICC Colour Profiles
170
171
By default, CoCoTeX puts **CMYK** as output intent, but this can be overridden with the @color-env@ class option:
172
<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:
173
174
|_. @<space>@ |_. icc profile|
175
| @srgb@, @rgb@ |  IEC 61966-2.1 Default RGB colour space - sRGB |
176
| @cmy@, @cmyk@ | Coated FOGRA39 |
177
| @grey@, @gray@ | ISO Coated v2 - GREY 1c - (basICColor) |
178
| @natural@, @none@ | (gray) |
179
180
Publisher-wide colour profile can be set with the @profile@ Property of the @titlepage@ Container:<pre><code class="latex">\ccAddToType{Properties}{titlepage}{%
181
    \ccSetProperty{output-intent}{%
182
      profile=<path to .icc file>;%
183
      components=<number of colour components>;%
184
      identifier=<name of colour profile>%
185
  }}</code></pre>with the following values:
186
* @<path to .icc file>@ is the path to the icc colour profile relative to the .tex file, including the file extension.
187
* @<number of colour components>@ is the number of colour components, e.g., @3@ for RGB, @4@ for CMYK, etc.
188
* @<name of colour profile>@ is the name of the colour profile (default values correspond to the right column in above's table)
189
190
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}
191
192
  \tpIccProfileFile{<path to .icc file>}
193
  \tpIccComponents{<number of colour components>}
194
  \tpIccIdentifier{<name of colour profile>}
195
196
\end{tpMeta}</code></pre>
197
198
h3. Image files
199 1 Patrick Schulz
200 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. 
201 18 Patrick Schulz
202
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
203
* @<input>@ the path to the input image
204
* @<color_space>@ the color space the image should be converted to (cmyk, rgb, etc)
205
* @<path_to_icc>@ the path to the icc profile that gets embedded into the image
206
* @<output>@ the name of the output image
207
208
h3. Custom Text Colours
209 17 Patrick Schulz
210
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}
211
\definecolor{myblue}{RGB}{53,39,255}
212
\definecolor{myblue}{rgb}{0.21,0.15,1}
213
\definecolor{myblue}{cmyk}{0.79,0.85,0,0}</code></pre>