LaTeX forum ⇒ GeneralCapitalize first letter of every word

LaTeX specific issues not fitting into one of the other forums of this category.
Posts: 34
Joined: Mon Jul 09, 2007 4:04 am

Capitalize first letter of every word

Postby darckhart » Tue Mar 04, 2008 8:52 pm

Hi all. I'm looking for a way to capitalize the first letter of every word in a given block of text. Something to the effect of:
i want to capitalize every word of this sentence.\\
and this one too.\\

which would of course display like:
I Want To Capitalize Every Word ....etc

Also it would have to work on text inside a table/tabular environment. I assume I'd have to write some custom macro, but I'm not savvy enough with latex yet to do this. Can anyone give me some pointers? Thanks.

User avatar
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm
Location: Colombia

Postby gmedina » Tue Mar 04, 2008 9:20 pm

Any resemblance to this thread?

Posts: 34
Joined: Mon Jul 09, 2007 4:04 am

Postby darckhart » Tue Mar 04, 2008 10:02 pm

Hm, yes very close to the first post. The reason is I'm keeping a separate table of expressions/titles and it would look more presentable if each item had every word capitalized. However, in the main text I may refer to the expression without capitalizing every word if, for example, it was in the middle of a sentence. I was thinking I might pass the whole expression as an argument to the macro which would check for a space and then apply \uppercase to the first letter immediately following. But then I also don't know how to break up the word into its component letters and only \uppercase the first letter of the word. So I'm stuck.

Return to “General”

Who is online

Users browsing this forum: No registered users and 5 guests