18

How can I redefine the paragraph counter such that instead of revealing all superior counters, it only reveals the paragraph counter. I assume this is possible with titlesec.

I would like to have each paragraph numbered like §1, §2, §3, etc.

See minimal example below:

\documentclass[12pt]{article}
\usepackage{fontspec}

\newcounter{paragraphstep}
\newcommand{\paracount}{%
        \stepcounter{paragraphstep}%
        \theparagraphstep}
        \setcounter{secnumdepth}{6}

\begin{document}

\paragraph{}\label{Personal Statement}
San Francisco is a city in California. See paragraph \ref{Personal Statement}.

\end{document}

This question is related to:

  • Add the line \renewcommand{\theparagraph}{\S~\arabic{paragraph}} – karlkoeller Aug 5 '13 at 6:01
20

By default paragraphs are numbered within subsections, restarting at 1 at each subsection. If you just wish to changed the printed representation of the paragraph number then all you need is

\renewcommand{\theparagraph}{\S\arabic{paragraph}}
\setcounter{secnumdepth}{4}

If you wish the paragraphs to also be numbered consecutively throughout the document then you can use the chngcntr package's command \counterwithout to undo the resetting as follows:

Sample output

\documentclass[12pt]{article}

\usepackage{chngcntr}
\counterwithout{paragraph}{subsubsection}
\renewcommand{\theparagraph}{\S\arabic{paragraph}}
\setcounter{secnumdepth}{4}

\begin{document}

\section{First section}

\paragraph{}\label{Personal Statement}
San Francisco is a city in California.

\subsection{A subsection}

\paragraph{}
San Francisco is a city in California.  See paragraph \ref{Personal
Statement}.

\subsubsection{A subsubsection}

\paragraph{}
San Francisco is a city in California.

\section{Second section}

\paragraph{}
San Francisco is a city in California. See paragraph \ref{Personal Statement}.

\paragraph{}
San Francisco is a city in California.


\end{document}

Added in response to comment To adjust the spacing after numbers etc. it is probably easiest to use the titlesec package. There are two commands involved here: \titleformat and \titlespacing. If you never intend to give titles to your paragraphs then the \titlespacing command below is sufficient. The \titleformat command makes sure words in a paragraph heading are also handled appropriately:

Sample output

\documentclass[12pt]{article}

\usepackage{chngcntr}
\counterwithout{paragraph}{subsubsection}
\renewcommand{\theparagraph}{\S\arabic{paragraph}}
\setcounter{secnumdepth}{4}

\usepackage{titlesec}
\titleformat{\paragraph}[runin]{\normalfont\bfseries}{\theparagraph}{\wordsep}{}
\titlespacing{\paragraph}{0pt}{3.25ex plus 1ex minus .2ex}{\wordsep}

\begin{document}

\section{First section}

\paragraph{}\label{Personal Statement}
San Francisco is a city in California.

\subsection{A subsection}

\paragraph{}
San Francisco is a city in California.  See paragraph \ref{Personal
Statement}.

\subsubsection{A subsubsection}

\paragraph{}
San Francisco is a city in California.

\section{Second section}

\paragraph{}
San Francisco is a city in California. See paragraph \ref{Personal Statement}.

\paragraph{With title}
San Francisco is a city in California.

\end{document}

The arguments given to \titlespacing are as follows:

  • section command = \paragraph
  • left indent = 0pt
  • above vertical skip = 3.25ex plus 1ex minus .2ex the standard value from the article class
  • final separation = \wordsep an ordinary word space

For \titleformat the spcification is

  • section command = \paragraph
  • style = runin for heads contain in the same paragraph as the text
  • format = \normalfont\bfseries for styling the heading
  • label = \theparagraph the printed representation of the section number
  • sep = \wordsep is the space between the label and the title (when present)
  • before code = empty
|improve this answer|||||
  • Thanks! How would I remove the extra space such that there is only a normal space between the number and the first word of each paragraph? Also, I assume making it not bold is also doable within the \renewcommand. – Jonathan Komar Aug 5 '13 at 9:34
  • @macmadness86 Value 4 for the counter secnumdepth is enough to show paragraph numbers. – karlkoeller Aug 5 '13 at 15:46
6

You can use package scrjura of KOMA-Script.

An example could be (as @harish requested in his comment ;-):

\documentclass[%
  ngerman
 ,paper=a4
 ,fontsize=12pt
 ,parskip=half-
 ,pagesize
 ,numbers=noenddot
]{scrartcl}% scrreprt scrartcl

\usepackage{babel}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[%
  juratotoc%=1              % juratotoc=0 0 chapter, 1 section
 ,paragraphmark=forceboth
 ,juratocnumberwidth=2.5em
]{scrjura}  

\usepackage{enumerate}

\makeatletter
% to get rid of a warning ...
\providecommand*{\toclevel@cpar}{0}
\makeatother


\begin{document}

\subject{Subject}
\title{Title}
\subtitle{Subtitle}
\author{}   % no author: {} empty
%\date{}    % no date

\maketitle  % setzt den Titel der Satzung

\addsec{Preface}
A preface, if you need it.


%\clearpage 
\appendix % Letters instead of numbers

\section{Section One}
\begin{contract}
\Paragraph{title={Title first paragraph}}
The content of first paragraph.

A list of posibilities:
\begin{enumerate}[\qquad a)]
  \item first.
  \item second.
  \item third.
\end{enumerate}

The content of third paragraph.
\end{contract}

\section{Section Two}
\begin{contract}
\Paragraph{title={Title first paragraph}}
The content of first paragraph.
\end{contract}

\end{document} 

With the result:

enter image description here

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.