4

How can i change the following code to make the chapter title font size bigger?

\titleformat{\chapter}[block]
{\normalfont\sffamily}{}{0pt}
{\parbox[b]{\chapnumb}{%
\fontsize{120}{110}\selectfont\thechapter}%
\parbox[b]{\dimexpr\textwidth-\chapnumb\relax}{%
\raggedleft%
\hfill{\LARGE#1}\\
\rule{\dimexpr\textwidth-\chapnumb\relax}{0.4pt}}}

The above code reproduce this: enter image description here

and i would like to be like this: enter image description here

Code is taken from the following post: Chapter style like this without memoir?

thanks in advance

  • Hi and welcome. Your question, aas it stands now, is a bit unclear. Can you give us some more information, probably even showing us a minimal working example (MWE) (including the documentclass) and what you want? – Johannes_B Oct 18 '14 at 19:07
  • Change \LARGE to whatever you need. – Andrew Swann Oct 18 '14 at 19:09
  • Thank you for the welcoming! I edit my question to be more clear. – Mpizos Dimitris Oct 18 '14 at 19:19
3

The use of the [explicit] option to titlesec forces the user to input #1 for the title format. You'll note a reference to \LARGE#1 within the definition of \titleformat for \chapter (both). Adjust this to suit your needs.

Below I've updated the font reference so you can (re)define \chaptertitlefont:

enter image description here

\documentclass{book}
\usepackage[explicit]{titlesec}
\usepackage{lmodern,lipsum}

\newlength\chapnumb
\setlength\chapnumb{4cm}
\newcommand{\chaptertitlefont}{\normalfont\sffamily\Huge}

\titleformat{\chapter}[block]
{\normalfont\sffamily}{}{0pt}
{\parbox[b]{\chapnumb}{%
   \fontsize{120}{110}\selectfont\thechapter}%
  \parbox[b]{\dimexpr\textwidth-\chapnumb\relax}{%
    \raggedleft%
    \hfill{\chaptertitlefont#1}\\
    \rule{\dimexpr\textwidth-\chapnumb\relax}{0.4pt}}}
\titleformat{name=\chapter,numberless}[block]
{\normalfont\sffamily}{}{0pt}
{\parbox[b]{\chapnumb}{%
   \mbox{}}%
  \parbox[b]{\dimexpr\textwidth-\chapnumb\relax}{%
    \raggedleft%
    \hfill{\chaptertitlefont#1}\\
    \rule{\dimexpr\textwidth-\chapnumb\relax}{0.4pt}}}

\begin{document}

\chapter*{A Long Title for an Unnumbered Test Chapter}
\lipsum[4]
\chapter{Introduction}
\lipsum[4]

\end{document}

The above changes the font to \Huge. If you want larger font sizes, see Fonts larger than \Huge?

  • thanks for the anwer.The code u provide outputs an error.I guess its because i have to define the title font.My question is how can i do that? – Mpizos Dimitris Oct 18 '14 at 19:36
  • @MpizosDimitris: So when you copy-and-paste-and-compile the code above, it outputs an error? What is the error? Do you have all the packages installed? – Werner Oct 18 '14 at 20:08
  • ! Undefined control sequence.<argument> ...gedleft \hfill {\chaptertitleformatIntroduction}\\ \rule {\di... \chapter{Introduction} and C:\Users\Administrator\Desktop\Thesis\latex\Appendices/AppendixA.tex .I think i have the puckages needed installed as the code that I post is running normally. Or maybe i need an additional package regarding ur code? – Mpizos Dimitris Oct 18 '14 at 20:11
  • @MpizosDimitris: I've corrected the example code... – Werner Oct 18 '14 at 20:23
3

A slighly simpler version, using the specific commands defined in the titlesec package (\titlerule, filleft and the like), plus some colour.

\documentclass[12pt, a4paper]{book}% http://ctan.org/pkg/amsproc

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage[x11names]{xcolor}
\usepackage[explicit]{titlesec}%
\newlength\rulew
\titleformat{\chapter}[block]
{\filleft\sffamily\bfseries}
{\fontsize{120}{120}\selectfont\textcolor{LightSteelBlue3!80!}{\thechapter}\hskip8mm\titlerule[0.8pt]}
{0em}
{\fontsize{32}{36}\bfseries\llap{\parbox[b]{0.7\linewidth}{\filleft#1\vskip0.6ex}}}%
\titlespacing*{\chapter}{0pt}{-45pt}{18ex}

\usepackage{lipsum}

\begin{document}

 \chapter{A Chapter Title\\with a Subtitle}

 \lipsum[2]

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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