Section 4Access-tags: attaching LATEX source to `fake' spaces.
A third method allows inclusion of the LATEX source of mathematics so that it may be readily extracted, using just the usual \textsf{Select}/\textsf{Copy}/\textsf{Paste} actions. This works with some existing PDF reader applications, including the freely available `Adobe Reader'. It is achieved by making use of the /ActualText attribute [ISO32000, § 14.9.4] for a piece of marked content, whether or not structure tagging is present. It can be done by existing PDF-writing software that supports tagging of content, as in Sect. 2.1, and specification of a value for the /ActualText attribute.
Fig. 3.2.1
shows how this works, by tagging a `fake space' character immediately
before mathematical content, and another immediately afterwards.
By selecting (see Fig. \subfigref{4a})
then \textsf{Copy}/\textsf{Paste} the content into text-editing software,
the result should be similar to
Fig. \subfigref{4b}.
The PDF reader must recognise
note
/ActualText and replace the copied content (e.g. a single font character) with its value.
The PDF name /AccessTag tags a single `space' character [( )]Tf
as marked content,
having replacement text in the /ActualText attribute; see Fig. \subfigref{5a}.
An /MCID number is not needed for this technique to work;
these are included in the example document\Exfootmark which is fully tagged\footnote{
In PDF 2.0 this will also need an association of /accesstag to /Custom within the /RoleMap
dictionary. The /AccessTag PDF name can be replaced by /Span.}.
We refer to these tagged `fake spaces' as `Access-tags', since a motivation for their use is to allow Assistive Technology (e.g., a Braille reader) access to the LATEX source of mathematical content. The spaces are `fake' in the sense that they are just 1pt in height and have nearly zero width. This makes them hard to select by themselves, but nearly impossible to separate from the mathematical content which they accompany; see Fig. \subfigref{4c}. They act as ordinary spaces when copied, but this is substituted with the /ActualText replacement, if supported. Another aspect of their `fakeness' is that they take no part in the typesetting, when using pdf-LATEX (post-2014). Of course the same idea could be implemented in different ways with different PDF-producing software.
{\edef\0{\string\0}\edef\1{\string\1}
One places into the initial `Access-tag' text of the LATEX source
— with care given to encode special characters
rem
— as the value of its /ActualText attribute.
The source coding is preceded by the string
and followed by and
,
with return-characters (in octal \015
) to allow these `delimiters' to ultimately copy onto lines by themselves.
The trailing `Access-tag' just takes .
As a result, the eventual \textsf{Paste} gives text as shown in Fig. \subfigref{4b}.
}
Assistive Technology (e.g., a Braille reader) works either by
- emulating \textsf{Copy}/\textsf{Paste} of on-screen portions of the document's window; or
- by directly accessing the `Accessible Text' view of the PDF document's contents
.
In both cases the /ActualText replacements are extracted.
(The `Accessible Text' view can be exported directly using Adobe's `Acrobat Pro' software, see [ExPDFUA].)
For mathematical symbols, where Figures \subfigref{1b},
\subfigref{3a} and \subfigref{5a}
show the presence of both /Alt and /ActualText attributes,
then the /Alt contributes to the `Accessible Text',
whereas /ActualText supplies what is copied to the Clipboard for \textsf{Copy}/\textsf{Paste}.
In either case, a human reader when encountering
on a line by itself can choose whether
to read (or listen to) the following lines of LATEX coding,
else use a \textsf{Find} action to skip down to where the next occurs.
This is followed by a line containing
.
Similarly the human can read/listen
or skip down to where occurs.
\paragraph*{Acknowledgements\/\upshape{:}} The author wishes to acknowledge James Davenport and Emma Cliffe, at the University of Bath, for valuable discussions regarding the needs of mathematics students having a visual disability. The `fake space' idea emerged as a result. Thanks also to reviewers for suggesting, among other ideas, inclusion of the PDF language overview as in Sect. 2.1, allowing later sections to be written more succinctly. Finally, I wish to thank members of ISO TC 171 for encouragement and support regarding `fake spaces' and other aspects.
\removelastskip \goodbreak\goodbreak\goodbreak \rightline{\attachfile[ucfilespec=2013-Assign2-soln-3u.pdf,mimetype=application/pdf]{2013-Assign2-soln-3u.pdf}} \makeatletter \edef\thisembedfile{\csname atfi@fsobj@2013-Assign2-soln-3u.pdf\endcsname} \addtodocassocfiles{\thisembedfile} \makeatother \nobreak