I'm trying to update apa.cls for 6th edition (a large task since I'm not a true latex hacker) and I'd like to force the headings for certain levels to conform to title case. That is the first letter of every word is in uppercase. For example:
- Upper case = DELAYED SOCIAL TRANSITIONS DURING EMERGING ADULTHOOD
- Lower case = delayed social transitions during emerging adulthood
- Sentence case = Delayed social transitions during emerging adulthood
- Title case = Delayed Social Transitions During Emerging Edulthood
So my questions are:
- Is there an easy way to do this that I just haven't found? or
- Can someone point me in the direction of what I would have to know to implement this myself?
Thanks all.
p.s. I know that this post has nothing to do with the tag 'cases', but I can't create new tags because I don't have enough reputation and nothing else fits 🙁
Best Answer
This code should get you started. It uses a couple of the
stringstrings
package's string manipulation routines, including its horrendously time-expensive\addlcwords
to identify the words you'd prefer to typeset in lower case. The rest of the code hooks this into APA's sectioning commands (it's tedious but it does the trick).Note that although this should get you going, it isn't completely ready for prime time, mainly because the work will take some time which, if it weren't something you wanted to proceed with, would divert me from things I'm actually supposed to be doing
:)
. Nevertheless, if this were something you wanted to proceed with, you'll need to letstringstrings
know that '-' (as in 'Knock-on') should be treated the same way as a space character (run the code below to see what I mean). That work would probably involve handing '-' tostringstrings
's\encodetoken
command and involve providing some extra buttressing code -- although I wouldn't be surprised if there were several ways to skin that particular cat.Anyway, although there's still some work remaining, I hope it takes you in the direction you set out to go. (NB, don't forget:
stringstrings
's\addlcwords
seems to scale time-exponentially. Or worse.)