Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I've recently started a personal project for creating and managing a knowledge base, but with the individual pages written in ConTeXt instead of markup, markdown, or any of the other currently-popular choices.

I'm very new to ConTeXt and have not seen any examples doing what I'm trying to do. It may simply be that I do not know the right place to look.

I'd like to be able to cross-link between pages and produce metadata pages covering the entire contents (e.g. TOC, index, list of figures).

At the moment I am not concerned with rendering these pages as HTML (but may be at some point). Ideally the output will be a set of cross-linked PDFs: one for each topic plus separate PDFs for the TOC, index, and any lists of figures/tables/whatever that I decide to produce.

Any pointers?

share|improve this question
2  
Welcome to TeX.se! I hope you'll have a good time here. About your question: the current title led me up a garden path, it made me think you wanted a hybrid TOC/index. Perhaps "Multiple documents with a shared TOC and indexes" would be a better title? That would make the question easier to spot for future help-seekers. You can edit the question, including its tags and title, via the ‘edit’ link at its foot. –  Esteis Jan 18 '13 at 9:48
    
Esteis, that's an excellent suggestion. Thanks. :) –  buc0 Jan 18 '13 at 13:16
1  
For cross link between documents, see pragma-ade.com/show-mag-15.htm –  Aditya Jan 20 '13 at 17:44

1 Answer 1

up vote 1 down vote accepted

To generate a combined TOC of two files a.tex and b.tex, first compile both of them individually, and then create a third file as follows:

\starttext
\ctxlua{job.load("a.tuc")}
\placecontent
\ctxlua{job.load("b.tuc")}
\placecontent

\stoptext

This, however, does not create proper hyperlinks.

share|improve this answer
    
This looks like it requires the use of LuaTeX. If that is the case, is there a XeTeX equivalent? If the links were important to me, would it be safe to say that it's not generally possible? –  buc0 Jan 20 '13 at 23:49
1  
Yes, this solution is for MkIV. Is there a specific reason that you are using MkII+xetex? For the last three years all of the ConTeXt development has been focused on MkIV. Regarding the links, all the information is in the .tuc file. So, getting the right links is doable. One needs to read the .tuc file (essentially a large lua table), and generate appropriate links. I am not familiar with the internals, so it may be better to post on the context mailing list. –  Aditya Jan 21 '13 at 1:45
    
As I said before, I'm very new to ConTeXt so I wasn't aware that there XeTeX had been left behind completely. I started off with XeTeX because I'd read that it had better Unicode support than LuaTeX and I didn't expect that I would need Lua. –  buc0 Jan 22 '13 at 0:03
1  
For Latin and CJK languages, LuaTeX (or at least ConTeXt) offers the same support as XeTeX. ConTeXt+LuaTeX currently does not support Indic languages, so if you need those, you are better off with ConTeXt+XeTeX. ConTeXt development has moved to LuaTeX because Lua is an easier language to program than TeX. ConTeXt+XeTeX still works well, but if you need new features (like the one you described), you are on your own. With ConTeXt+LuaTeX, if you post your question to the ConTeXt Mailing list, you will get a few solutions. –  Aditya Jan 22 '13 at 2:12
    
I'm accepting this answer, not simply because it's the only answer but even though it's a half answer it (and the comments on it) do tell the whole story - Lua is the answer. –  buc0 Feb 11 '13 at 13:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.