ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* cross references to chapters in a book
@ 2019-02-22 16:14 Robert Zydenbos
  2019-02-22 19:47 ` Wolfgang Schuster
  0 siblings, 1 reply; 8+ messages in thread
From: Robert Zydenbos @ 2019-02-22 16:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear wizards of ConTeXt,

In the final stage of completing a book project, I was wondering how to automatize cross references to chapters. I’ve already figured out how to refer to pages (using “\at[REFERENCE]”), but how is this done with chapters? I’m apparently too simple-minded to understand the manual (and I don’t understand the differences between \reference, \textreference, \in, \about).

Robert
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cross references to chapters in a book
  2019-02-22 16:14 cross references to chapters in a book Robert Zydenbos
@ 2019-02-22 19:47 ` Wolfgang Schuster
  2019-02-22 20:08   ` Henning Hraban Ramm
  2019-02-22 21:04   ` Robert Zydenbos
  0 siblings, 2 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2019-02-22 19:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Robert Zydenbos

Robert Zydenbos schrieb am 22.02.19 um 17:14:
> Dear wizards of ConTeXt,
> 
> In the final stage of completing a book project, I was wondering how to automatize cross references to chapters. I’ve already figured out how to refer to pages (using “\at[REFERENCE]”), but how is this done with chapters? I’m apparently too simple-minded to understand the manual (and I don’t understand the differences between \reference, \textreference, \in, \about).

When you use \chapter:

\starttext

\chapter[sec:knuth]{Knuth}

\samplefile{knuth}

See \in{chapter}[sec:zapf] at \at{page}[sec:zapf].

\chapter[sec:zapf]{Zapf}

\samplefile{zapf}

See \in{chapter}[sec:knuth] at \at{page}[sec:knuth].

\stoptext


When you use \startchapter:

\starttext

\startchapter[title={Knuth},reference={sec:knuth}]

\samplefile{knuth}

See \in{chapter}[sec:zapf] at \at{page}[sec:zapf].

\stopchapter

\startchapter[title={Zapf},reference={sec:zapf}]

\samplefile{zapf}

See \in{chapter}[sec:knuth] at \at{page}[sec:knuth].

\stopchapter

\stoptext


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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cross references to chapters in a book
  2019-02-22 19:47 ` Wolfgang Schuster
@ 2019-02-22 20:08   ` Henning Hraban Ramm
  2019-02-22 21:04   ` Robert Zydenbos
  1 sibling, 0 replies; 8+ messages in thread
From: Henning Hraban Ramm @ 2019-02-22 20:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Am 2019-02-22 um 20:47 schrieb Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>:

> Robert Zydenbos schrieb am 22.02.19 um 17:14:
>> Dear wizards of ConTeXt,
>> In the final stage of completing a book project, I was wondering how to automatize cross references to chapters. I’ve already figured out how to refer to pages (using “\at[REFERENCE]”), but how is this done with chapters? I’m apparently too simple-minded to understand the manual (and I don’t understand the differences between \reference, \textreference, \in, \about).
> 
> When you use \startchapter:
> 
> \starttext
> 
> \startchapter[title={Knuth},reference={sec:knuth}]
> 
> \samplefile{knuth}
> 
> See \in{chapter}[sec:zapf] at \at{page}[sec:zapf].
> 
> \stopchapter
> 
> \startchapter[title={Zapf},reference={sec:zapf}]
> 
> \samplefile{zapf}
> 
> See \in{chapter}[sec:knuth] at \at{page}[sec:knuth].
> 
> \stopchapter
> 
> \stoptext
> 

Use \about[sec:knuth], if you need the title.

https://wiki.contextgarden.net/Command/about
https://wiki.contextgarden.net/Command/in
https://wiki.contextgarden.net/Command/at


Greetlings, Hraban
---
https://www.fiee.net
http://wiki.contextgarden.net
https://www.dreiviertelhaus.de
GPG Key ID 1C9B22FD
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cross references to chapters in a book
  2019-02-22 19:47 ` Wolfgang Schuster
  2019-02-22 20:08   ` Henning Hraban Ramm
@ 2019-02-22 21:04   ` Robert Zydenbos
  2019-02-22 21:13     ` Robert Zydenbos
  2019-02-23  9:51     ` Wolfgang Schuster
  1 sibling, 2 replies; 8+ messages in thread
From: Robert Zydenbos @ 2019-02-22 21:04 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

Hmm… although I got your example to work after some tweaking (changing \samplefile to {input and placing knuth.tex and zapf.tex in the same folder as the test file), I could not reproduce this with my book. I want to get "chapter 4" but keep getting "chapter 4.0".

Is this because I am using MkII with XeTeX?

Robert

> On 22. Feb 2019, at 20:47, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
> 
> Robert Zydenbos schrieb am 22.02.19 um 17:14:
>> Dear wizards of ConTeXt,
>> In the final stage of completing a book project, I was wondering how to automatize cross references to chapters. I’ve already figured out how to refer to pages (using “\at[REFERENCE]”), but how is this done with chapters? I’m apparently too simple-minded to understand the manual (and I don’t understand the differences between \reference, \textreference, \in, \about).
> 
> When you use \chapter:
> 
> \starttext
> 
> \chapter[sec:knuth]{Knuth}
> 
> \samplefile{knuth}
> 
> See \in{chapter}[sec:zapf] at \at{page}[sec:zapf].
> 
> \chapter[sec:zapf]{Zapf}
> 
> \samplefile{zapf}
> 
> See \in{chapter}[sec:knuth] at \at{page}[sec:knuth].
> 
> \stoptext


___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cross references to chapters in a book
  2019-02-22 21:04   ` Robert Zydenbos
@ 2019-02-22 21:13     ` Robert Zydenbos
  2019-02-23 10:05       ` Wolfgang Schuster
  2019-02-23  9:51     ` Wolfgang Schuster
  1 sibling, 1 reply; 8+ messages in thread
From: Robert Zydenbos @ 2019-02-22 21:13 UTC (permalink / raw)
  To: Wolfgang Schuster; +Cc: mailing list for ConTeXt users

Still nicer would be the following, but I do not know whether this is technically possible –

I have the following text:

% start of example: in chapter 4, pp. 38, I have
\subject [wild-stuff]{Wild stuff}
Now comes a lot of weird stuff which I want to refer to later.
…
% end of stuff in one chapter

% in another chapter:
As we already saw in \in{chapter}[wild-stuff], on p.~\at[wild-stuff]
% that was in the other chapter
% end of example

and the result would be: “As we already saw in chapter 4, on p.~38”…

Can such a thing be done?

Robert


> On 22. Feb 2019, at 22:04, Robert Zydenbos <context@zydenbos.net> wrote:
> 
> Hmm… although I got your example to work after some tweaking (changing \samplefile to {input and placing knuth.tex and zapf.tex in the same folder as the test file), I could not reproduce this with my book. I want to get "chapter 4" but keep getting "chapter 4.0".
> 
> Is this because I am using MkII with XeTeX?
> 
> Robert
> 
>> On 22. Feb 2019, at 20:47, Wolfgang Schuster <wolfgang.schuster.lists@gmail.com> wrote:
>> 
>> Robert Zydenbos schrieb am 22.02.19 um 17:14:
>>> Dear wizards of ConTeXt,
>>> In the final stage of completing a book project, I was wondering how to automatize cross references to chapters. I’ve already figured out how to refer to pages (using “\at[REFERENCE]”), but how is this done with chapters? I’m apparently too simple-minded to understand the manual (and I don’t understand the differences between \reference, \textreference, \in, \about).
>> 
>> When you use \chapter:
>> 
>> \starttext
>> 
>> \chapter[sec:knuth]{Knuth}
>> 
>> \samplefile{knuth}
>> 
>> See \in{chapter}[sec:zapf] at \at{page}[sec:zapf].
>> 
>> \chapter[sec:zapf]{Zapf}
>> 
>> \samplefile{zapf}
>> 
>> See \in{chapter}[sec:knuth] at \at{page}[sec:knuth].
>> 
>> \stoptext
> 
> 

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cross references to chapters in a book
  2019-02-22 21:04   ` Robert Zydenbos
  2019-02-22 21:13     ` Robert Zydenbos
@ 2019-02-23  9:51     ` Wolfgang Schuster
  2019-02-26  6:21       ` Pablo Rodriguez
  1 sibling, 1 reply; 8+ messages in thread
From: Wolfgang Schuster @ 2019-02-23  9:51 UTC (permalink / raw)
  To: Robert Zydenbos; +Cc: mailing list for ConTeXt users



Robert Zydenbos schrieb am 22.02.19 um 22:04:
> Hmm… although I got your example to work after some tweaking (changing \samplefile to {input and placing knuth.tex and zapf.tex in the same folder as the test file), I could not reproduce this with my book. I want to get "chapter 4" but keep getting "chapter 4.0".

You have to create a minimal working example for this because I can’t 
tell why you get this output.

> Is this because I am using MkII with XeTeX?

Is there a reason why you stick with MkII or XeTeX.

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cross references to chapters in a book
  2019-02-22 21:13     ` Robert Zydenbos
@ 2019-02-23 10:05       ` Wolfgang Schuster
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2019-02-23 10:05 UTC (permalink / raw)
  To: Robert Zydenbos; +Cc: mailing list for ConTeXt users

Robert Zydenbos schrieb am 22.02.19 um 22:13:
> Still nicer would be the following, but I do not know whether this is technically possible –
>
> I have the following text:
>
> % start of example: in chapter 4, pp. 38, I have
> \subject [wild-stuff]{Wild stuff}
> Now comes a lot of weird stuff which I want to refer to later.
> …
> % end of stuff in one chapter
>
> % in another chapter:
> As we already saw in \in{chapter}[wild-stuff], on p.~\at[wild-stuff]
> % that was in the other chapter
> % end of example
>
> and the result would be: “As we already saw in chapter 4, on p.~38”…
>
> Can such a thing be done?

Can’t you just add a reference to the chapter title and refer to it 
instead of the the subject.

When you goal is to show the value of the chapter for the current 
subject you should switch to MkIV where this can be done (although we 
have to cheat to because we have to create numbered subject’s and hide 
the counter).

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cross references to chapters in a book
  2019-02-23  9:51     ` Wolfgang Schuster
@ 2019-02-26  6:21       ` Pablo Rodriguez
  0 siblings, 0 replies; 8+ messages in thread
From: Pablo Rodriguez @ 2019-02-26  6:21 UTC (permalink / raw)
  To: ntg-context

On 2/23/19 10:51 AM, Wolfgang Schuster wrote:
> [...]
>> Is this because I am using MkII with XeTeX?
> 
> Is there a reason why you stick with MkII or XeTeX.

Hi Wolfgang,

support for Indic languages seems to be the reason to use MkII.

Pablo
-- 
http://www.ousia.tk
___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-02-26  6:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22 16:14 cross references to chapters in a book Robert Zydenbos
2019-02-22 19:47 ` Wolfgang Schuster
2019-02-22 20:08   ` Henning Hraban Ramm
2019-02-22 21:04   ` Robert Zydenbos
2019-02-22 21:13     ` Robert Zydenbos
2019-02-23 10:05       ` Wolfgang Schuster
2019-02-23  9:51     ` Wolfgang Schuster
2019-02-26  6:21       ` Pablo Rodriguez

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).