6

I would like the subsections to be enumerated with a paragraph sign and a integer/number. (P)1, (P)2, (P)3 etc. Currently it is (P)0.1, (P)0.2, (P)0.3 etc.

\documentclass{article}
\usepackage[paper=a4paper]{geometry}% http://ctan.org/pkg/geometry

\renewcommand{\familydefault}{\sfdefault}

\font\titlefont=cmr12 at 40pt

%\font\titlefont\sfdefault

%\renewcommand{\titlefont}{\sfdefault}

\renewcommand{\thesection}{\S\arabic{section}}

\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{listings}
\lstdefinestyle{DOS}
{
    backgroundcolor=\color{black},
    basicstyle=\scriptsize\color{white}\ttfamily
}

\lstdefinestyle{R}
{
    basicstyle=\small\ttfamily,
    stringstyle=\color{DarkGreen},
    otherkeywords={0,1,2,3,4,5,6,7,8,9},
    morekeywords={TRUE,FALSE},
    deletekeywords={data,frame,length,as,character},
    keywordstyle=\color{blue},
    commentstyle=\color{DarkGreen},
    backgroundcolor=\color{yellow}
}

\usepackage{hyperref}
\hypersetup{
     colorlinks   = true,
     linkcolor = blue
}

\usepackage{natbib}
\usepackage{graphicx}

\usepackage{afterpage}
\usepackage{xcolor}

\usepackage{epigraph}
\setlength\epigraphwidth{.8\textwidth}
\setlength\epigraphrule{0pt}


\begin{document}
\pagenumbering{gobble}% Remove page numbers (and reset to 1)

\topskip0pt
\vspace*{\fill}
\begin{center}
\color{white}{
  \titlefont 
  {\fontfamily{cmss}\selectfont
   \scalebox{5}{Front page} 
  }

  }
\end{center}
\vspace*{\fill}

\pagecolor{purple}\afterpage{\nopagecolor}

\newpage
\newgeometry{top=1in,bottom=1in,right=1.5in,left=1.5in}
\pagenumbering{arabic}% Arabic page numbers (and reset to 1)

\newpage

\section*{\centering Section title in middle working}

\subsection*{Subsection title without paragraph sign and numbering working}

\subsection{Subsection title with paragraph sign and numbering error}

\end{document}
0

1 Answer 1

6

Adding \renewcommand{\thesubsection}{\S\arabic{subsection}} to your preamble will give you this:

enter image description here

Code

\documentclass{article}
\usepackage[paper=a4paper]{geometry}% http://ctan.org/pkg/geometry

\renewcommand{\familydefault}{\sfdefault}

\font\titlefont=cmr12 at 40pt

%\font\titlefont\sfdefault

%\renewcommand{\titlefont}{\sfdefault}

\renewcommand{\thesection}{\S\arabic{section}}
\renewcommand{\thesubsection}{\S\arabic{subsection}}


\usepackage[utf8]{inputenc}
\usepackage{xcolor}
\usepackage{listings}
\lstdefinestyle{DOS}
{
    backgroundcolor=\color{black},
    basicstyle=\scriptsize\color{white}\ttfamily
}

\lstdefinestyle{R}
{
    basicstyle=\small\ttfamily,
    stringstyle=\color{DarkGreen},
    otherkeywords={0,1,2,3,4,5,6,7,8,9},
    morekeywords={TRUE,FALSE},
    deletekeywords={data,frame,length,as,character},
    keywordstyle=\color{blue},
    commentstyle=\color{DarkGreen},
    backgroundcolor=\color{yellow}
}

\usepackage{hyperref}
\hypersetup{
     colorlinks   = true,
     linkcolor = blue
}

\usepackage{natbib}
\usepackage{graphicx}

\usepackage{afterpage}
\usepackage{xcolor}

\usepackage{epigraph}
\setlength\epigraphwidth{.8\textwidth}
\setlength\epigraphrule{0pt}



\begin{document}
\pagenumbering{gobble}% Remove page numbers (and reset to 1)

\topskip0pt
\vspace*{\fill}
\begin{center}
\color{white}{
  \titlefont 
  {\fontfamily{cmss}\selectfont
   \scalebox{5}{Front page} 
  }

  }
\end{center}
\vspace*{\fill}

\pagecolor{purple}\afterpage{\nopagecolor}

\newpage
\newgeometry{top=1in,bottom=1in,right=1.5in,left=1.5in}
\pagenumbering{arabic}% Arabic page numbers (and reset to 1)

\newpage

\section*{\centering Section title in middle working}

\subsection*{Subsection title without paragraph sign and numbering working}

\subsection{Subsection title with paragraph sign and numbering error}

\subsection{Another subsection}

\section*{\centering Another section}

\subsection{Another subsection}

\subsection{Another subsection}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .