Projekt

Allgemein

Profil

Accessibiliy Features » Historie » Version 20

Patrick Schulz, 10.10.2024 13:24

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