2

For "law-documents" you often want to enumerate every paragraph and cite them somewhere else in your document. This enumeration shall increase through the whole document and have the possibility to reference.

So I want to have something like that:

\p{mylabel} Lorem ipsum dolor sit amet...

Another without label \c{mylabel}.

Which shall be (with numbers in margin):

1  Lorem ipsum dolor sit amet...

2  Another without label (cf. mn. 1).

Doesn't matter if clickable in PDF or not so far.

Is there a package for that or some style? Would be great! Thanks in advance!

Una
  • 189
LeMike
  • 121

1 Answers1

3

What about simply using an empty \paragraph sectioning command?

\documentclass{article}

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

\begin{document}
\paragraph{}\label{mylabel} Lorem ipsum dolor sit amet...
\paragraph{} Another without label (cf. mn. \ref{mylabel}).
\end{document} 

enter image description here

and, if you don't like the spacing, use the \titlespacing command from the titlesec package?

\documentclass{article}
\usepackage{titlesec}

\setcounter{secnumdepth}{4}
\renewcommand{\theparagraph}{\arabic{paragraph}}
\titlespacing*{\paragraph}{0pt}{1em}{1em}

\begin{document}
\paragraph{}\label{mylabel} Lorem ipsum dolor sit amet...
\paragraph{} Another without label (cf. mn. \ref{mylabel}).
\end{document} 

enter image description here

Moreover, you can adjust the number with the command \titleformat

\documentclass{article}
\usepackage{titlesec}

\setcounter{secnumdepth}{4}
\renewcommand{\theparagraph}{\arabic{paragraph}}
\titlespacing*{\paragraph}{0pt}{1em}{1em}
\titleformat{\paragraph}[runin]{\normalfont\normalsize}{\theparagraph}{1em}{}

\begin{document}
\paragraph{}\label{mylabel} Lorem ipsum dolor sit amet...
\paragraph{} Another without label (cf. mn. \ref{mylabel}).
\end{document}

enter image description here

karlkoeller
  • 124,410
  • Just great! But which commands do LaTeX for automatically have paragraphs? I would rather rewrite that and give the opportunity to disable such enumeration. So (%=newline due to no markup in comments -.-):
    foo%
    

    % bar% % \nop baz%

    Instead of

    \p foo%
    \p bar%
    baz%
    
    – LeMike Nov 01 '13 at 11:03
  • @MikePretzlaw When you want to disable numbering, simply add \let\newpar\paragraph \renewcommand{\paragraph}[1]{\newpar*{#1}} in the preamble. – karlkoeller Nov 01 '13 at 12:50
  • +1 for simplicity :) On the other hand, this solves the easy part of the problem, the question how to do it automatically still remains open... – yo' Nov 01 '13 at 13:59
  • @tohecz Thanks. About automating the process, probably you better than me know a solution ;-) – karlkoeller Nov 01 '13 at 15:06