Projekt

Allgemein

Profil

Accessibiliy Features » Historie » Version 33

Maren Pufe, 30.04.2025 07:48

1 1 Patrick Schulz
h1. Accessibiliy Features
2
3 20 Patrick Schulz
{{>toc}}
4
5 5 Patrick Schulz
h2. Activate Accessibility Features
6
7 28 Patrick Schulz
Add @a11y@ to the @\documentclass@ options:
8 25 Robert Hecht
<pre><code>\documentclass[…,a11y]{cocotex}
9 1 Patrick Schulz
</code></pre>
10
For PDF 2.0 use @a11y20@, instead.
11 28 Patrick Schulz
12
Make sure that the "env.sh":https://github.com/transpect/xerif-latex/blob/main/env.sh (part of the "xerif-latex":https://github.com/transpect/xerif-latex/tree/main repo) is sourced or that the Makefile includes the parameters defined this script. This is necessary so TeX finds the lua files from the @ltpdfa@ package.
13 25 Robert Hecht
14
h2. Set main language
15
16 27 Robert Hecht
Add @lang-id=XXX@ to the documentclass options following "ISO 639-2":https://de.wikipedia.org/wiki/Liste_der_ISO-639-2-Codes, e.g. for German:
17 25 Robert Hecht
<pre><code>\documentclass[…,lang-id=deu]{cocotex}
18
</code></pre>
19 5 Patrick Schulz
20 21 Maren Pufe
h2. Artifact tagging
21
22
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:
23
24
<pre><code class="tex">
25
\ccaStructStart{Artifact}Linie\ccaStructEnd{Artifact}
26
</code></pre>
27
28
* there exists also an environment that is not yet thoroughly tested:
29
30
<pre><code class="tex">
31
\begin{ccaArtifact}…\end{ccaArtifact}
32
</code></pre>
33
34
* consider tagging *decorational images*
35
* *writing lines* (if not tagged as forms)
36
* tbc
37
38 6 Patrick Schulz
h2. Paragraph tagging
39 1 Patrick Schulz
40 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@!):
41 6 Patrick Schulz
<pre>
42 22 Patrick Schulz
\ccaVstructStart{P}Ipsum Lorem … finis.\ccaVstructEnd{P}
43 6 Patrick Schulz
</pre>
44
45 31 Maren Pufe
This must also be done in broader contexts that may(!) contain multiple paragraphs of plain text, like 
46
* footnotes, 
47
* captions, 
48
* bibliographic references, 
49
* list items, 
50
* quotations, 
51
* table cells or 
52
* abstracts. Which ones exactly varies from publisher style to publisher style, so if in doubt, ask your friendly neighborhood TeX developer.
53 6 Patrick Schulz
54 7 Patrick Schulz
h2. Alternative Texts
55
56 8 Patrick Schulz
Figures and Math both need alternative texts.
57 7 Patrick Schulz
58
h4. Figures
59
60
For figures, there are two ways to encode alt-text: the @alt@ Parameter in the optional argument of @\includegraphics@ (needs texlive > 2021), e.g.
61
<pre>\incudegraphics[...,alt={This is what the image file shows}]{image.png}</pre>
62
or as @\tpAltText@ inside the @tpFigure@ or @tpSubFloat@ environments:
63
<pre>\begin{tpFigure}
64
  \tpCaption{This is the caption}
65
  \tpAltText{This is the alt text. It MUST NOT be the same as the caption!}
66
  \tpFig{\includegraphics{image.png}}
67 10 Patrick Schulz
\end{tpFigure}</pre>If both exist, the @alt@ in @\includegraphics@ takes precedence over the @\tpAltText@.
68 7 Patrick Schulz
69
h4. Math
70
71
both inline and display style math needs alternative texts. This is done with the @\ccaAddAltText@ macro:
72 33 Maren Pufe
<pre><code class="tex">
73 7 Patrick Schulz
\begin{equation*}\ccaAddAltText{Z equals x minus mu divided by sigma}%
74
  \mathbf{Z}=\,\frac{\boldsymbol{x}-\mathbf{\mu }}{\mathbf{\sigma }}
75 1 Patrick Schulz
\end{equation*}
76 33 Maren Pufe
</code></pre>
77
78 7 Patrick Schulz
or, for inline math:
79 33 Maren Pufe
<pre><code class="tex">The Variable  \ccaStructStart{Formula}$x\addAltText{x}$\ccaStructEnd{Formula} means...</code></pre>
80 1 Patrick Schulz
81 32 Maren Pufe
or
82
83 33 Maren Pufe
<pre><code class="tex">The Variable\(x\ccaAddAltText{alternative text}\).</code></pre>
84 32 Maren Pufe
85 33 Maren Pufe
(in \(...)\ tagging is already included).
86 32 Maren Pufe
87 1 Patrick Schulz
h2. XMP Meta Data
88 11 Patrick Schulz
89 30 Patrick Schulz
_(see [[XMP Meta Data]])_
90 17 Patrick Schulz
91
h2. Colours and Embedded Images
92
93 18 Patrick Schulz
h3. Output Intent and Embedded ICC Colour Profiles
94
95
By default, CoCoTeX puts **CMYK** as output intent, but this can be overridden with the @color-env@ class option:
96
<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:
97
98
|_. @<space>@ |_. icc profile|
99
| @srgb@, @rgb@ |  IEC 61966-2.1 Default RGB colour space - sRGB |
100
| @cmy@, @cmyk@ | Coated FOGRA39 |
101
| @grey@, @gray@ | ISO Coated v2 - GREY 1c - (basICColor) |
102
| @natural@, @none@ | (gray) |
103
104
Publisher-wide colour profile can be set with the @profile@ Property of the @titlepage@ Container:<pre><code class="latex">\ccAddToType{Properties}{titlepage}{%
105
    \ccSetProperty{output-intent}{%
106
      profile=<path to .icc file>;%
107
      components=<number of colour components>;%
108
      identifier=<name of colour profile>%
109
  }}</code></pre>with the following values:
110
* @<path to .icc file>@ is the path to the icc colour profile relative to the .tex file, including the file extension.
111
* @<number of colour components>@ is the number of colour components, e.g., @3@ for RGB, @4@ for CMYK, etc.
112
* @<name of colour profile>@ is the name of the colour profile (default values correspond to the right column in above's table)
113
114
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}
115
116
  \tpIccProfileFile{<path to .icc file>}
117
  \tpIccComponents{<number of colour components>}
118
  \tpIccIdentifier{<name of colour profile>}
119
120
\end{tpMeta}</code></pre>
121
122
h3. Image files
123 1 Patrick Schulz
124 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. 
125 18 Patrick Schulz
126
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
127
* @<input>@ the path to the input image
128
* @<color_space>@ the color space the image should be converted to (cmyk, rgb, etc)
129
* @<path_to_icc>@ the path to the icc profile that gets embedded into the image
130
* @<output>@ the name of the output image
131
132
h3. Custom Text Colours
133 17 Patrick Schulz
134
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}
135
\definecolor{myblue}{RGB}{53,39,255}
136
\definecolor{myblue}{rgb}{0.21,0.15,1}
137
\definecolor{myblue}{cmyk}{0.79,0.85,0,0}</code></pre>
138 24 Marcus Hottenroth
139
h2. Checking PDF/UA compliance on Linux
140
141
The main tool for validating the PDF/UA compliance of documents is the "PDF Accessibility Checker (PAC)":https://support.axes4.com/hc/de/articles/7371921627794-PDF-Accessibility-Checker-PAC-2024. Using it on Windows is rather straightforward but requires a few more steps to make it run on Linux. The following procedure has been tested successfully with Wine 7.0 and should work with later versions quite as well.
142
143
# Install <code>wine</code> and <code>winetricks</code> via your package manager. Ensure that it is at least Wine version 7.0.
144
# It is recommended to use a separate Wine prefix (i.e. a separate environment with its own configuration and installed Windows components/packages). To do so, issue <code>WINEPREFIX=~/.wine-pac wineboot --init</code>. The path <code>~/.wine_pac</code> is an example and may be replaced with a path to your liking.
145
# Install all fonts available for Wine (<code>corefonts</code> package won’t suffice) as well as .NET 4.8 by issuing <code>WINEPREFIX=~/.wine-pac winetricks --force dotnet48 allfonts</code>. The <code>--force</code> option is required, because <code>winetricks</code> will otherwise quit the installation with a warning, stating that the .NET 4.8 package may be broken since Wine release 5.0.
146
# After the installation routines of the aforementioned Windows software via Wine, you should now be able to run PAC via <code>WINEPREFIX=~/.wine-pac wine "/Path/to/your/PAC_directory/PAC.exe".