3

Is there a way to automatically capitalize words in a heading according to APA Style?

This post suggests the use of titlecaps package, however it seemingly add uppercase to all words. According to APA Style only the following words should be capitalized (in heading levels 1-3):

  1. the first word of the title/heading

  2. all major words (nouns, verbs, adjectives, adverbs, and pronouns), including the second part of hyphenated major words (e.g., Self-Report not Self-report)

  3. Capitalize all words of four letters or more.

The following words (of less than four letters) would therefore not be capitalized:

  1. articles (a, an, the),

  2. coordinating conjunctions (and, but, for), and

  3. prepositions (at, by, etc.)

I'm looking for an way that LaTeX can identify word length and classes, and automatically capitalize words based on this.

  • 1
    The titlecaps package will uppercase each word, but allows a list of words to be excluded. Unfortunately, you have to specify the exclusionary list. – Steven B. Segletes Mar 10 '20 at 14:04
  • That's what I could figure out as well. What if the heading starts with an excluded word? Would it then not be capitalized? I mean it shouldn't be too hard to create a list of conjunctions, prepositions and articles with less than 4 letters. Additionally, could 4-letter exclusion limit be made? I also wonder about the hyphen rule. Will the second part be capitalized? – Pål Bjartan Mar 10 '20 at 14:20
  • 1
    From the manual (p.2), "\titlecap will capitalize the first word of the argument, even if that word is on the lower-cased word list. This default may be overridden with the command’s optional argument." See https://ctan.org/pkg/titlecaps for documentation. – Steven B. Segletes Mar 10 '20 at 14:23
  • Thank you for your reply. That's helpful. However, I'd still like to see some options for excluding certain word classes, word-length limit, and hyphenation rules. This would improve its functionality considerably. – Pål Bjartan Mar 10 '20 at 14:41
  • 1
  • You're misunderstanding the APA rules. Short words in general are capitalized, only short prepositions, short conjunctions, and articles are not capitalized.
  • Using titlecaps with an exclusion list won't always provide correct results either, since for example "in" should be capitalized in "The Spy Who Came In From the Cold", since it's not a preposition here.
  • – Ubik Mar 11 '20 at 21:31
  • @Ubik You are right. I was following the guidelines of this page, which as you say not entirely correct. I checked "The Concise Rules of APA Style" (6th ed.). Essentially, all verbs, nouns, adjectives, adverbs and pronouns should be capitalized. Conjunctions, articles, and prepositions should not be capitalized, unless they contain four letters or more. I will update my post to reflect this correctly. Can you explain why "In" is not a preposition in this case? (English is my second language.) – Pål Bjartan Mar 11 '20 at 23:53
  • 1
    A preposition requires an object, but in this case, there isn't one. You could simply say "The Spy Who Came In". Also, your post lists "from" among the prepositions that should not be capitalized, but it has 4 letters, so it should be. – Ubik Mar 12 '20 at 22:25
  • @Ubik I should obviously have chosen a more reiliable source to copy/paste rules and examples from. I have removed "from" from the example prepositions. Thanks for clarifying the sentence. "In" would be an adverb in this context, right? This is something I didn't consider, and it further complicates automating capitalization of only "major" words. :-/ – Pål Bjartan Mar 12 '20 at 22:56
  • Yes, "in" is an adverb in this context. "in" can be a preposition, an adverb, an adjective, or even a noun, and it's only not capitalized when it's a preposition. This makes automatic capitalization very hard. – Ubik Mar 13 '20 at 22:59