Accessibiliy Features » Historie » Version 30
Patrick Schulz, 21.03.2025 10:19
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 | 29 | Maren Pufe | This must also be done in broader contexts that may(!) contain multiple paragraphs of plain text, like footnotes, captions, bibliographic references, 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. |
46 | 6 | Patrick Schulz | |
47 | 7 | Patrick Schulz | h2. Alternative Texts |
48 | |||
49 | 8 | Patrick Schulz | Figures and Math both need alternative texts. |
50 | 7 | Patrick Schulz | |
51 | h4. Figures |
||
52 | |||
53 | For figures, there are two ways to encode alt-text: the @alt@ Parameter in the optional argument of @\includegraphics@ (needs texlive > 2021), e.g. |
||
54 | <pre>\incudegraphics[...,alt={This is what the image file shows}]{image.png}</pre> |
||
55 | or as @\tpAltText@ inside the @tpFigure@ or @tpSubFloat@ environments: |
||
56 | <pre>\begin{tpFigure} |
||
57 | \tpCaption{This is the caption} |
||
58 | \tpAltText{This is the alt text. It MUST NOT be the same as the caption!} |
||
59 | \tpFig{\includegraphics{image.png}} |
||
60 | 10 | Patrick Schulz | \end{tpFigure}</pre>If both exist, the @alt@ in @\includegraphics@ takes precedence over the @\tpAltText@. |
61 | 7 | Patrick Schulz | |
62 | h4. Math |
||
63 | |||
64 | both inline and display style math needs alternative texts. This is done with the @\ccaAddAltText@ macro: |
||
65 | <pre> |
||
66 | \begin{equation*}\ccaAddAltText{Z equals x minus mu divided by sigma}% |
||
67 | \mathbf{Z}=\,\frac{\boldsymbol{x}-\mathbf{\mu }}{\mathbf{\sigma }} |
||
68 | \end{equation*} |
||
69 | </pre> |
||
70 | or, for inline math: |
||
71 | <pre>The Variable $x\addAltText{x}$ means...</pre> |
||
72 | |||
73 | 1 | Patrick Schulz | h2. XMP Meta Data |
74 | 11 | Patrick Schulz | |
75 | 30 | Patrick Schulz | _(see [[XMP Meta Data]])_ |
76 | 17 | Patrick Schulz | |
77 | h2. Colours and Embedded Images |
||
78 | |||
79 | 18 | Patrick Schulz | h3. Output Intent and Embedded ICC Colour Profiles |
80 | |||
81 | By default, CoCoTeX puts **CMYK** as output intent, but this can be overridden with the @color-env@ class option: |
||
82 | <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: |
||
83 | |||
84 | |_. @<space>@ |_. icc profile| |
||
85 | | @srgb@, @rgb@ | IEC 61966-2.1 Default RGB colour space - sRGB | |
||
86 | | @cmy@, @cmyk@ | Coated FOGRA39 | |
||
87 | | @grey@, @gray@ | ISO Coated v2 - GREY 1c - (basICColor) | |
||
88 | | @natural@, @none@ | (gray) | |
||
89 | |||
90 | Publisher-wide colour profile can be set with the @profile@ Property of the @titlepage@ Container:<pre><code class="latex">\ccAddToType{Properties}{titlepage}{% |
||
91 | \ccSetProperty{output-intent}{% |
||
92 | profile=<path to .icc file>;% |
||
93 | components=<number of colour components>;% |
||
94 | identifier=<name of colour profile>% |
||
95 | }}</code></pre>with the following values: |
||
96 | * @<path to .icc file>@ is the path to the icc colour profile relative to the .tex file, including the file extension. |
||
97 | * @<number of colour components>@ is the number of colour components, e.g., @3@ for RGB, @4@ for CMYK, etc. |
||
98 | * @<name of colour profile>@ is the name of the colour profile (default values correspond to the right column in above's table) |
||
99 | |||
100 | 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} |
||
101 | … |
||
102 | \tpIccProfileFile{<path to .icc file>} |
||
103 | \tpIccComponents{<number of colour components>} |
||
104 | \tpIccIdentifier{<name of colour profile>} |
||
105 | … |
||
106 | \end{tpMeta}</code></pre> |
||
107 | |||
108 | h3. Image files |
||
109 | 1 | Patrick Schulz | |
110 | 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. |
111 | 18 | Patrick Schulz | |
112 | 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 |
||
113 | * @<input>@ the path to the input image |
||
114 | * @<color_space>@ the color space the image should be converted to (cmyk, rgb, etc) |
||
115 | * @<path_to_icc>@ the path to the icc profile that gets embedded into the image |
||
116 | * @<output>@ the name of the output image |
||
117 | |||
118 | h3. Custom Text Colours |
||
119 | 17 | Patrick Schulz | |
120 | 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} |
||
121 | \definecolor{myblue}{RGB}{53,39,255} |
||
122 | \definecolor{myblue}{rgb}{0.21,0.15,1} |
||
123 | \definecolor{myblue}{cmyk}{0.79,0.85,0,0}</code></pre> |
||
124 | 24 | Marcus Hottenroth | |
125 | h2. Checking PDF/UA compliance on Linux |
||
126 | |||
127 | 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. |
||
128 | |||
129 | # Install <code>wine</code> and <code>winetricks</code> via your package manager. Ensure that it is at least Wine version 7.0. |
||
130 | # 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. |
||
131 | # 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. |
||
132 | # 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". |