GeneralChanging Header and Setting Titles Uppercase

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
c.mafla
Posts: 19
Joined: Sat Aug 02, 2008 1:20 am

Changing Header and Setting Titles Uppercase

Post by c.mafla »

Good day to everybody.

I need a new favour (and the last, i hope) from this forum; I need to change some format from my class but i dont know how to do it. To be exact, I need to change the format of the chapter and section format, from lowercasse, to uppercase. I know that I can do it manually, but i also know that there is a easy way to do it.

And, I need to change the header of the chapter. actually is something like this:

_________________________
Chapter 3

Name of the chapter
____________

and I need to look like this

____________
3. NAME OF THE CHAPTER
_______________


I've already try it usin the code ' \renewcommand{\chaptername}{}' but the result is not the desire:

_________________________
3

Name of the chapter
____________

Which doesnt look good..


Thanks to anyone who wants to help me

Carlos Andrés

PS: i'm using a nonstandard class...called 'mymothesis.cls' which is attached.
Attachments
mymothesis.cls
(2.21 KiB) Downloaded 329 times

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Changing Header and Setting Titles Uppercase

Post by localghost »

The class file only contains modifications to the chapter headings. You can influence the appearance by putting a redefinition into the preamble.

Code: Select all

\makeatletter
\renewcommand{\@makechapterhead}[1]{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \hrule                                           % horizontal line
    \vspace{5pt}%                                    % add some vertical space
    \ifnum \c@secnumdepth >\m@ne
        \huge \scshape \thechapter.                  % Only chapter followed by period
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \Huge \scshape #1\par                            % chapter title
    \vspace{5pt}%                                    % add some vertical space
    \hrule                                           % horizontal rule
    \nobreak
    \vskip 40\p@
  }}
\makeatother
All other setting are taken from the report class. The code above is not tested.


Best regards
Thorsten¹
c.mafla
Posts: 19
Joined: Sat Aug 02, 2008 1:20 am

Re: Changing Header and Setting Titles Uppercase

Post by c.mafla »

Thanks Thorsten; that helps me a lot.


But I still need a way to change all the chapter and section tittles to Uppercase letter.... is there a easy way to do it?

Thanks, again
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Changing Header and Setting Titles Uppercase

Post by localghost »

Oh, that's something I missed. Somehow I thought it should be small capitals. Another modification will do the trick.

Code: Select all

\makeatletter
\renewcommand{\@makechapterhead}[1]{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \hrule                                           % horizontal line
    \vspace{5pt}%                                    % add some vertical space
    \ifnum \c@secnumdepth >\m@ne
        \huge \thechapter.                           % Only chapter followed by period
        \par\nobreak
        \vskip 20\p@
    \fi
    \interlinepenalty\@M
    \Huge \MakeUppercase{#1}\par                     % chapter title in capitals
    \vspace{5pt}%                                    % add some vertical space
    \hrule                                           % horizontal rule
    \nobreak
    \vskip 40\p@
  }}
\makeatother
Post Reply