Using apa7.cls in Overleaf

TL;DR: If you’re here for the apa7.cls file, go to https://github.com/ZacharyST/apa7.cls.

For a recently accepted article, I was asked to use the apa7 (American Psychological Association 7th edition) document class for my Latex document. The request seemed easy because the file was already using the apa6 class. Of course this is Latex, so instead of a 2 second change I spent 45 minutes on the task and questioned my career choice.

Overleaf failed to compile the document because “LaTeX Error: File `apa7.cls’ not found.” This error is clear enough but bizarre since I did not provide an apa6.cls file and never have had to provide .cls files for other Overleaf documents. Fortunately, I thought, there is a template, so I would see that I was missing. Unfortunately, the template is not helpful, as it simply calls the apa7 document class but does not have an apa7.cls file as part of it. Weird but no big deal, I figured, I could surely find the .cls on the internet.

Wrong wrong wrong. Various Google queries all converge to the CTAN page for the apa7 package or its Github repo. (They contain the same files and directions.) There is a README and three files that start with apa7 but 0 that end in .cls. Fortunately, the README contains instructions for creating apa7.cls. Almost there!

No no no no no no. The first confusing part is that the instructions say to put a config directory “next to the file apa7.ins”. Well, files are displayed vertically, so I guessed that the author of the README meant to put the config directory in the same directory as apa7.ins. That guess would turn out correct, but there was no way to know immediately because following the second step, “Run latex apa7.ins” failed. (Note as well that one has to realize the author is providing a command line command.) After more Googling and trying to put apa7.ins into the config directory, I tried one last thing because I could not think of anything else: I also downloaded apa7.dtx (the third apa7 file is apa7.pdf) and then repeated step 2. Finally, it worked!

Now that I had a apa7.cls file, I went back to Overleaf and uploaded the .cls file to my project. Everything compiled without error.

To be honest, this experience has been one of my most frustrating in several years because every step was unclear. (Or maybe Covid has just made me irritable.) Imagine if I was new to Latex or computers and trying to figure this issue out, I easily could have spent much longer on the issue. I would have felt like an impostor instead of realizing the fault is poor documentation.

Finally, to save you, dear reader, frustration, I have the apa7.cls file in a Github repo: https://github.com/ZacharyST/apa7.cls. You’re welcome!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.