Projekt

Allgemein

Profil

Accessibiliy Features » Historie » Version 17

Patrick Schulz, 10.10.2024 12:42

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
The colour spaces of embedded images must match the Output Indent of the PDF file for the latter to be PDF/A2-a compatible. By default, CoCoTeX puts CMYK as output intent, but this can be overridden with the @color-env@ class option.
149
<pre><code class="latex">\documentclass[…,color-env=<space>,…]{cocotex}</code></pre>with @<space>@ either @srgb@, @rgb@, @gray@, @cmy@, @cmyk@ (default when @a11y@), @natural@ (no automatic conversion of custom colours, see below), or @none@ (@xcolor@ package is **not** loaded).
150
151
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}
152
\definecolor{myblue}{RGB}{53,39,255}
153
\definecolor{myblue}{rgb}{0.21,0.15,1}
154
\definecolor{myblue}{cmyk}{0.79,0.85,0,0}</code></pre>