andyclifton / accessibility Goto Github PK
View Code? Open in Web Editor NEWA CTAN-compliant version of the LaTeX `accessibility` package
A CTAN-compliant version of the LaTeX `accessibility` package
There are two accessibility.tex
files in the file repo that I was supplied with by Babett in 2019. Which one is correct?
See #38 for background.
I run /source/batch.tex
through latex to process access.tex
and produce accessibility.tex
Unfortunately this is different than the version that is currently in that directory.
Possible causes
TexnicCenter would not install the package on the fly, and when I installed it manually, it still gives the same error: accessibility.sty not found. No other package is having this issue that I have tried. I get the error from any file, such as the following one:
\documentclass{article}
\usepackage{accessibility}
\begin{document}
Something something
\end{document}
From ctan, https://ctan.org/pkg/accessibility?lang=en, it says the package should be available in miktex. However, when the viewing the package in the repository, there is only accessibility.tmp, but no accessibility.sty file. Is this the problem?
The link to accessibility/samples, in section 5 of the English documentation (both on CTAN and this repo), results in a 404 error page.
Given that accessibility has a lot of implications for lots of different folks, I’d like to start to identify them. Later I’d like to work with them to make sure they get what they need.
So far I think the following groups are important:
Writers / content creators
Publishers
Archives
Content consumers
Programmers
PDF Standards creators
Other legislators and regulators
Advocacy / rights groups
Latex team
If you can think of other groups or would like to be included in a consultation process, please leave a note below.
Using page numbers as references within the stack in the accessibility.dtx
file causes trouble when pages have no numbering or use roman numerals.
Instead of using \thepage
, consider using \count1
as the page marker, e.g. replace
/Pg \pdfpageref\thepage \space \space 0 R %
with
/Pg \pdfpageref\count1 \space \space 0 R %
Note that we also have to then fix hyperref:
% The count1to package confuses hyperref (see hyperref README), so fix \theH<...>:
\@ifpackageloaded{hyperref}{%
\AtBeginDocument{%
\ifthenelse{\isundefined{\theHchapter}}{\newcommand{\theHchapter}{0}}{}%
\renewcommand*{\theHsection}{\theHchapter.\arabic{section}}%
\renewcommand*{\theHsubsection}{\theHsection.\arabic{subsection}}%
\renewcommand*{\theHsubsubsection}{\theHsubsection.\arabic{subsubsection}}%
\renewcommand*{\theHparagraph}{\theHsubsubsection.\arabic{paragraph}}%
\renewcommand*{\theHsubparagraph}{\theHparagraph.\arabic{subparagraph}}%
}%
}%
Describe the bug
longtable environment cannot include \hline when strucPDF is in use.
To Reproduce
MWE:
\documentclass[11pt,article,oneside,tagged]{article}
\usepackage[left=1in,top=1in,right=1in,bottom=1in,footskip = 0.333in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{longtable} %provide longtable
\usepackage[tagged, highstructure]{strucPDF}
\begin{document}
\begin{longtable}{ p{0.1\textwidth} | p{0.8\textwidth} }
%\hline
1 & 2\\
3 & 4\\
%\hline
\end{longtable}
\end{document}
Expected behavior
Compiles correctly as shown. Uncommenting either \hline command produces the error:
./test.tex:14: A <box> was supposed to be here.
<to be read again>
\toks@
l.14 1
& 2\\
?
Log messages
If applicable, add log outputs or screenshots to help explain your problem.
Tex Installation (please complete the following information):
Additional context
tabularx and tabular all work as expected.
Thank you.
Run this minimal example either in pdftex or lualatex:
\documentclass{scrreprt}
\usepackage{luatex85}
\usepackage[tagged]{accessibility}
\begin{document}
Text.
\end{document}
Check the output generated in PAC version 3.0.7.0
You get an error page without StructParents
.
The StructParents entry should be there.
Describe the bug
Setting pagestyle to fancy causes compilation error.
To Reproduce
MWE:
\documentclass[11pt,article,oneside,tagged]{article}
\usepackage[left=1in,top=1in,right=1in,bottom=1in,footskip = 0.333in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage[tagged, highstructure]{strucPDF}
\begin{document}
test test test
\end{document}
Expected behavior
Compiles correctly if \pagestyle{fancy} is commented.
Log messages
With \pagestyle{fancy} uncommented produces error:
./test.tex:10: Undefined control sequence.
\\->\let \reserved@e
\relax \let \reserved@f \relax \@ifstar {\let \reserved...
l.10 \end{document}
?
Tex Installation (please complete the following information):
Right now the package runs on pdftex only. But this converter is obsolete, we should use luatex, don't we? I like how easily OT fonts can be used with luatex. So please make the package work with luatex.
Accessibility
was developed as a proof of concept for KOMA-script classes more than 10 years ago and it's simply not up for the job anymore. I'm also not able to fix it.
(Related to this I have tagged the readme.md for this project with a )
I'm now starting to look for ways to leverage the ideas in this package, other related "accessibility" packages, and core LaTeX to create a solution that is much more deeply integrated into LaTeX than these sticking-plaster approaches.
This would be a multi-year software development project that would benefit from sustained, full-time attention by someone / a group who knows what they are doing, and can help develop a solution that is more integrated with the core LaTeX code. If you've looked at any of my repos here you'll see that this person is not me.
I'm now starting to scope a project, and using this issue to collect related ideas / thoughts.
Feedback from CTAN, very heavily summarized:
please remove the .tds.zip from the submission and include the
.sty
file in any later submissions.
When using accessibility.sty
v.2.0.3 with the tagged option, there appears to be a problem with the vertical alignment of p
columns in the tabular environment. The text in such columns is displaced downwards by about a line, relative to where is should be. MWE:
\documentclass{article}
\usepackage[tagged]{accessibility}
\begin{document}
\begin{tabular}{lp{15em}l}
Left Column & Paragraph Column & Left Column
\end{tabular}
\end{document}
In this example, the text "Left Column", "Paragraph Column" and "Left Column" should all share the same baseline. In reality though "Paragraph Column" is displaced downwards by about a line height. This issue does not arise if you remove the "tagged" option, or comment out the accessibility package line altogether.
I've had a play with commenting things out of the accessibility.sty
file, and it seems that the ultimate cause is the \pdfliteral
command within the start of the PDFMarkContent
environment, which is called from \PDFTableCell
, which in turn is executed after every ampersand inside tabular. Presumably there's something about the way that p
columns are implemented that means \pdfliteral
is upsetting the baseline of the row that the column sees.
This package so far tries to tag PDFs and include relevant metadata. However, there are different standards for accessibility: PDF/A and PDF/UA
PDF/A-nb (n being 1 to 3 currently) does not target accessibility but requires metadata that are similar or identical to what we need here. PDF/X requires lots of stuff PDF/A needs but not the tagging.
To make long ends meet maybe it's a good idea to solve tagging in a separate package and use accessibility only for metadata, alternative texts and the like. Tagging is the difficult part. There is already such a package but it's not automatic: tagpdf
PDF/A3 sounds interesting for LaTeX since you can include the source code in the document. Just the other way round of what LaTeX did with the docstrip dtx files many, many years ago.
From @jfine2358 and raised in #42, now mentioned here for visibility:
Perhaps off-topic. I'm holding a zoom TeX Hour on accessible mathematics, on Thursday 11 January (6:30 to 7:30pm). All are welcome. For the zoom info see https://jfine2358.github.io/contact/. I've emailed @AndyClifton providing more information.
Also relevant is https://jfine2358.github.io/post/2021/01/21/blind-math-news/."
Originally posted by @jfine2358 in #42 (comment)
Describe the bug
When the enumitem
package is used and an enumerate
environment is present in the document, pdflatex fails to compile the document.
To Reproduce
MWE:
\documentclass{article}
\usepackage{enumitem}
\usepackage[english]{babel} % included to suppress (seemingly unrelated) warning
\usepackage[tagged,highstructure]{strucPDF}
\begin{document}
Line so document will compile if enumerate environment is commented.
\begin{enumerate}
\item foo
\end{enumerate}
\end{document}
Expected behavior
Document should compile properly.
Log messages
! Use of \\enumerate doesn't match its definition.
<argument> \def \reserved@a {
\def \@currenvir {PDFListLabel}\edef \@currenvl...
l.11 \item
foo
Tex Installation
The access.tex
source file contains several warning and error messages that might be displayed in the latex console. These should be in english.
Describe the bug
Text objects in the example article are not tagged, resulting in a failed accessibility check.
To Reproduce
Steps to reproduce the behaviour:
Expected behavior
Text objects in a PDF compiled with this package should probably be tagged; this feels to me within the scope of the project.
Log messages
article_PAC_Report.pdf
Additional notes
This is not isolated to the example article; I discovered this while working on my own document.
I appreciate the work you've put into this project! If there's anything I can do to help, I'd be glad to. I'm by no means an expert on LaTeX or PDF, but I've been studying the incantations lately for my accessibility projects, and I'm quite eager to see this work as well as it can. I'd rather spend a week in vi writing LaTeX than an hour in Acrobat.
Describe the bug
Using the Captions package in LaTeX, captions may be added to math figures using the folloing kinds of syntax:
\[ F9X=x\int_{t=0}^\infty g(x) dx \]
\captionof{figure}{Equation one}
\begin{figure}
\[ F9X=x\int_{t=0}^\infty g(x) dx \]
\caption{Equation three}
\end{figure}
PanDoc discards this information completely:
Which in other utilities is rendered below the figure in a PDF (source: OverLeaf):
Using a caption here is very useful in PDF, and could be used as alt text for MarkDown and HTML instead of just the equation in LaTeX as is seen now.
When I try to load both accessibility and lineno I get this error:
`! LaTeX Error: Command \c@linenumber already defined.
Or name \end... illegal, see p.192 of the manual.
See the LaTeX manual or LaTeX Companion for explanation.
Type H for immediate help.
...
l.671 \newcounter{linenumber}
%
Your command was ignored.
Type I to replace it with another command,
or to continue without it.`
The error varies depending on which package I load first.
MWE:
\documentclass{IEEEtran}
\usepackage[tagged]{accessibility}
\begin{document}
Test
\end{document}
Expected: generated tagged PDF
Instead: /usr/local/texlive/2019basic/texmf-dist/tex/latex/accessibility/accessibility.sty:1075: LaTeX Error: Command \subparagraph undefined.
A submission to CTAN must include the version number of the submission.
N.B. for the sake of (my) sanity the CTAN version number should probably match the github release number.
Hello
It seems that trying to use the optional argument to give a chapter/section/subsection a shorter name in the table of contents, eg.
\section[toc-name]{actual name}
is not working with the accessibility package enabled. It took me a while to figure out but I'm now relatively certain that it is this package that is causing the issue.
What would happen is basically that the section would be named "[" in the TOC, and "t" where the section starts and the first paragraph in the section would read "oc-name]actual name"
This is what happened when I tried to add alt titles to a document that was already using the package.
I also did a test adding the accessibility package to another document that already had TOC titles that I knew worked. Compiling that with pdflatex seemed to spin into an infinite loop but gave the following warning
Package accessibility Warning: empty \PopStack? on input line 294.
This short little example is enough to reproduce the error:
\documentclass{article}
\usepackage[tagged,highstructure]{accessibility}
\begin{document}
\section[Sect.]{Section}
Let's add some text
\end{document}
When using this v2.0.3 of this package with the tagged
option, if a list item is ended by an equation, which is then followed by another list item, then too much vertical space is inserted between the equation and the following list item. I've made a minimal-ish example at https://archive.uea.ac.uk/~aqw10chu/files/access.tex with the pdflatex-generated output at https://archive.uea.ac.uk/~aqw10chu/files/access.pdf
I've had a play around with the code in accessibility.sty, and the problem seems to be in the end part of the PDFSpezialTextObj
environment. The closest I've been able to get fixing the issue is to add \ignorespaces
to the end of the environment's definition, and commenting out the \pdfrefobj \theTextObjNum%
line completely. This then fixes the spacing issue. But presumably that line is needed, and I couldn't find how to include it without messing up the spacing again.
Many files in the project are currently encoded in ISO8859. These should be updated to UTF-8 for submission to CTAN.
As asked at https://tex.stackexchange.com/questions/550778/how-can-i-check-the-tagging-and-accessiblity-of-a-pdf-file?noredirect=1#comment1391644_550778 I am using the following code:
\documentclass{scrreprt}
\title{My title}
\author{My author}
\usepackage{hyperref}
\usepackage{accessibility}
\begin{document}
\maketitle
\tableofcontents
\chapter{This shall be a h1 heading}
\section{This shall be a h2 heading}
This shall be a p section
\section{This shall be a h3 heading}
\end{document}
And other than expected, Adobe Acrobat does not show that the PDF is tagged and there are also no tags in stream visible:
This is true on two different machines, they run with:
siunitx 2020/02/25 v2.8b
accessibility 2019/11/02 v. 2.0.3
When I use more than one S column of the siunitx package I get a lot of errors like
Missing } inserted.
Commenting out the accessibility package or using a single S column resolves this issue.
\documentclass{article}
\usepackage{siunitx}
%\usepackage{accessibility}
\begin{document}
\begin{tabular}{SSSS}
& 1 & & \\
& & 2 & \\
3.33 & 3 & & 11.3 \\
41.4 & & &
\end{tabular}
\end{document}
Perhaps related to #44.
Compile a minimal file like minimal-pdftex.tex
from this repository and run it through PAC3. The validator will give an error "Metadata->missing PDF/UA tag". Indeed when you watch in Acrobat->file properties->metadata you see it's not there.
A specific metadata is mandatory for PDF/UA according to ISO 14289‑1.
Scott from hxperxmp
is working on implementing this in his package. So I suggest we don't waste time here and wait for it to complete. We can then add something like \Requirepackage{hyperxmp}
Need to remove all spaces from file names to satisfy CTAN requirements
Describe the bug
Compiling any document with Xe(La)TeX and accessibility.sty leads to an error in compiling; something like:
./accessibility.sty:81: Undefined control sequence.
<recently read> \pdfobj
l.81 \pdfobj
reserveobjnum%
./accessibility.sty:81: LaTeX Error: Missing \begin{document}.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.81 \pdfobj r
eserveobjnum%
./accessibility.sty:82: Undefined control sequence.
<argument> ... c@StructTree\endcsname \pdflastobj
\relax
l.82 \setcounter{StructTree}{\pdflastobj}
It seems to me this is because \pdfobj is not a defined under the XeTeX engine (see this thread on tug.org).
To Reproduce
Steps to reproduce the behavior:
\documentclass{article}
\usepackage{accessibility}
\begin{document}
This is a test.
\end{document}
reserveobjnum
=0=6
reserveobjnumThis is a test.
Expected behavior
It should compile, but it does not.
Version
I can compile the test documents no problem. However, when I try to get Acrobat Pro to read the document out loud I only get an empty page warning. Surely, making it impossible for the screen reader to read the document runs counter to the goal of making pdfs accessible. What's going on?
In TeX Live 2017 on Windows 10, the following tex file
\documentclass{amsart}
\makeatletter
\providecommand{\@opargbegintheorem}{} % not defined in amsart?
\makeatother
\usepackage[tagged]{strucPDF}
\begin{document}
\begin{itemize}
\item some item
\end{itemize}
\end{document} % line 10
Leads to an infinite loop. The log file gets stuck repeating
Package strucPDF Warning: empty \PopStack? on input line 10.
infinitely often. It's ok with the article class.
Thank you for working on this problem for LaTeX files. I love what your example creates. I would like to apply it to the template located at http://www.latextemplates.com/template/stylish-article . I get the following error when compiling.
! Illegal parameter number in definition of \StackDii.
1
l.83 \tableofcontents
% Print the contents section
I put your package in at line 28 after the lipsum package. I am new to LaTeX so perhaps I just included it at the wrong place. I’m not really sure.
I realise that the package was probably no designed with beamer in mind, however may there is an easy fix. When trying to render a (minimal) beamer presentation, I get
/usr/local/texlive/2019/texmf-dist/tex/latex/accessibility/accessibility.sty, line 138
LaTeX Error: Command \alt already defined.
and of course \alt is indeed a beamer command.
Making (reasonably) accessible presentations using LaTeX would be a very good thing in many academic contexts, especially the STEM disciplines.
Any ideas as to what might be done?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.