Some things I’m learning about accessibility & open textbooks

Screen shot of the Introduction to Philosophy open textbook series project page at the Rebus Community.

 

I am editing a series of open textbooks for Introduction to Philosophy courses, working with The Rebus Community. Along the way I’ve learned a lot about book publishing, including how to make books as accessible as possible. I’ve been using the BCcampus Accessibility Toolkit as well as other resources, plus lots of conversations on the Rebus Community discussion threads for the books. In this post I want to review a few of the things I’ve learned.

I want to say a huge thank you at the outset to Apurva Ashok, Baldur Bjarnason, Amanda Wentworth, and Peter Krautzberger, all of whom I have learned a lot from and whose ideas and advice are reflected in what follows. And I want to also say that this is really one of the many benefits of working with the Rebus Community–it is indeed a community of many folks helping each other!

Note: the books are all on the Pressbooks platform, so some of what I’ll talk about may be specific to Pressbooks.

Hyperlinks and URLs

One of the issues I’ve been addressing in the past month or so is related to the fact that we have both digital and print versions of the open textbooks.

Hyperlinks in digital and print versions

At first, to follow accessibility guidelines for links, we created descriptive text for most links in the books. The exception was for URLs in reference lists–more on that later. But then I discovered that the print PDF outputs (from which the paper versions of the books are built) just show plain text where the hyperlinks were in the digital PDF, epub, and web versions. So if one were reading the book in the print PDF or paper versions, they wouldn’t know there was a hyperlink there.

So we added some custom CSS, thanks to some folks at SUNY OER on a discussion post on the Ethics book page:

a::after {
  content: " (" attr(href) ")";
}

What that does is print the URL in parentheses after a hyperlink, on whichever format you put the custom CSS into. In Pressbooks, under Appearance – Custom Styles, you can add CSS to either the PDF, web, or epub formats (through a dropdown menu). So we added it for the PDF version).

But then that caused another issue: now on the digital PDFs there would be a hyperlink with descriptive text, followed by parentheses that include the URL. Thus, screen readers would go through and read the whole URL (which is part of the reason for doing hyperlinks with descriptive text instead).

Then I learned from Apurva Ashok that the CSS can be specified to apply only to the print PDF version:

.print a::after {
  content: " (" attr(href) ")";
}

Which worked great. Until, references.

Hyperlinks, URLs, and reference lists

In the lists of references and further readings, to comply with the citation style (we’re using Chicago author-date style for the books), we spelled out URLs in full. Which meant that in the print PDFs now we would get the URL in the reference list, followed by the same URL in parentheses, e.g.,

Kirk, Chris, Charanya Krishnaswami, Katie Mesner-Hage, Skye Nickalls. 2013. “Reproductive Rights Around the World.” Slate. May 30. http://www.slate.com/articles/news_and_politics/map_of_the_week/2013/05/abortion_and_birth_control_a_global_map.html (http://www.slate.com/articles/news_and_politics/map_of_the_week/2013/05/abortion_and_birth_control_a_global_map.html)

To fix this, I just took out the hyperlinks on the URLs in reference lists and suggested readings lists. But then, for accessibility purposes I had decided to use aria labels for the hyperlinked URLs in reference lists as per this post by Baldur Bjarnason in the Rebus Community pages. Aria labels allow screen readers to read descriptive text instead of full URLs, even if the descriptive text isn’t visible but only the full URL is (screen readers will pick up on what is in the aria label and read that instead of reading the whole URL). One can’t do that if the URLs aren’t hyperlinks, and we’re back to screen readers reading out annoying URLs as lists of letters and symbols and numbers.

Enter more custom CSS! Thanks to this post by Apurva Ashok on the Ethics book page.

The following CSS will ensure that hyperlinks with the “reference” class don’t have their URLs typed out in parentheses afterwards:

.print a:not(.reference)::after {
      content: " (" attr(href) ")";  
 }

Now, for this to work, I needed to add a “reference” class to all hyperlinks that I want to be caught up in this CSS and not have their URLs put into parentheses afterwards:

<p class="hanging-indent">Bourget, David and David J. Chalmers. 2014. “What Do Philosophers Believe?” <em>Philosophical Studies</em> 170(3): 465-500. 
<a class="reference" href="https://philpapers.org/rec/BOUWDP">https://philpapers.org/rec/BOUWDP</a></p>

Finally, I need to add the aria labels:

<p class="hanging-indent">Bourget, David and David J. Chalmers. 2014. “What Do Philosophers Believe?” 
<em>Philosophical Studies</em> 170(3): 465-500. <a class="reference" aria-label ="What Do Philosophers Believe?" 
href="https://philpapers.org/rec/BOUWDP">https://philpapers.org/rec/BOUWDP</a></p>

A bit time-consuming to go do retrofixes, but now it’s in the workflow so it can be done for the rest of the books ahead of time rather than having to go back and fix after publication (like I did for Philosophy of Mind and Ethics).

Headings and PDFs

We have been very careful to ensure that we follow accessibility guidelines for headings, including ensuring that text is specified as a heading, and using headings in sequential order.

What I discovered though, as noted in this post by me on the Philosophy of Mind page, is that there were some issues with the way the headings show up on the “bookmarks” sidebar of PDFs. What was happening: the chapter titles were appearing as if they were heading 2 (when they were actually heading 1) and nested under the “Introduction to the Book.” There was an issue with the footnotes too, which I can’t now recall (and isn’t recorded on the discussion page).  And I’m guessing that screen readers would read the headings in the same way, making the organization of the book unclear.

Also, the copyright page doesn’t appear in the PDF bookmarks/headers for some reason, meaning that would just get skipped if one were going from heading to heading.

The reply from Apurva Ashok to this post notes how the fix was fairly complicated, and I think it has to do specifically with how Pressbooks works. These are workarounds, but they’re not perfect. Even at this point the author’s names appear in the bookmark table of contents, so I’m thinking screen readers might jump from chapter title to author name rather than to the next chapter title if going heading by heading.

screen shot showing what the heading bookmarks on the PDF for the Philosophy of Mind looks like

Logical symbols

I am currently working on the Logic textbook, and that is adding another layer of complication because there are a fair number of logical symbols in it, such as those in the list of logical symbols in Wikipedia.

In the chapters these symbols were added using Unicode, but I asked on the Rebus Community what is best practice for accessibility for logical symbols, and Rebus forwarded to Twitter. The consensus seems to be that using LaTeX or MathML is the better option than Unicode, particularly since Pressbooks uses MathJax for these and from what I understand, MathJax has useful accessibility features (according to the Math in Pressbooks chapter of the Pressbooks Guide).

Thus began my first foray into learning how to use LaTeX with MathJax. I know enough to be able to render the basic symbols. For example,

[latex]S(p, q) \equiv (p \rightarrow q)[/latex]

renders as

S(p, q) ≡ (pq)

But even then, all is not yet well. There is some weirdness on Firefox on MacOS that means the LaTeX text looks smaller than the rest of the text, as shown in the following screen shot:

a paragraph of text with some text in LaTeX and some not; the former is smaller than the latter.

You can see the LaTeX formulas in the paragraph itself are smaller, and then the first D1, which is in LaTeX, is smaller than the second D1, in unicode.

According to this post on the Rebus Community by Peter Krautzberger just today, apparently this is an issue with a google font that doesn’t have good metadata. Who would have guessed?!

So we’re still working on that one. The LaTeX looks fine on other browsers, and looks fine on Firefox on Linux (not sure about other Firefox versions). It’s just the latest Firefox for Mac OS that isn’t rendering it well.

 

That’s enough for today … I think I’ll be posting more process posts in the coming weeks and months, explaining how we are going about doing these open textbooks for philosophy, and what issues we’re running into. It’s all documented on the Rebus Community pages, but it can sometimes be a little daunting to read through all those discussion threads!

 

Update Feb 7, 2020

Regarding the issue with the LaTeX text appearing smaller than the rest of the text on some browsers, we ended up just changing the font in the book for now to a standard serif. That fixed the issue, though now the font in this book is different than the one in the other published books. I believe the Pressbooks team may be looking into another possible fix…

 

2 comments

  1. Just wanted to say that the solution you came up with for providing links in print copies is genius and a huge time saver! Just tried it out, and it worked wonderfully, and I will be updating the Accessibility Toolkit to include this information. I did have a problem with internal links also being displayed in the print copy, but was able to fix it by using search and replace to add a class=”internal” to those links and then exclude them as you did with the references.

    Thanks so much for sharing!

    1. Thank you for letting me know this worked for you, and for pointing out the issue with internal links as well. I just checked our internal links in the print copies and it’s the same issue. So now I need to go fix those. Thanks so much for commenting here so now I know about that issue too!

Comments are closed.