[NTG-context] Cross referencing by using \useexternaldoument

Wolfgang Schuster wolfgang.schuster.lists at gmail.com
Sun Aug 18 18:07:50 CEST 2019


Willi Egger schrieb am 18.08.2019 um 17:30:
> Hi all,
>
> there is an old thread concerning this issue from september 2015. It appears unfortunately, that this issue persists.
>
> You can reference to places inside a document, but references to an outside document are broken. The links do not work and no page numbers or texts are typeset from the external document.
>
> Can someone help me to solve this?
I tried your example and had no problem to get the page and section numbers
from the other document. What you have to ensure is that the tuc-file 
for the
other document you want to refer dies exist because context uses it to get
the values for the numbers etc.

Wolfgang

-------------- next part --------------
local utilitydata = { }

utilitydata.comment={
 ["escape"]="[===[ ... ]===]",
 ["file"]="two",
 ["format"]="cont-en",
 ["stamp"]="2019.08.17 11:46",
 ["version"]=1.31,
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.variables then utilitydata.job.variables = { } end

utilitydata.job.variables.checksums={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.variables then utilitydata.job.variables = { } end

utilitydata.job.variables.collected={
 ["macros"]={},
 ["randomseed"]=0.20989990234375,
 ["sectionblockorder"]={},
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.structure then utilitydata.job.structure = { } end

utilitydata.job.structure.collected={
 ["branches"]={},
 ["name"]="",
 ["type"]="text",
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.positions then utilitydata.job.positions = { } end

utilitydata.job.positions.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.passes then utilitydata.job.passes = { } end

utilitydata.job.passes.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.datasets then utilitydata.job.datasets = { } end

utilitydata.job.datasets.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.pagestates then utilitydata.job.pagestates = { } end

utilitydata.job.pagestates.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.specials then utilitydata.structures.specials = { } end

utilitydata.structures.specials.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.sections then utilitydata.structures.sections = { } end

utilitydata.structures.sections.collected={
 {
  ["block"]="bodypart",
  ["conversionset"]="default",
  ["language"]="en",
  ["numbers"]=1,
  ["separatorset"]="default",
  ["set"]="all",
 },
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.counters then utilitydata.structures.counters = { } end

utilitydata.structures.counters.collected={
 ["chemical"]={
  { 0, 0 },
 },
 ["combination"]={
  { 0 },
 },
 ["endnote"]={
  { 0 },
 },
 ["figure"]={
  { 0, 0 },
 },
 ["footnote"]={
  { 0 },
 },
 ["formula"]={
  { 0, 0 },
 },
 ["graphic"]={
  { 0, 0 },
 },
 ["intermezzo"]={
  { 0, 0 },
 },
 ["itemgroup:itemize"]={
  { 0, 0 },
 },
 ["linenote"]={
  { 0 },
 },
 ["paragraph"]={
  { 0, 0 },
 },
 ["realpage"]={
  { 4 },
 },
 ["subpage"]={
  { 4 },
 },
 ["table"]={
  { 0, 0 },
 },
 ["textnote:note"]={
  { 0 },
 },
 ["userpage"]={
  { 4 },
 },
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.lists then utilitydata.structures.lists = { } end

utilitydata.structures.lists.collected={
 {
  ["metadata"]=2,
  ["numberdata"]=3,
  ["references"]={
   ["block"]="bodypart",
   ["internal"]=1,
   ["realpage"]=4,
   ["reference"]="sec:second",
   ["section"]=1,
   ["used"]="fit",
  },
  ["titledata"]={
   ["label"]="chapter",
   ["title"]="Second document",
  },
 },
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.pages then utilitydata.structures.pages = { } end

utilitydata.structures.pages.collected={
 {
  ["block"]="bodypart",
  ["number"]=1,
  ["numberdata"]=4,
  ["prefixdata"]=5,
  ["state"]="start",
 },
 {
  ["block"]="bodypart",
  ["number"]=2,
  ["numberdata"]=4,
  ["prefixdata"]=5,
  ["state"]="start",
 },
 {
  ["block"]="bodypart",
  ["number"]=3,
  ["numberdata"]=4,
  ["prefixdata"]=5,
  ["state"]="start",
 },
 {
  ["block"]="bodypart",
  ["number"]=4,
  ["numberdata"]=4,
  ["prefixdata"]=5,
  ["state"]="start",
 },
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.references then utilitydata.structures.references = { } end

utilitydata.structures.references.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.references then utilitydata.structures.references = { } end

utilitydata.structures.references.referred={
 { 1, 10 },
 { 1, 12 },
 { 1, 14 },
 { 1, 16 },
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.objects then utilitydata.job.objects = { } end

utilitydata.job.objects.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.synonyms then utilitydata.structures.synonyms = { } end

utilitydata.structures.synonyms.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.registers then utilitydata.structures.registers = { } end

utilitydata.structures.registers.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.blocks then utilitydata.structures.blocks = { } end

utilitydata.structures.blocks.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.files then utilitydata.job.files = { } end

utilitydata.job.files.collected={
}

if not utilitydata.publications then utilitydata.publications = { } end

utilitydata.publications.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.fileobjreferences then utilitydata.job.fileobjreferences = { } end

utilitydata.job.fileobjreferences.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.embedded then utilitydata.job.embedded = { } end

utilitydata.job.embedded.collected={
}

utilitydata.job.packed={
 ["index"]={
  { 0, 1 },
  {
   ["catcodes"]=8,
   ["coding"]="tex",
   ["increment"]="yes",
   ["kind"]="section",
   ["level"]=2,
   ["name"]="chapter",
  },
  {
   ["block"]="bodypart",
   ["conversionset"]="default",
   ["language"]="en",
   ["numbers"]=1,
   ["separatorset"]="default",
   ["set"]="all",
  },
  {
   ["conversionset"]="pagenumber",
  },
  {
   ["connector"]="–",
   ["prefix"]="no",
   ["set"]="part",
  },
 },
 ["keys"]={
  ["directives"]=true,
  ["metadata"]=true,
  ["numberdata"]=true,
  ["numbers"]=true,
  ["ownnumbers"]=true,
  ["pagedata"]=true,
  ["prefixdata"]=true,
  ["processors"]=true,
  ["sectiondata"]=true,
  ["specification"]=true,
 },
 ["skip"]={
  ["datasets"]=true,
  ["positions"]=true,
  ["userdata"]=true,
 },
 ["version"]=1.02,
}

return utilitydata
-------------- next part --------------
\enabletrackers[structures.referencing.analyzing]

\setupinteraction[state=start]

\starttext

\starttabulate[|l|l|l|]
\NC First document  \NC \in{Chapter}[sec:first]       \NC \at{Page}[sec:first]       \NC\NR
\NC Second document \NC \in{Chapter}[two::sec:second] \NC \at{Page}[two::sec:second] \NC\NR
\stoptabulate

\dorecurse{3}{\page[empty]}

\chapter[sec:first]{First document}

\stoptext
-------------- next part --------------
local utilitydata = { }

utilitydata.comment={
 ["escape"]="[===[ ... ]===]",
 ["file"]="one",
 ["format"]="cont-en",
 ["stamp"]="2019.08.17 11:46",
 ["version"]=1.31,
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.variables then utilitydata.job.variables = { } end

utilitydata.job.variables.checksums={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.variables then utilitydata.job.variables = { } end

utilitydata.job.variables.collected={
 ["macros"]={},
 ["randomseed"]=0.0439453125,
 ["sectionblockorder"]={},
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.structure then utilitydata.job.structure = { } end

utilitydata.job.structure.collected={
 ["branches"]={},
 ["name"]="",
 ["type"]="text",
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.positions then utilitydata.job.positions = { } end

utilitydata.job.positions.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.passes then utilitydata.job.passes = { } end

utilitydata.job.passes.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.datasets then utilitydata.job.datasets = { } end

utilitydata.job.datasets.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.pagestates then utilitydata.job.pagestates = { } end

utilitydata.job.pagestates.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.specials then utilitydata.structures.specials = { } end

utilitydata.structures.specials.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.sections then utilitydata.structures.sections = { } end

utilitydata.structures.sections.collected={
 {
  ["block"]="bodypart",
  ["conversionset"]="default",
  ["language"]="en",
  ["numbers"]=1,
  ["separatorset"]="default",
  ["set"]="all",
 },
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.counters then utilitydata.structures.counters = { } end

utilitydata.structures.counters.collected={
 ["chemical"]={
  { 0, 0 },
 },
 ["combination"]={
  { 0 },
 },
 ["endnote"]={
  { 0 },
 },
 ["figure"]={
  { 0, 0 },
 },
 ["footnote"]={
  { 0 },
 },
 ["formula"]={
  { 0, 0 },
 },
 ["graphic"]={
  { 0, 0 },
 },
 ["intermezzo"]={
  { 0, 0 },
 },
 ["itemgroup:itemize"]={
  { 0, 0 },
 },
 ["linenote"]={
  { 0 },
 },
 ["paragraph"]={
  { 0, 0 },
 },
 ["realpage"]={
  { 5 },
 },
 ["subpage"]={
  { 5 },
 },
 ["table"]={
  { 0, 0 },
 },
 ["textnote:note"]={
  { 0 },
 },
 ["userpage"]={
  { 5 },
 },
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.lists then utilitydata.structures.lists = { } end

utilitydata.structures.lists.collected={
 {
  ["metadata"]=2,
  ["numberdata"]=3,
  ["references"]={
   ["block"]="bodypart",
   ["internal"]=1,
   ["realpage"]=5,
   ["reference"]="sec:first",
   ["section"]=1,
   ["used"]="fit",
  },
  ["titledata"]={
   ["label"]="chapter",
   ["title"]="First document",
  },
 },
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.pages then utilitydata.structures.pages = { } end

utilitydata.structures.pages.collected={
 {
  ["block"]="bodypart",
  ["number"]=1,
  ["numberdata"]=4,
  ["prefixdata"]=5,
  ["state"]="start",
 },
 {
  ["block"]="bodypart",
  ["number"]=2,
  ["numberdata"]=4,
  ["prefixdata"]=5,
  ["state"]="start",
 },
 {
  ["block"]="bodypart",
  ["number"]=3,
  ["numberdata"]=4,
  ["prefixdata"]=5,
  ["state"]="start",
 },
 {
  ["block"]="bodypart",
  ["number"]=4,
  ["numberdata"]=4,
  ["prefixdata"]=5,
  ["state"]="start",
 },
 {
  ["block"]="bodypart",
  ["number"]=5,
  ["numberdata"]=4,
  ["prefixdata"]=5,
  ["state"]="start",
 },
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.references then utilitydata.structures.references = { } end

utilitydata.structures.references.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.references then utilitydata.structures.references = { } end

utilitydata.structures.references.referred={
 { 1, 10 },
 { 1, 12 },
 { 1, 14 },
 { 1, 16 },
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.objects then utilitydata.job.objects = { } end

utilitydata.job.objects.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.synonyms then utilitydata.structures.synonyms = { } end

utilitydata.structures.synonyms.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.registers then utilitydata.structures.registers = { } end

utilitydata.structures.registers.collected={
}

if not utilitydata.structures then utilitydata.structures = { } end
if not utilitydata.structures.blocks then utilitydata.structures.blocks = { } end

utilitydata.structures.blocks.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.files then utilitydata.job.files = { } end

utilitydata.job.files.collected={
}

if not utilitydata.publications then utilitydata.publications = { } end

utilitydata.publications.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.fileobjreferences then utilitydata.job.fileobjreferences = { } end

utilitydata.job.fileobjreferences.collected={
}

if not utilitydata.job then utilitydata.job = { } end
if not utilitydata.job.embedded then utilitydata.job.embedded = { } end

utilitydata.job.embedded.collected={
}

utilitydata.job.packed={
 ["index"]={
  { 0, 1 },
  {
   ["catcodes"]=8,
   ["coding"]="tex",
   ["increment"]="yes",
   ["kind"]="section",
   ["level"]=2,
   ["name"]="chapter",
  },
  {
   ["block"]="bodypart",
   ["conversionset"]="default",
   ["language"]="en",
   ["numbers"]=1,
   ["separatorset"]="default",
   ["set"]="all",
  },
  {
   ["conversionset"]="pagenumber",
  },
  {
   ["connector"]="–",
   ["prefix"]="no",
   ["set"]="part",
  },
 },
 ["keys"]={
  ["directives"]=true,
  ["metadata"]=true,
  ["numberdata"]=true,
  ["numbers"]=true,
  ["ownnumbers"]=true,
  ["pagedata"]=true,
  ["prefixdata"]=true,
  ["processors"]=true,
  ["sectiondata"]=true,
  ["specification"]=true,
 },
 ["skip"]={
  ["datasets"]=true,
  ["positions"]=true,
  ["userdata"]=true,
 },
 ["version"]=1.02,
}

return utilitydata
-------------- next part --------------
\enabletrackers[structures.referencing.analyzing]

\setupinteraction[state=start]

\starttext

\starttabulate[|l|l|l|]
\NC First document  \NC \in{Chapter}[one::sec:first] \NC \at{Page}[one::sec:first] \NC\NR
\NC Second document \NC \in{Chapter}[sec:second]     \NC \at{Page}[sec:second]     \NC\NR
\stoptabulate

\dorecurse{2}{\page[empty]}

\chapter[sec:second]{Second document}

\stoptext


More information about the ntg-context mailing list