[Tex/LaTex] How to get default formatting for \chapter, \section, etc.

sectioningtitlesec

I'd like to use titlesec to make some modifications to section and chapter headings, but titleformat redefines the formatting entirely instead of just making modifications (e.g. if I just want to change the colour).

How do I get titlesec to modify instead of entirely redefine? Is this possible?

If not, how do I figure out what is the current formatting of \chapter, \section, etc. so that I can replicate it and make my modifications?


In response the request for a sample document, I guess the most basic is:

\documentclass{article}
\begin{document}
\section{Hello World}
Hello world!
\end{document}

However, I'm interested in a way to find out (e.g. to print out) the current formatting of \section instead of simply "knowing" it for a particular configuration.

Best Answer

For simple modifications such as the title colour, you can use the light version of \titleformat, but have to check in article.cls (or report, or book) what the values of the parameters are (fontsize, weight, shape).

Here is an example:

\documentclass[a4paper]{article}
\usepackage[svgnames]{xcolor}
\usepackage{titlesec}
\titleformat*{\section}{\color{IndianRed}\normalfont\bfseries\Large}

\begin{document}

\section{A short title}
This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph. This is a paragraph.

\end{document} 

enter image description here

Related Question