Projekt

Allgemein

Profil

Accessibiliy Features » Historie » Version 22

Patrick Schulz, 21.11.2024 09:32

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