\begin{center}
\section*{\textcolor{blue}{Ukaaranta }}
\end{center}
\subsection*{Shabhu Harivat}
\addcontentsline{toc}{subsection}{shambhu harivat}
\begin{center}
\section*{\textcolor{blue}{Krostru Shabda}}
\end{center}
I have a need to create something like this, however when I run this program, it gives error at the second \end{center}
.
Funny but the same command works above. I did not do anything different, just copy pasted and changed the text.
Similar commands elsewhere in the document work just fine. I have no clue why it's behaving like this.
Hit ? and R – enter and it gives the desired output but it's a pain to do that every time.
Best Answer
If you want to centre your titles and make them blue, then redefine the title format using a package like
titlesec
. If all your sections and subsections are going to be unnumbered, redefine them that way, also withtitlesec
. If you don't want numbers in your table of contents, set thesecnumdepth
to 0. Here's an example:(You can adjust the vertical spacing of the titles also with
titlesec
using the\titlespacing
command.)