Category: Best Practices

TeXshop icon

Making LaTeX accessible

The first question most people ask is, “Isn’t there an export option to make PDFs created in LaTeX accessible?” It may be theoretically possible, but no one has developed or maintained a package that does it successfully. The main issue is that LaTeX-to-PDF exports have equations and graphs, etc, exported as images without alt-text. In other words, these PDFs are inaccessible.

So the alternatives are to:

Our research here at Swarthmore has led us to find outdated packages for LaTeX that do not successfully export to an accessible PDF. Many were developed by folks at universities in search of a solution.

What we recommend, instead, is to prepare LaTeX for export to HTML.

Resources needed

Prepare LaTeX for export to HTML

In order to achieve 99% accessibility with any output, the easiest answer is to edit the source document. In this case, we will need to edit our LaTeX code so that the .html meets accessibility best practices.

  • Insert title in preamble metadata: \title{_} ;
  • Insert sections in document body: \section{_}, etc ;
  • Use \enumerate{_} \item \item … \end{enumerate} for numbered lists;
  • Use \itemize{_} \item \item … \end{itemize} for bulleted or unordered lists;
  • Use only one font attribute for emphasis.
  • Use all caps and italics sparingly.
  • Use color contrast according to WCAG compliance. WebAIM: Contrast Checker.
  • Use tables only for tabular information.
  • Use alt text for images, diagrams, etc. Images Tutorial | Web Accessibility Initiative (WAI) | W3C.

Export the LaTeX to HTML

  1. Download and install PANDOC to your computer / local environment if you haven’t already.
  2. Review LaTeX to HTML via PANDOC | Dan W. Joyce to understand what the codes mean.
  3. Open your Command Line Interface (CLI).
  4. Copy and paste the following command at the prompt: pandoc --shift-heading-level-by=1 --mathjax -f latex -t html -s -o <file>.html <file>.tex.

What does this have to do with Moodle?

When we discuss best practices in accessibility, we talk about

  • allowing an end user to choose their preference.
  • maintaining accessibility in the source document.

In the case of LaTeX, we have had students prefer to read the .tex file exactly as .tex because that is easier for them than the inaccessible PDF. Might we find ways to have Moodle export a .tex file to .html or .pdf or something else in some quick and easy way?

For now, we instruct faculty on how to post .html files on their Moodle sites.

Posting HTML files to Moodle

These are the current steps to post a remediated HTML to Moodle, as given to instructors at Swarthmore, where we post remediated files to Google Drive:

When downloading a folder from Google drive, it becomes a .zip file. You may choose to download each folder for your remediations and then directly upload them to your Moodle course page. Here’s how to do that.

  1. Open the Moodle course in which you’d like to place the .html.
  2. Enable Edit mode.
  3. Add an activity or resource.
  4. Choose File.
  5. Fill out the required field: Name.
  6. Choose the .zip file that contains the whole folder with everything in it.
  7. Once it’s showing in the “Select files” area, select the folder.
  8. In the dialog box that pops up, choose Unzip.
  9. You will likely see:
    • an images folder, if there are images
    • the .html or .xhtml file.
    • the original .zip file.
  10. Delete the .zip file.
  11. Select the .html or .xhtml file.
  12. Choose Set main file.
  13. Choose Save and return to course.

Some professors choose to put the .html, .tex, and keep the .pdf so students can choose from the .html, .tex, and the .pdf files. Others replace .pdfs with the .html altogether. HTML files, when done correctly, are generally more accessible than .pdfs.

For more information on posting displaying a website index page or .html to your Moodle site, refer to Moodle’s File Resource Settings page.

How you can help

  • Can you think of ways to streamline this process?
  • Can you think of ways to have Moodle export any file, including .tex or .docx or .pptx to .html or .pdf or something else in some quick and easy way? It could be by the end user (student, presumably) or the faculty.
  • Are you aware of other ways to handle STEM in an accessible manner?
  • Learn and implement accessibility practices every day!

We discussed a few of these at Hack/Doc in June and feel the project is just beginning.

Reach out to accessibility@swarthmore.edu if you have thoughts about this or other accessible STEM topics.

Additional, potentially helpful resources

Acknowledgements

The folks below contributed in various ways to our thought process about accessible STEM, particularly LaTeX.

Using the Moodle wiki to create a commonplace book

Professor Chris Phillips, Lafayette College
Course: Inventing America: English 332/American Studies 362

Commonplace books were popular in the 18th century, but go back to the Renaissance. You read something; you want to keep it in mind; instead of memorizing it you write it down so you don’t have to remember it. This is something Jefferson used to keep track of his speeches; this is something that a number of writers and readers during the 18th century used also to communicate. You write down something, you write a comment, you take it to a friend’s house and they copy down things they think are interesting, and they write a response in your book. It’s kind of like Facebook groups in 18th-century form.

In class, I wanted students to get a sense of what this type of text world was like. So they kept commonplace books throughout the semester. The students kept notes of their reading; they would write responses to it, they would add in different things from our trips. Some of them would cut out pieces of brochures and glue them in, some would write long reflections, and then they would write responses to each other.

Toward the end of the course, I wanted them to think about the other dynamic of commonplace books which is that a lot of times when say Jefferson was putting a speech together or when someone like Elizabeth Graeme Ferguson wanted to publish in a magazine, you’d have to take something out of this manuscript world and get it into another medium. So the students constructed a course anthology, and it was up to them to decide the medium, and they wanted to use a wiki.

They thought this was the best way to publish a commonplace book that still looked like what an 18th century commonplace book might look like, just no longer in manuscript form. So students entered excerpts from their books. These are quotations, reflections, and responses to each other. Someone added a link to a museum we went to as a way of adding a memento rather than scrapbooking it in.

The benefits of using the wiki were that it was simple to set up, but it also opened up interesting discussions about changes between media, changes between anthologizing practices and got us into questions about what it means to work in a system where you don’t keep track of intellectual property. Nothing is attributed in the anthology, and the students wanted it this way. Commonplace books were about collective authorship so this was our chance to use some of the newest technology to construct one of the oldest types of media they’ve been involved in.

Sample commonplace book in wiki
Sample commonplace book in wiki

Using the summary field to create “liner notes” for course materials

Professor Mark Burford, Reed College
Course: Music of the Caribbean

Unlike my courses on European art music, for which there are numerous anthologies and CD sets or multiple recordings of canonical works, several other music classes I teach, and the way I teach them, require that I accumulate materials from several sources, especially recordings. For these courses, which generally center on popular music and non-European musical traditions, I have used Moodle primarily for four purposes: (1) creating a “virtual mixed tape” of listening and viewing examples for each class; (2) providing “liner notes” with background information to complement this assigned listening; (3) posting assigned reading; and (4) providing a clearinghouse for course-related resources and other items that come to my attention over the course of the semester. For these purposes Moodle has been an indispensable part of my courses. The annotations for the listening assignments have been particularly vital. These allow me to give the students some context for the recordings—personnel of performers, instrumentation, date and location of the recording, song lyrics, performance context, significance of the particular recording, etc.—and to draw connections with other recordings we’ve already listened to. Providing this information saves valuable class time; students can come to class with basic information and we can hit the ground running during conference. From a practical standpoint, it is remarkably fast and easy to upload materials and, more importantly, to adjust on the fly, since material can be shifted around or supplemented as necessarily.

Web page with summary
Web page with summary
Listing of resources with "liner notes"
Listing of resources with "liner notes"
Setting up the summary to appear along with the resource
Setting up the summary to appear along with the resource
Audio file with summary
Audio file with summary

Using the main course page to create a compendium of resources

Professor Lee Upton, Lafayette College
Course: Advanced Creative Writing

From a student in Advanced Creative Writing: “Professor Upton uses the Moodle site as a compendium of material to inspire our writing. She has links to dozens of major literary magazines, so that we can log in any time we need some inspiration. She also has links to visual art sites to stimulate us if we start running low on creative juices. In addition, she has posted links to exciting electronic content, like recordings of authors actually reading their work. She has really turned the site into a writer’s resource.”

Using topics format, but adding weekly indicators
Using topics format, but adding weekly indicators