I'm writing a thesis and sections are required to have roman numerals in both the toc and the document itself. The pertinent document code looks like this:
\documentclass[twoside,12pt]{report}
%%%%%%%%%%%%%%%%%%%Preamble%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%PACKAGES TO USE IN THE DOCUMENT:
\usepackage[indentfirst]{titlesec} %To allow for formatting section titles
\usepackage{ragged2e} %To allow for indentation with the raggedright command
%%%%%%%SET SECTION HEADING FORMATTING
\titleformat*{\section}{\Centering\normalsize\bfseries\uppercase}{\renewcommand\thesection{\Roman{section}.}
\titleformat*{\subsection}{\RaggedRight\normalsize\bfseries\uppercase}
\titleformat*{\subsubsection}{\RaggedRight\normalsize\bfseries}
\renewcommand\thesection{\Roman{section}.}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\SweaveOpts{concordance=TRUE}
\section{First Section}
\section{Second Section}
\subsection*{First Subsection}
\end{document}
This code gives me titles formatted according to my specifications, but the \renewcommand\thesection{\Roman{section}.}
code only seems to affect the toc, not the actual section titles. As you can see, I have the command both on its own and with the \titleformat
command, but neither one produces results. How can I get the number to show up in the actual section title?