Code Monkey home page Code Monkey logo

accessibility's People

Contributors

andyclifton avatar pelinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

accessibility's Issues

strucPDF causes errors with \hline in longtable

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):

  • OS: macos 10.14.5
  • 'TeX distribution: MacTex (TexLive)
  • Version 2019

Additional context
tabularx and tabular all work as expected.

Thank you.

Incompatible with lineno package

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.

Vertical alignment issue with tubular 'p' columns

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.

PDF/UA XMP metadata missing so far

Steps to reproduce

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.

Expected behaviour

A specific metadata is mandatory for PDF/UA according to ISO 14289‑1.

Comment

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}

Incompatibility with siunitx table column type

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.

Acrobat Screenreader gives empty page warning

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?

amsart and itemize leads to infinite loop

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.

Fundraising for sustained and integrated software development

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 Status)

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.

Xe(La)TeX and \pdfobj

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:

  1. Write a MWE that works under pdfTeX, e.g.:
\documentclass{article}
\usepackage{accessibility}
\begin{document}
This is a test.
\end{document}
  1. Try compiling that same .tex document using XeLaTeX, get errors.
  2. The compiled PDF looks like this:

reserveobjnum
=0=6
reserveobjnumThis is a test.

Expected behavior
It should compile, but it does not.

Version

  • Device: MacBook Air (M1, 2020)
  • OS: macOS 13.5.1
  • accessibility.sty Version: [2023/01/18 v. 2.1.0]
  • TeX Version: TeXLive 2021

Incompatibility with enumitem

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

  • OS: Arch Linux 5.2.8-arch1-1-ARCH
  • 'TeX distribution: texlive
  • Version: 2019

Error messages should be in English

The access.tex source file contains several warning and error messages that might be displayed in the latex console. These should be in english.

Page without StructParents, syntax problem

Steps to reproduce

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
pac3-latex-accessibility-minimal_crop

You get an error page without StructParents.

Expected behaviour (correct)

The StructParents entry should be there.

Identify stakeholders in a relaunch

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.

Standards and system boundary

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.

Doesn't work with roman numerals

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}}%
  }%
}%

List item spacing problem when previous item ends with an equation

When using this v2.0.3 of this package with the taggedoption, 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.

Incompatible with separate TOC names for chapters/sections etc.

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}

The code will produce something that looks like this:
Screenshot from 2022-11-09 02-30-04

Modify CTAN upload format

Feedback from CTAN, very heavily summarized:

please remove the .tds.zip from the submission and include the .sty file in any later submissions.

port to luatex

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.

Compiler doesn't give same results in 2019 as in 2007

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

  1. docstrip does something different in 2019 than 2007
  2. the .sty file is older than access.tex

Zoom TeX Hour on accessible mathematics (details in thread)

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)

Using the package does not create a PDF that shows Tagged in Adobe Acrobat or contains actual tags

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:
grafik

This is true on two different machines, they run with:

  • MiKTeX-pdfTeX 2.9.6362 (1.40.18) (MiKTeX 2.9.6400 64-bit)
  • MiKTeX-pdfTeX 2.9.7029 (1.40.20) (MiKTeX 2.9.7000 64-bit)

Text objects in example article are not tagged

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:

  1. Obtain the free PDF Accessibility Checker from Zugang für alle. This issue was checked with PAC 3.
  2. Open the example article PDF in the checker.
  3. Below the listing of checkpoints, select "Results in Detail" to see a breakdown of the untagged objects.

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
TextObjectNotTagged

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.

Create Beamer MWE

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?

Attempting to use with another template.

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.

Update encoding to UTF-8

Many files in the project are currently encoded in ISO8859. These should be updated to UTF-8 for submission to CTAN.

Using captions on math figures (LaTeX)

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:

Screenshot from 2022-06-22 14-26-28

Which in other utilities is rendered below the figure in a PDF (source: OverLeaf):

Screenshot from 2022-06-22 14-24-55

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.

  • PanDoc 2.5 for Linux

accessibility.sty not found

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?

incompatibility with fancyhdr

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):

  • OS: macos 10.14.5
  • 'TeX distribution MacTex (TexLive)
  • Version 2019

Include CTAN version number in files

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.