Changing the style of my sections using the package titlesec
works fine with these lines
\usepackage{titlesec}
\titleformat{\section}[block]{\large\scshape\centering{\Roman{section}.}}{}{1em}{}
but after adding my literature to the end of the file…
\bibliographystyle{plain}
\bibliography{literature}
…the counter doesn't increase and the spacing is not entirely correct for the references section. However, the heading has the defined section style. Do you have a solution for having a consistent counter?
Best Answer
It's not convenient to include the counter in the second argument of
\titleformat
; this will cause starred sections to be numbered in an "unorthodox" way, as the following simple example shows:This produces the following wrong result (the numbering is wrong, the spacing between the number and the title is wrong and the counter for subordinate sectional units isn't reset appropriately):
The right way to proceed here is to redefine
\thesection
previously to use Roman numerals, as the following example illustrates:If you want to number the bibliography section, you can use the
etoolbox
package to patch the\thebibliography
command to use\section
instead of the default\section*
:Not related to the original problem but
\centering
doesn't have arguments, so instead of\centering{text}
one should use something like{\centering text\par}
(the braces are only required if it is necessary to explicitly group to keep the effect local).