GeneralHow do I make the first letter of a word into uppercase

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Soroush
Posts: 21
Joined: Thu Feb 01, 2007 5:33 pm

How do I make the first letter of a word into uppercase

Post by Soroush »

Hi!
I'm using the hyperref package and when referring to a section, the package inserts the string 'section' for me as well as the number. The problem is that when it appears at the beginning of a sentence, it is in lower case. (This is not the case with figures, they are always inserted as 'Figure') Is there a command (or any other way) to have the first letter of the auto generated string to become uppercase (is it called titlecase?).
Thank.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Soroush
Posts: 21
Joined: Thu Feb 01, 2007 5:33 pm

How do I make the first letter of a word into uppercase

Post by Soroush »

With regards to the same question I posted above...
... the Hyperref manual states that
The label is worked out from the context of the original \label command by hyperref by using the macros listed below (shown with their default values). The macros can be redefined in documents using \renewcommand; note that some of these macros are already defined in the standard document classes. The mixture of lowercase and uppercase initial letters is deliberate and corresponds to the author’s practice.

For each macro below, hyperref checks \*autorefname before \*name. For instance, it looks for \figureautorefname before \figurename.

Macro
Default

Figure
\figurename

section
\sectionname

subsection
\subsectionname

Theorem
\theoremname


I would want to see the string 'Section' when using \autoref{} instead of 'section', so I thought I'd use the

Code: Select all

\renewcommand{\sectionname}{Section}
, but it gives me an error, saying \sectioname isn't defined. I also tried to modify the hyperref.sty file and change 'section to 'Section', but that didn't work either.

I would add that the reason I'm using the hyperref package is that it given nice clickable links for PDFs, so you can click on the whole 'Figure 1' string, instead of '1' only.

If anyone has a solution, I'd be grateful.
Thanks.
onion
Posts: 1
Joined: Fri Jul 20, 2007 1:00 pm

How do I make the first letter of a word into uppercase

Post by onion »

The solution is in the manual that you quoted
For each macro below, hyperref checks \*autorefname before \*name. For instance, it looks for \figureautorefname before \figurename.


You need to change the \*autorefname, the code is

Code: Select all

\renewcommand{\sectionautorefname}{Section}
Post Reply