Text FormattingBold Chapter headings

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
sherrre
Posts: 3
Joined: Wed Jan 30, 2013 12:48 am

Bold Chapter headings

Post by sherrre »

Hello,

I'm trying to alter the style file that my university provided so that chapter headings are bold, similar to the section and subsection labels. Unfortunately, the attempted changes I have made succeeded in making all the text in the document bold. Any help or hints would be appreciated.

Ryan

Code: Select all

\def\chapter{\clearpage \thispagestyle{plain} \global\@topnum\z@
\@afterindenttrue \secdef\@chapter\@schapter} 
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
 \refstepcounter{chapter}
 \typeout{\@chapapp\space\thechapter.}
 {\def\\{}
 \addcontentsline{toc}{chapter}{\protect
 \numberline{\thechapter}#1}}\else {\def\\{}
 \addcontentsline{toc}{chapter}{#1}}\fi
 \chaptermark{#1}
 \addtocontents{lof}{\protect\addvspace{10pt}}
\addtocontents{lot}{\protect\addvspace{10pt}} \if@twocolumn
\@topnewpage[\@makechapterhead{#2}] 
 \else \@makechapterhead{#2}
 \@afterheading \fi} 
\def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}]
 \else \@makeschapterhead{#1} 
 \@afterheading\fi}
Last edited by cgnieder on Wed Jan 30, 2013 10:20 am, edited 1 time in total.

Recommended reading 2024:

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

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

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Bold Chapter headings

Post by Stefan Kottwitz »

Hi Ryan,

welcome to the board!

This code doesn't make all the text bold. When I extend it to a compilable document, the standard text isn't bold:

Code: Select all

\documentclass{report}
\makeatletter
\def\chapter{\clearpage \thispagestyle{plain} \global\@topnum\z@
\@afterindenttrue \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
 \refstepcounter{chapter}
 \typeout{\@chapapp\space\thechapter.}
 {\def\\{}
 \addcontentsline{toc}{chapter}{\protect
 \numberline{\thechapter}#1}}\else {\def\\{}
 \addcontentsline{toc}{chapter}{#1}}\fi
 \chaptermark{#1}
 \addtocontents{lof}{\protect\addvspace{10pt}}
\addtocontents{lot}{\protect\addvspace{10pt}} \if@twocolumn
\@topnewpage[\@makechapterhead{#2}]
 \else \@makechapterhead{#2}
 \@afterheading \fi}
\def\@schapter#1{\if@twocolumn \@topnewpage[\@makeschapterhead{#1}]
 \else \@makeschapterhead{#1}
 \@afterheading\fi}
\makeatother
\begin{document}
\chapter{Test}
text
\end{document}
Click on "Open in writeLaTeX" above the code box to easily verify it online.

Please post a Infominimal working example which shows the problem. As you can see, a code snippet doesn't help if the cause is somewhere else. You could additionally post the style file as attachment.

Stefan
LaTeX.org admin
sherrre
Posts: 3
Joined: Wed Jan 30, 2013 12:48 am

Re: Bold Chapter headings

Post by sherrre »

Stefan,

Thank you for your reply. I'm not sure how to post a minimal working example, but I have attached the style file I am trying to modify to this post.

I should have made it more clear that any changes I made to the file resulted in the entire text being bold. I have posted the original (unchanged) file to this post.

Thank you again,

Ryan
Attachments
aums.sty
(11.3 KiB) Downloaded 517 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Bold Chapter headings

Post by Stefan Kottwitz »

sherrre wrote:any changes I made to the file resulted in the entire text being bold.
We should see the changes to be able to say what's wrong with them.

Besides that, the style file seems defective. When I try, as recommended in the style file, with report and ulem:

Code: Select all

\documentclass[11pt]{report}
\usepackage{aums,ulem}
\usepackage{aums}
\begin{document}
\chapter{Test}
text
\end{document}
I already get an error

Code: Select all

! Missing number, treated as zero.
<to be read again> 
                   \let 
l.7 \end{document}
Either the style file is bad or it's modified and not the original one. Perhaps show how you use it, i.e. which code you used, in a meaning of a Infominimal working example, showing the problem.

I wonder why you use the style file but modify it. If a style file is required or recommended, it should not be changed. If it's not required, and you would like to have a different layout, don't use it but start from a standard class and customize that one.

When I see the style file, I would say: it's not much, doesn't seem to be specifically good what couldn't be easily done otherwise, and it's very old (1989, with a small update in 2009). No need to use it if it's not a must, I'd say.

Stefan
LaTeX.org admin
sherrre
Posts: 3
Joined: Wed Jan 30, 2013 12:48 am

Re: Bold Chapter headings

Post by sherrre »

Stefan,

The style file that I uploaded is not required. The grad students struggle with and accept the outdated style file because the alternative is using Microsoft Word. I would be fine customizing a standard class file to suite my needs.

Is there a standard file that you would recommend using? I would be happy to attempt to modify it, and ask questions to the Latex Community as needed.

Ryan
User avatar
svend_tveskaeg
Posts: 478
Joined: Sun Jul 12, 2009 5:31 am

Bold Chapter headings

Post by svend_tveskaeg »

sherrre wrote:I would be fine customizing a standard class file to suite my needs.

Is there a standard file that you would recommend using?
If it is a large assignment, e.g. a project, or (especially) a thesis, I would strongly recommend the memoir class.

For small works, article is a good choice.
``In the game of chess, you can never let your adversary see your pieces.''
-- Zapp Brannigan, Futurama (season 1, episode 4)
Post Reply