Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to change the font and format of heading using titlesec package. However it gives me the following error.

Missing { inserted \tableofcontents <br>
Missing { inserted \chapter{Introduction} 

The code:

\documentclass[10pt, letterpaper]{report}
\usepackage{thesis}


\usepackage{titlesec}
\renewcommand{\chaptername}{CHAPTER}{\Large}
\titlespacing*{\chapter}{0pt}{0.5in}{0.3in}
\titleformat{\chapter}[display]
        {\normalfont\Large\centering\uppercase}{\chaptertitlename\ \thechapter}{0pt}{\Large}
\titleformat{\section}{\large\bfseries}{\thesection}{1em}{}


\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \tableofcontents

\chapter{Introduction}

Some text.

\end{document}
share|improve this question
    
Note that the renewal of your \chaptername doesn't have the correct format - only 2 arguments are required: \renewcommand{\chaptername}{CHAPTER}. The {\Large} has no meaning within the document preamble. –  Werner Jun 7 '12 at 19:12

1 Answer 1

up vote 9 down vote accepted

\uppercase requires a parameter, which is not supported in this argument of \titleformat. But it's supported within another argument, that's why this works:

\titleformat{\chapter}[display]
        {\normalfont\Large\centering}{\chaptertitlename\ \thechapter}{0pt}{\Large\uppercase}

The very last command in the last mandatory argument here can take an argument, which is the title text.

example

share|improve this answer
    
Thanks Stefan, Worked for me. –  learner Jun 7 '12 at 19:13
1  
Probably \MakeUppercase is better than \uppercase. If one wants to specify more complex management of the title, one can load titlesec with the explicit option and then it's required to specify the title with #1. –  egreg Jun 7 '12 at 20:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.