Projekt

Allgemein

Profil

Accessibiliy Features » Historie » Version 19

Patrick Schulz, 10.10.2024 13:19

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