3

How can I change font size of lstlistoflistings heading? Currently it is smaller than normal chapter heading title. Any ideas?

Unfortunately I need to use document class from my university, my MWE: MWE:

\documentclass{aghdpl}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc}

\usepackage{enumerate}
\usepackage{listings}

\begin{document}


\tableofcontents
\clearpage

\chapter{Lorem ipsum}


\begin{lstlisting}[language=Java, caption=Caption,label=lst:registry]
public interface IRegistry
{
    void Register(Device device);
    List<Device> GetAll();
    Device GetByUuid(UUID uuid);
}
\end{lstlisting}


\addcontentsline{toc}{chapter}{Listings}
\lstlistoflistings

\bibliographystyle{alpha}
\bibliography{bibliografia}

\end{document}

Document class is available here: https://www.sharelatex.com/project/5400ba9cf95f88391849bde8

When I've used article document class lstlistoflistings had same size as chapter size so probably it is connected to the document class :(. Unfortunately my tex knowledge is to small to solve this issue.

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – jub0bs Aug 29 '14 at 17:32
  • 1
    It's set as a \chapter*, which should be the same as the rest of the chapters. Could you provide the community with a minimal working example (MWE) that replicates your problem seeing as it's otherwise unlikely to be resolved. Your MWE should start with \documentclass and end with \end{document}. – Werner Aug 29 '14 at 17:34
  • @Jubobs I've added MWE and more details. – radzio Aug 29 '14 at 17:56
2

Within your aghdpl.cls class file, you'll see that chapters are set using a font size \LARGE (line 191-192):

\titleformat{\chapter}[block]
{\bfseries\LARGE}{\filright \LARGE\thechapter. }{0ex}{}

However, ToC-related entries are set using only \Large (line 209):

\renewcommand{\cfttoctitlefont}{\bfseries\Large}

Since \lstlistoflistings is set just like your regular \tableofcontents, it will be smaller. You can adjust \cfttoctitlefont to match that of regular chapters by adding

\renewcommand{\cfttoctitlefont}{\bfseries\LARGE}

somewhere in your document preamble.

enter image description here

\documentclass{aghdpl}
\usepackage[polish]{babel}
\usepackage[utf8]{inputenc}

\usepackage{enumerate}
\usepackage{listings}

\renewcommand{\cfttoctitlefont}{\bfseries\LARGE}

\begin{document}

\tableofcontents
\clearpage

\chapter{Lorem ipsum}

\begin{lstlisting}[language=Java, caption=Caption,label=lst:registry]
public interface IRegistry
{
    void Register(Device device);
    List<Device> GetAll();
    Device GetByUuid(UUID uuid);
}
\end{lstlisting}


\addcontentsline{toc}{chapter}{Listings}
\lstlistoflistings

\end{document}
|improve this answer|||||
  • Thanks a lot! Your solution is the answer. Have a nice weekend. – radzio Aug 29 '14 at 20:34

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.