[Tex/LaTex] How to remove the chapter number from section number?

formattingnumberingsectioning

I use Roman for Chapter numbers, and I don't want sections to be numbered as VIII.2 (while I still want sections to be numbered within chapters). How do I do that?

i.e. instead of VIII.2 sections should be numbered as 2.

EDIT: I saw the other question that people mark this one as a duplicate to. I tried \renewcommand*\thesection{\arabic{section}} and \renewcommand\thesection{\arabic{section}}, but none of them worked. That's why I asked this question.

2nd Edit: Sorry, now it is solved. I had \numberwithin{section}{chapter} after that. After removing it everything is fine.

Best Answer

Try something like \renewcommand\thesection{\arabic{section}} somewhere before \begin{document}. This should work, if not please provide an example of your code, so we can try it.

\documentclass{book}
\usepackage[T1]{fontenc}
\renewcommand\thesection{\arabic{section}}
\begin{document}

\chapter{Heading}

\section{Something else}

\end{document}

Screenshot of the code above

Related Question