1

I want to learn how I can create latex templates (like APA or ACM format templates). I looked at resources available online, but I was not able to find a comprehensive one. Are you aware of where I can start?

4
  • Would this website be an option: overleaf.com/latex/templates/tagged/apa ?
    – alchemist
    Jan 24 at 15:17
  • I am aware of this resource but I want to use APA as a base and modify it. A course that I'm taking needs APA format but has modifications to it. Moreover, I will be designing a PDF report which will require that I learn how to make my own template.
    – Pss
    Jan 24 at 15:23
  • Well, I took two templates from Overleaf and adapted those to my needs. They are a good starting point to learn to make your own templates. But maybe someone can provide you with a good guide how to proceed. Trial-and-error can be quite frustrating at times ... ;D
    – alchemist
    Jan 24 at 15:37
  • Thank you! That's exactly my question. How did you adapt to your own needs? Do you modify .cls file on Overleaf of just the .tex file? Is there a tutorial that goes to some of the basic modifications?
    – Pss
    Jan 24 at 16:44

3 Answers 3

1

A document (now quite old, but the principles remain) describing classes can be found in an old issue of TUGBoat (TeX Users Group journal) here: https://tug.org/tugboat/tb28-1/tb88flynn.pdf

This describes in reasonable detail the article.cls class, which may be more detail than you are looking for, depending on how much change you need to make from the APA class, but the references will also help. In particular, when I was building my own class (not currently released anywhere), I used this, Jim Hefferon's "Minutes in less than hours", and clsguide.pdf ($TEXMFMAIN/texmf-dist/doc/latex/base/clsguide.pdf, if you have installed TeX/LaTeX locally) as good starting guides for how to build a class.

The steps I took (initially) were:

  • Start with a blank .cls file
  • use the LoadClass mechanism to build from already existing class (in your case, start by loading APA)
  • make modifications as needed
  • start using your new class like this \documentclass{PssVariantOfAPA} (you should choose a better name than that, though) in your .tex files
1

I don't know if the text is available on line but Mittelbach and Goossens "The LaTeX Companion" Addison Wesley, is an invaluable resource for LaTeX coding. In particular see the chapter "A LaTeX Overview for Preamble, Package and Class writers".

1

I still owe you an answer to the question in the comments. I notice two answers on finding guidelines and a workflow on building a class. So I guess those put you already en route to create a class document that satisfies your needs. I will describe how I did my conversions of both an article cls template and a book template.

The article

I browsed the internet using free latex templates as search term and found the website https://www.latextemplates.com/. On it are several categories like Overleaf presents to its users (guess these templates are also on Overleaf). In the Academic Article categeory I found the template Stylish Article suited my needs. It presents a cls file based on the article class.

Changes made

  1. Added the fonts I'd like to use and the way those are loaded using the typeface package. Note: see this question on its present day use: Typeface returns fatal coding errors after update of LaTeX core .
  2. Added a few packages I use as \Requiredpackage so the class loads those when creating a document based on it.
  3. Changed the way fancyhdr was used to meet my criteria and added a new definition of the first page layout.
  4. Added a few \newcommands to be used in the layout of the article - mainly about the header and the abstract parts.
  5. Added a set of colour definitions to be used throughout the article to print chemical formula's and drawings, to set sections and background to captions.

enter image description here

The result is shown in this first page of a students assignment on the use of water in all its variations.

The Book

The book is based on the LeGrande Orange Book: https://www.latextemplates.com/template/legrand-orange-book This book template uses a structure.tex file to be used as \input{structure.tex} inside the .tex file. In this case the changes were largely made to the structure.tex file and slightly on the book template that loads it.

Changes made

  1. Again used the typeface package to load my desired fonts.
  2. Changed some of the ToC entries to accommodate the spacing, colours and fonts I wanted to be used.
  3. Added a few packages and their options to introduce a glossary among others.
  4. Changed and added headers and footers set by fancyhdr
  5. Defined the same colour set as I used in the article.cls.
  6. Added the subfile package to divide the book into separate .tex files for each chapter.
  7. Defined the APA style to include and present my references using biblatex.

Final Remark

So by and large I used two publicly available templates that already satisfied my requirements to a large extend and that could rather easily be adapted by an advanced user of PDFLaTeX. My knowledge about LaTeX grew as I tinkered along that adaption path. Now I am going to make the necessary changes to the files in order to compile them with LuaLaTeX. Some packages I used aren't compatible with the changes in the LaTeX core anymore ... ;-P

1
  • Thank you! This is really helpful.
    – Pss
    yesterday

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.