# Paragraph Referencing

The t-pararef module understands a paragraph as a full closed block of one thought. This means that inside a paragraph enumerations, formulas etc. can appear. That is why a paragraph must be defined manually via \startParagraph and \stopParagraph.

## Paragraphs

Each paragraph gets numbered started by each title. In order to link to a paragraph it can be reference by the optional parameter reference=... as a text reference.

One or more paragraphs can be summarized by a low level title which is displayed as a margin note (margin title) via the optional parameter title=....

 \startParagraph[reference=...,title=...]
...
\stopParagraph


Here how a single paragraph with a title looks like:

\usemodule[pararef]

\starttext
\input tufte
\stopParagraph
\stoptext


## References

Now the more practical part: the paragraph referencing. To reference to an paragraph the package pararef makes use of the crossref module.

Here a simple usage example:

\usemodule[pararef]
\usemodule[crossref]

\starttext

\startchapter[title={Lorem ipsum}]
\startsection[title={Dolor sit}]

\startParagraph
\input tufte
\stopParagraph

\startParagraph[reference=ref1]
\input tufte
\stopParagraph

\startParagraph
Here are two references to destinations on the same page:
\startitemize[nowhite]
\item ref1 should be: para. 1.1/2 and is: \crossref[label={para.}][ref1]
\item ref2 should be: sec. 1.2 and is: \crossref[label={sec.}][ref2]
\stopitemize
Here is one references with brakets:
\startitemize[nowhite]
\item ref1 should be: (para. 1.1/2) and is: \crossref[left={(},right={)},label={para.}][ref1]
\stopitemize
\stopParagraph

\stopsection
\startsection[title={Amet},reference=ref2]

\page

\startParagraph
Here are two references to destinations on an other page:
\startitemize[nowhite]
\item ref1 should be: para. 1.1/2 on page 1 and is: \crossref[label={para.}][ref1]
\item ref2 should be: sec. 1.2 on page 1 and is: \crossref[label={sec.}][ref2]
\stopitemize
\stopParagraph

\stopsection
\stopchapter
\stoptext


## Text part divider

Each section (subsection, subsubsection etc.) has mostly three parts:

• introduction part,
• one or several main parts and
• summary part.

Each part contains one or more paragraphs. To make the logic parts visible the parts are divided by a line \textpartdivider.

\usemodule[pararef]

\starttext

\startsection[title={Lorem ipsum}]
\startParagraph
Some introduction text \input tufte
\stopParagraph

\textpartdivider

\dorecurse{3}{
\startParagraph
Some main theme text \input tufte
\stopParagraph
}

\textpartdivider

\startParagraph
Some section summarizing text \input tufte
\stopParagraph

\stopsection
\startsection[title={Doloris sit}]
...
\stopsection
\stoptext


## Settings

In pararef the colors can be set via two paramters:

• textpartdividerColor for the color of the line and
• paragraphNumberColor for the number of the paragraph.

They are defined as parameters of the module:

\usemodule[pararef][textpartdividerColor=...,paragraphNumberColor=...]
...


For now the color and style of the paragraph title has to be set via the normal outer margin settings.