cross-references between documents in a project (using \useexternaldocument)
![](https://secure.gravatar.com/avatar/3b11febfb5622e17cc16980cbc00ad2f.jpg?s=120&d=mm&r=g)
Dear all, I am trying to create cross references between two documents in my project. Links between the two are successfully made, but the actual page numbers are not being printed (which, for my purposes, are what I actually need, not links). Am I doing something wrong, or is this a known bug (such that I should cease my attempts)? Is \useexternaldocument the wrong command for this purpose? Minimum example files below: % project \project project_xref \startproduct prd_xref \component xref1 \component xref2 \stopproduct % product \startproject project_xref \environment env_xref \product prd_xref \stopproject % environment \startenvironment env_xref \setupinteraction [state=start, style=, color=blue, contrastcolor=, menu=on, title=Cross referencing Test File, author=Gerard Verhaag] \stopenvironment % component1 [xref1] \project project_xref \startcomponent xref1 \starttext \chapter[cross]{Cross referencing} \chapter[lorem]{Lorem} Lorem ipsum dolor sit amet, consectetur adipiscing elit \in{Chapter}[lorem]. \stoptext \stopcomponent % component2 [xref2] \project project_xref \startcomponent xref2 \useexternaldocument[xrf][xref1] \starttext Lorem ipsum dolor sit amet, consectetur adipiscing elit \in{Chapter}[xrf::lorem]. \stoptext \stopcomponent All the best, Talal
![](https://secure.gravatar.com/avatar/3b11febfb5622e17cc16980cbc00ad2f.jpg?s=120&d=mm&r=g)
Perhaps I might ask a more preliminary question: when using project structure, is cross-document referencing possible between two product files, or only between two component files within a single product file? Kind regards, Talal
On 5 Aug 2015, at 13:15, talazem@fastmail.fm wrote:
Dear all,
I am trying to create cross references between two documents in my project. Links between the two are successfully made, but the actual page numbers are not being printed (which, for my purposes, are what I actually need, not links). Am I doing something wrong, or is this a known bug (such that I should cease my attempts)? Is \useexternaldocument the wrong command for this purpose? Minimum example files below:
% project \project project_xref \startproduct prd_xref \component xref1 \component xref2 \stopproduct
% product \startproject project_xref \environment env_xref \product prd_xref \stopproject
% environment \startenvironment env_xref \setupinteraction [state=start, style=, color=blue, contrastcolor=, menu=on, title=Cross referencing Test File, author=Gerard Verhaag] \stopenvironment
% component1 [xref1] \project project_xref \startcomponent xref1 \starttext \chapter[cross]{Cross referencing} \chapter[lorem]{Lorem} Lorem ipsum dolor sit amet, consectetur adipiscing elit \in{Chapter}[lorem]. \stoptext \stopcomponent
% component2 [xref2] \project project_xref \startcomponent xref2 \useexternaldocument[xrf][xref1] \starttext Lorem ipsum dolor sit amet, consectetur adipiscing elit \in{Chapter}[xrf::lorem]. \stoptext \stopcomponent
All the best, Talal ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
talazem@fastmail.fm mailto:talazem@fastmail.fm 6. August 2015 19:00 Perhaps I might ask a more preliminary question: when using project structure, is cross-document referencing possible between two product files, or only between two component files within a single product file? You can create hyperlinks between different products and your example (I slightly modified it) works as expected with MkII where I get the chapter number in the links.
The missing numbers with MkIV can be a bug or not yet implemented. Wolfgang
![](https://secure.gravatar.com/avatar/3b11febfb5622e17cc16980cbc00ad2f.jpg?s=120&d=mm&r=g)
Hans, it would be great to have the numbers appearing again sometime in the future (if it is a bug or a not-yet implemented feature indeed). I couldn’t find anything in the documentation suggesting not to structure things this way. Best wishes, Talal
On 10 Aug 2015, at 21:33, Wolfgang Schuster
wrote: talazem@fastmail.fm mailto:talazem@fastmail.fm 6. August 2015 19:00 Perhaps I might ask a more preliminary question: when using project structure, is cross-document referencing possible between two product files, or only between two component files within a single product file? You can create hyperlinks between different products and your example (I slightly modified it) works as expected with MkII where I get the chapter number in the links.
The missing numbers with MkIV can be a bug or not yet implemented.
Wolfgang ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 8/11/2015 11:00 AM, talazem@fastmail.fm wrote:
Hans, it would be great to have the numbers appearing again sometime in the future (if it is a bug or a not-yet implemented feature indeed). I couldn’t find anything in the documentation suggesting not to structure things this way.
i have no clue what you're talking about ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/3b11febfb5622e17cc16980cbc00ad2f.jpg?s=120&d=mm&r=g)
Sorry for not being clear. The original question was whether cross-referencing in a project can only be done between components, or if they can also be done between products. I could never get the latter to work. Wolfgang confirmed that in MkII, intra-product cross-referencing works (even with the examples I had posted),but not in MkIV. He speculated that the numbers in the references were not appearing in MkIV due to a bug, or because the feature was not implemented. Best wishes, Talal
On 11 Aug 2015, at 10:48, Hans Hagen
wrote: On 8/11/2015 11:00 AM, talazem@fastmail.fm wrote:
Hans, it would be great to have the numbers appearing again sometime in the future (if it is a bug or a not-yet implemented feature indeed). I couldn’t find anything in the documentation suggesting not to structure things this way.
i have no clue what you're talking about
----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Hans Hagen mailto:pragma@wxs.nl 11. August 2015 11:48
i have no clue what you're talking about There is a bug in the reference mechanism between documents.
When you produce a PDF from the attached documents you can use the hyperlinks to jump to the chapter page in the other document but no information is printed because the information with the section number, page number or title isn’t loaded (can be seen in the tracker information in the log). Wolfgang
![](https://secure.gravatar.com/avatar/49e63acb01f2ca80efce7eed08310ce8.jpg?s=120&d=mm&r=g)
On 9/8/2015 9:04 PM, Wolfgang Schuster wrote:
Hans Hagen mailto:pragma@wxs.nl 11. August 2015 11:48
i have no clue what you're talking about There is a bug in the reference mechanism between documents.
not so much a bug but the current mechanism assumes a project/component struture i'll see if i can catch the non structured variant
When you produce a PDF from the attached documents you can use the hyperlinks to jump to the chapter page in the other document but no information is printed because the information with the section number, page number or title isn’t loaded (can be seen in the tracker information in the log).
Wolfgang
___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________
-- ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
![](https://secure.gravatar.com/avatar/67090f10286f076a3b3efcb3e2950065.jpg?s=120&d=mm&r=g)
On 09.09.2015 01:43, Hans Hagen wrote:
On 9/8/2015 9:04 PM, Wolfgang Schuster wrote:
Hans Hagen mailto:pragma@wxs.nl 11. August 2015 11:48
i have no clue what you're talking about There is a bug in the reference mechanism between documents.
not so much a bug but the current mechanism assumes a project/component struture
Hi, I'm also struggeling with cross-referencing in a project/component layout. I attached a minimal example that resembles the layout I use. If you compile xr-prod1 and xr-prod2 all cross-references are simply empty. I looked at the lua code to see if I'm able to fix it myself and stumbled over the 'identify_inner(set,var,prefix,collected,derived)' function in strc-ref.lua (at around line 1396 in MKVI from 2015.09.04 11:00). It look like identify_inner gets sometimes called with 'prefix' set to nil while 'derived' is also undefined (at 1493 and 1514). If I get the program flow right this looks suspicious, as it always retuns 'false' from 'identify_inner'. If I add 'prefix = prefix or ""' to 'identify_inner' I actually get references printed in the test case. However the links are not working and for the figure the section number is wrong. Finally looking at the uncompressed PDF I can see that references are set not prefixed in xr-prod2.pdf (i.e. link to 'plain'), but are prefixed in xr-prod1.pdf (anchor is 'xr-comp1-1:plain'). Maybe these informations can help in resolving the issue. :)
i'll see if i can catch the non structured variant
When you produce a PDF from the attached documents you can use the hyperlinks to jump to the chapter page in the other document but no information is printed because the information with the section number, page number or title isn’t loaded (can be seen in the tracker information in the log).
Wolfgang
![](https://secure.gravatar.com/avatar/b79687264c3e06cba13b54d05b12a9f5.jpg?s=120&d=mm&r=g)
Hans Hagen mailto:pragma@wxs.nl 9. September 2015 01:43 On 9/8/2015 9:04 PM, Wolfgang Schuster wrote:
Hans Hagen mailto:pragma@wxs.nl 11. August 2015 11:48
i have no clue what you're talking about There is a bug in the reference mechanism between documents.
not so much a bug but the current mechanism assumes a project/component struture
i'll see if i can catch the non structured variant The same happens when you link from on product to another.
Wolfgang
participants (4)
-
Hans Hagen
-
Jens Bertram
-
talazem@fastmail.fm
-
Wolfgang Schuster