Difference between revisions of "Paragraph Referencing"

From Wiki
Jump to navigation Jump to search
m
Line 2: Line 2:
  
 
This module understands a paragraph as a full closed block of one thought. This means that inside a paragraph enumerations, formulas etc. can apear. That is why a paragraph must be defined manuelly via <code>\startParagraph</code> and <code>\stopParagraph</code>.
 
This module understands a paragraph as a full closed block of one thought. This means that inside a paragraph enumerations, formulas etc. can apear. That is why a paragraph must be defined manuelly via <code>\startParagraph</code> and <code>\stopParagraph</code>.
 +
 +
==Paragraphs==
  
 
Each paragraph gets numbered started by each title. In order to link to a paragraph it can be reference by the optional parameter <code>reference=...</code> as a text reference.
 
Each paragraph gets numbered started by each title. In order to link to a paragraph it can be reference by the optional parameter <code>reference=...</code> as a text reference.
Line 13: Line 15:
 
</texcode>
 
</texcode>
  
<div style="background: #FFFFDD">Singe paragraph: code and result</div>
+
Here how a single paragraph with a title looks like:
  
 
<texcode>
 
<texcode>
Line 25: Line 27:
 
</texcode>
 
</texcode>
  
<div style="background: #FFFFDD">Multi paragraphs and references: code and result</div>
+
==References==
 +
 
 +
Now the more practical part: the paragraph referencing. To reference to an paragraph the package pararef contains the function <code>\crossref</code>
 +
 
 +
<texcode>
 +
\crossref[<reference>]
 +
\crossref[brakets=...,text=...][<reference>]
 +
</texcode>
 +
 
 +
Here a simple usage example:
 +
 
 +
<texcode>
 +
\usemodule[pararef]
 +
 
 +
\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[text={para.}][ref1]
 +
\item ref2 should be: sec. 1.2 and is: \crossref[text={sec.}][ref2]
 +
\stopitemize
 +
Here is one references with brakets:
 +
\startitemize[nowhite]
 +
\item ref1 should be: para. 1.1/2 and is: \crossref[brakets=yes,text={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[text={para.}][ref1]
 +
\item ref2 should be: sec. 1.2 on page 1 and is: \crossref[text={sec.}][ref2]
 +
\stopitemize
 +
\stopParagraph
 +
 
 +
\stopsection
 +
\stopchapter
 +
\stoptext
 +
</texcode>
 +
 
 +
==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 <code>\textpartdivider</code>.
 +
 
 +
<texcode>
 +
\usemodule
 +
 
 +
\starttext
 +
 
 +
\startsection[title={Lorem ipsum}]
 +
\startParagraph
 +
Some introduction text \input tufte
 +
\stoptext
 +
 
 +
\textpartdivider
 +
 
 +
\dorecurse[3]{
 +
\startParagraph
 +
Some main theme text \input tufte
 +
\stoptext
 +
}
 +
 
 +
\textpartdivider
 +
 
 +
\startParagraph
 +
Some section summarizing text \input tufte
 +
\stoptext
 +
 
 +
\stopsection
 +
\startsection[title={Doloris sit}]
 +
...
 +
\stopsection
 +
\stoptext
 +
</texcode>
 +
 
 +
==Settings==
 +
 
 +
Often references (or links) are printed in a different color than the normal text. In pararef the colors can be set via three paramters:
 +
* <code>crossrefColor</code> for the entire reference text,
 +
* <code>textpartdividerColor</code> for the color of the line and
 +
* <code>paragraphNumberColor</code> for the number of the paragraph.
 +
 
 +
They are defined as parameters of the module:
 +
<texcode>
 +
\usemodule[bgcolor][crossrefColor=...,textpartdividerColor=...,paragraphNumberColor=...]
 +
...
 +
</texcode>
 +
 
 +
The brakets and text part for <code>\crossref</code> can also be adjusted or extended with other languages:
 +
 
 +
<texcode>
 +
\setupparareftext[en][braketOpen={(}]
 +
\setupparareftext[en][braketClose={)}]
 +
\setupparareftext[en][atpageLeft={ on page }]
 +
\setupparareftext[en][atpageRight={}]
 +
\setupparareftext[de][braketOpen={(}]
 +
\setupparareftext[de][braketClose={)}]
 +
\setupparareftext[de][atpageLeft={ auf Seite }]
 +
\setupparareftext[de][atpageRight={}]
 +
</texcode>
 +
 
 +
For now the color and style of the paragraph title has to be set via ......

Revision as of 22:34, 12 October 2012

Page in progress

This module understands a paragraph as a full closed block of one thought. This means that inside a paragraph enumerations, formulas etc. can apear. That is why a paragraph must be defined manuelly 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
\startParagraph[title={Paragraph heading}]
\input tufte
\stopParagraph
\stoptext

References

Now the more practical part: the paragraph referencing. To reference to an paragraph the package pararef contains the function \crossref

\crossref[]
\crossref[brakets=...,text=...][]

Here a simple usage example:

\usemodule[pararef]

\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[text={para.}][ref1]
\item ref2 should be: sec. 1.2 and is: \crossref[text={sec.}][ref2]
\stopitemize
Here is one references with brakets:
\startitemize[nowhite]
\item ref1 should be: para. 1.1/2 and is: \crossref[brakets=yes,text={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[text={para.}][ref1]
\item ref2 should be: sec. 1.2 on page 1 and is: \crossref[text={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

\starttext

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

\textpartdivider

\dorecurse[3]{
\startParagraph
Some main theme text \input tufte
\stoptext
}

\textpartdivider

\startParagraph
Some section summarizing text \input tufte
\stoptext

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

Settings

Often references (or links) are printed in a different color than the normal text. In pararef the colors can be set via three paramters:

  • crossrefColor for the entire reference text,
  • textpartdividerColor for the color of the line and
  • paragraphNumberColor for the number of the paragraph.

They are defined as parameters of the module:

\usemodule[bgcolor][crossrefColor=...,textpartdividerColor=...,paragraphNumberColor=...]
...

The brakets and text part for \crossref can also be adjusted or extended with other languages:

\setupparareftext[en][braketOpen={(}]
\setupparareftext[en][braketClose={)}]
\setupparareftext[en][atpageLeft={ on page }]
\setupparareftext[en][atpageRight={}]
\setupparareftext[de][braketOpen={(}]
\setupparareftext[de][braketClose={)}]
\setupparareftext[de][atpageLeft={ auf Seite }]
\setupparareftext[de][atpageRight={}]

For now the color and style of the paragraph title has to be set via ......