ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Peter Schorsch <tralalas@freenet.de>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: currentheadnumber / doif.. problem
Date: Tue, 16 Oct 2007 00:01:46 +0200	[thread overview]
Message-ID: <200710160001.46785.tralalas@freenet.de> (raw)
In-Reply-To: <alpine.WNT.0.9999.0709252009330.3976@nqvgln>

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

Aditya wrote:
> Can you create a minimum example to play with?

I attached the module t-pararef.tex and the example pararef-test.tex. The ref1 
is still wrong. 

When I replace \currentheadnumber in \paragraphMark with the before defined 
\presentheadnumber  context is saying that a «Missing control sequence 
inserted» - but I don't see any mistake there (but there must be)...

But finally I only want that the ref1 in the example is also working (see at 
the end of example file).

A second questions: why is the paragraph of ref3 in the example indented?

Thanks, P.

[-- Attachment #2: pararef-test.tex --]
[-- Type: text/x-tex, Size: 1692 bytes --]

\usemodule[pararef]

\starttext

\chapter{first heading}

\section{hamha}

\startparagraph\paragraphMark[ref1]\paragraphHeading{tztzttzt}
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla 
\stopparagraph

\startparagraph
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla 
\stopparagraph

\section[ref2]{dumdidim}

\startparagraph
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla 
\stopparagraph

\chapter{first heading}

\startparagraph
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla 
\stopparagraph

\startparagraph\paragraphHeading{heuho}
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla 
\stopparagraph

\startparagraph\paragraphMark[ref3]
blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla blabla 
\stopparagraph


ref1 should be: para. 1.1/2 and is: \crossref{para.}[ref1]

ref2 should be: sec. 1.2 and is: \crossref{sec.}[ref2]

ref3 should be: para. 2/3 and is: \crossref{para.}[ref3]

\stoptext

[-- Attachment #3: t-pararef.tex --]
[-- Type: text/x-tex, Size: 1348 bytes --]

\startmodule[pararef]

\unprotect

% variable and functions
%
% paragraphNumber		running number starts at every heading with 1
%
% paragraphMark[]		Marks the paragraph to make references to it 
% tmpparagraphMark{}[]		replaces temporary paragraphMark until 
%				presentheadnumber is working
% getParagraphNumber		Writes paragraphNumber (for itmize-enviorement
% startParagraph		Starts and stops a paragraph
% 	stopParagraph
% paragraphHeading{}		Defines the margin-heading of that paragraph
% crossref{}[]			common command for internal references

\definenumber[paragraphNumber]

\setuphead[chapter,section,subsection,subsubsection][after={\resetnumber[paragraphNumber]}]


\def\presentheadnumber
	{\doifelse{\headnumber[section]}{0}%
		{\headnumber[chapter]}%
		{\headnumber[section]}%
	}

\def\paragraphMark[#1]
	{\expanded{\textreference[#1]{\presentheadnumber/\getnumber[paragraphNumber]}}}

\define\getParagraphNumber
	{\incrementnumber[paragraphNumber]%
	\inothermargin{\color[grey]%
	{\tfx\getnumber[paragraphNumber]~}}
	}

\definestartstop[paragraph]
  [before=
	{\blank[medium]\incrementnumber[paragraphNumber]%
	\inothermargin{\color[grey]%
	{\tfx\getnumber[paragraphNumber]~}}},
   after={\blank[medium]}]

\def\paragraphHeading#1%
	{\inmargin{#1}%
	}

\def\crossref#1[#2]%
	{\color[grey]{#1 \in[#2]}%
	}

\protect
\stopmodule
\endinput

[-- Attachment #4: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2007-10-15 22:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-10 11:09 Peter Schorsch
2007-09-12 13:25 ` Aditya Mahajan
2007-09-25 19:42   ` Peter Schorsch
2007-09-26  0:09     ` Aditya Mahajan
2007-10-15 22:01       ` Peter Schorsch [this message]
2007-10-18 19:46         ` Peter Schorsch
     [not found] <mailman.1.1189504801.15983.ntg-context@ntg.nl>
2007-09-12  8:09 ` Duncan Hothersall
  -- strict thread matches above, loose matches on Subject: below --
2007-09-09 23:21 Peter Schorsch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200710160001.46785.tralalas@freenet.de \
    --to=tralalas@freenet.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).