[texhax] RE: Cross-referencing paragraphs not in the Table of Contents

Teigen Jan Gunnar jan.teigen at vegvesen.no
Sun Nov 13 15:03:01 CET 2005

Hey again!

Today I found a solution of the enquiry I sent you yesterday, namely
replacing the '\addtocounter{paragraph}{1}'-statement by
'\refstepcounter{paragraph}'. Now everything works fine!

I apologize if my inquiry may have caused any problems for you.

Kind regards
Jan Teigen

>  -----Opprinnelig melding-----
> Fra: 	Teigen Jan Gunnar  
> Sendt:	12. november 2005 17:43
> Til:	'support at tug.org'
> Emne:	Cross-referencing paragraphs not in the Table of Contents
> Hey
> I am writing on a document for some 'rules and regulations' in pdfTex
> where I use the paragraph sectioning command a lot. It is not
> practical to include these paragraphs in the Table of Content since
> they are numerous and without heading (but I include them as
> bookmarks). However, it is 'a must' to be able cross-referencing the
> individual paragraphs. So far, I have used a LaTex-structure like this
> for each paragraph:
> %**************************************************
> \addtocounter{paragraph}{1}
> \paragraph*{\theparagraph\hspace{-1em}}
> \pdfbookmark[4]{\theparagraph}{\theparagraph}
> \label{key}
> %**************************************************
> Text of the paragraph ..........
> This works fine for the bookmark, and also for the hyperlink when I
> write '\ref{key}' or '\pageref{key}' (I jump to the correct
> paragraph). However, the problem is that '\ref{key}' yields the
> overlaying subsection-number (which is in ToC), instead of the actual
> paragraph-number.
> I understand that this is not a bug in LaTex, just the way it is meant
> to work. However, what I miss here is the following extention of the
> ref-command: \ref[counter]{key}, with a counter optional (in my case
> paragraph). Maybe this can be enabled using the \renewcommand, but I
> don't have the skills.
> COan you help me finding a way around this problem? 
> Kind regards
> Jan Teigen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/texhax/attachments/20051113/22f88c3c/attachment.htm

More information about the texhax mailing list