Re: [NTG-context] Creeps (binding gutter / margin correction in imposition)

2016-11-07 Thread Henning Hraban Ramm
Am 2016-11-07 um 17:44 schrieb Willi Egger :

> I am not sure about what you say. The page shifting/creep correction is added 
> individually per spread. If this is done correctly then the typeset area is 
> on all pages the same width and has after folding and cutting  the same outer 
> margin. 

Exactly. But I wanted to discuss the idea to adapt the width of the text area 
(\textwidth) or maybe the width of margins (the marginals area that ConTeXt 
calls margin) to the page shift, so that the optical width of the margins (what 
ConTeXt calls edges) stays the same.
As far as I know, nobody ever did that - of course, it’s a major effort for 
little gain, and it complicates TeX’s line breaking, the engine would need to 
know about imposition while breaking lines.
But since we can have snake-justified text, I thought I could bring up the idea 
;)

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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
___

Re: [NTG-context] Creeps (binding gutter / margin correction in imposition)

2016-11-07 Thread Henning Hraban Ramm
Am 2016-11-07 um 15:29 schrieb Wolfgang Schuster :

>> Henning Hraban Ramm 7. November 2016 um 08:33
>> Hi together,
>> 
>> this is not really a practical request, but an interesting (I think) idea...
>> 
>> ConTeXt can do simple imposition (arranging pages on sheets, see 
>> \setuparranging), but in professional imposition you need to compensate for 
>> the paper thickness in folds to keep pages readable - you can move the outer 
>> pages of a fold out of the gutter (spine), or move the inner pages to the 
>> spine. (This is called creep in English, Bundversatz in German.) That means, 
>> your outer margin will have different width, depending on the position of 
>> the page in its fold.
>> 
>> See e.g. https://helpx.adobe.com/indesign/using/printing-booklets.html
>> 
>> A guy on the LilyPond mailing list had the interesting idea to adapt the 
>> line width to this creep, to keep an even outer margin - it would mean that 
>> TeX needs to know about imposition while breaking lines.
>> 
>> What do you think?
> http://wiki.contextgarden.net/Command/definepageshift
> http://wiki.contextgarden.net/Command/setuppageshift

Oh yes, thank you!
I knew there was already a solution for the ususal creep, but I couldn’t find 
it, was expecting a parameter of \setuparranging or the like.

But that doesn’t reduce the line width for shifted pages.


Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
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
___

Re: [NTG-context] Clickable question/answer numbers (Otared Kavian)

2016-11-07 Thread Willi Egger
Otared,

thank you for this nice example!

Willi
> On 7 Nov 2016, at 04:21, Otared Kavian  wrote:
> 
> Dear Dalyoung,
> 
> I guess you are typesetting the wrong file, or you have put the last code I 
> sent into a file which contains something of the previous codes…
> Indeed in the last file I sent (which I am sending again at the end of this 
> reply) does not contain the command \myanswer… which appears in your error 
> message.
> 
> Please test the code below and let me know if you encunter a problem.
> 
> Best regards: OK
>  begin interactive-question-answer.tex
>  Here, following Wolfgang Schuster's ideas, 
>  we define some macros allowing to couple
>  Questions and Answers in an automatic way
>  Upon clicking on an interactive title for Question or Answer
>  one goes to the corresponding Answer or Question
> 
> \setupinteraction[state=start]
> 
> % We define two counters which follow the numbers
> % appearing in Question and Answer
> 
> \newcounter\QuestionCounter
> \newcounter\AnswerCounter
> 
> % We create two commands to be used in the
> % enumeration environments
> % Note that the check for trial typestting 
> % \doifnotmode{*trialtypesetting}
> % is necessary in order to avoid unwanted incrementation
> \define[1]\QuestionTextCommand
>   {\doifnotmode{*trialtypesetting}
>  {\doglobal\increment\QuestionCounter
>   \pagereference[question:\QuestionCounter]}%
>\doifreferencefoundelse{answer:\QuestionCounter}
>  {\goto{#1}[answer:\QuestionCounter]}
>  {#1}}
> 
> \define[1]\AnswerTextCommand
>   {\doifnotmode{*trialtypesetting}
>  {\doglobal\increment\AnswerCounter
>   \pagereference[answer:\AnswerCounter]}%
>\doifreferencefoundelse{question:\AnswerCounter}
>  {\goto{#1}[question:\AnswerCounter]}
>  {#1}}
> 
> % We define here two enumeration environments for
> % Questions and Answers
> \defineenumeration[question]
>   [text=Question,
>   headcommand=\QuestionTextCommand,
>   number=yes,
>   prefix=yes,
>   prefixsegments=chapter,
>   coupling=answer]
> 
> \defineenumeration[answer]
>   [text=Answer,
>   headcommand=\AnswerTextCommand,
>   number=yes,
>   prefix=yes,
>   prefixsegments=chapter,
>   coupling=question]
> 
> % Each question is followed immediately by its answer.
> % The answers are put in a block which will be used later
> \defineblock[answer]
> \hideblocks[answer]
> 
> % We define a command used after a  
> % Question for which no Answer is provided
> % Since the block commands 
> % \beginanswer ... \endanswer
> % cannot be used directly in a macro definition
> % we use a trick...
> % In the buffer the two counters associated to Answer
> % are incremented...
> \startbuffer[noanswer]
> \beginanswer
> \doglobal\increment\AnswerCounter
> \incrementcounter[answer]
> \endanswer
> \stopbuffer
> 
> % ...and then the above buffer is invoked
> \define\noanswer
>   {\getbuffer[noanswer]}
> 
> % example of use:
> \starttext
> \startchapter[title=Questions]
> 
> \startquestion[q:1]
> Prove that ${\rm e}\sim 2.73$ is irrational.
> 
> This is the first question, with its own reference, for later use.
> \stopquestion
> 
> \beginanswer
> \startanswer
> This is the answer to the first question (to \in{Question}[q:1]).
> \stopanswer
> \endanswer
> 
> \startquestion 
> This is the second question, without its own reference.
> \stopquestion
> 
> \beginanswer
> \startanswer[a:Test]
> This is the answer to the second question. 
> 
> (Note that this answer has a reference named \type{a:Test}).
> \stopanswer
> \endanswer
> 
> \startquestion[q:Obvious]
> This is the third question, an easy one, without a given solution.
> \stopquestion
> 
> % we increment here the counters for Answer
> \noanswer
> 
> \startquestion[q:2]
> This is the fourth question with its own reference.
> \stopquestion
> 
> \beginanswer
> \startanswer
> This is the answer to the fourth question: use the result of 
> \in{Question}[q:1].
> \stopanswer
> \endanswer
> 
> \startquestion 
> This is the fifth question, without its own reference. 
> 
> ({\it Hint:} look again at \in{Question}[q:Obvious]).
> \stopquestion
> 
> \beginanswer
> \startanswer
> This is the answer to the fifth question. Read again \in{Answer}[a:Test].
> \stopanswer
> \endanswer  
> 
> \stopchapter
> 
> % Here we say ownnumber=1, in order to match the prefix 
> % of numbers associated to Answer
> \startchapter[ownnumber=1,title=Answers and solutions]
> \useblocks[answer]
> \stopchapter
> 
> \stoptext
>  end interactive-question-answer.tex
> 
> 
> 
> 
>> On 6 Nov 2016, at 23:43, Jeong Dal  wrote:
>> 
>> Dear Otared,
>> 
>> Hi,
>> I run the given  code and got an error message as following.
>> 
>> tex error   > tex error on line 1 in file virtual://block.answer.2: ! 
>> Undefined control sequence
>> 
>> l.1 \myanswer
>>[Q:test]
>> 
>> 
>> 
>> Would you please tell me how to avoid such an error?
>> It seems to me t

Re: [NTG-context] Creeps (binding gutter / margin correction in imposition)

2016-11-07 Thread Willi Egger
Hi Hraban,

I am not sure about what you say. The page shifting/creep correction is added 
individually per spread. If this is done correctly then the typeset area is on 
all pages the same width and has after folding and cutting  the same outer 
margin. 
As Wolfgang reports look into \definepageshift cum suis.


Kind regards

Willi

> On 7 Nov 2016, at 08:33, Henning Hraban Ramm  wrote:
> 
> Hi together,
> 
> this is not really a practical request, but an interesting (I think) idea...
> 
> ConTeXt can do simple imposition (arranging pages on sheets, see 
> \setuparranging), but in professional imposition you need to compensate for 
> the paper thickness in folds to keep pages readable - you can move the outer 
> pages of a fold out of the gutter (spine), or move the inner pages to the 
> spine. (This is called creep in English, Bundversatz in German.) That means, 
> your outer margin will have different width, depending on the position of the 
> page in its fold.
> 
> See e.g. https://helpx.adobe.com/indesign/using/printing-booklets.html
> 
> A guy on the LilyPond mailing list had the interesting idea to adapt the line 
> width to this creep, to keep an even outer margin - it would mean that TeX 
> needs to know about imposition while breaking lines.
> 
> What do you think?
> 
> 
> Greetlings, Hraban
> ---
> http://www.fiee.net
> http://wiki.contextgarden.net
> 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
> ___

___
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
___

Re: [NTG-context] Creeps (binding gutter / margin correction in imposition)

2016-11-07 Thread Wolfgang Schuster

Henning Hraban Ramm 
7. November 2016 um 08:33
Hi together,

this is not really a practical request, but an interesting (I think) 
idea...


ConTeXt can do simple imposition (arranging pages on sheets, see 
\setuparranging), but in professional imposition you need to 
compensate for the paper thickness in folds to keep pages readable - 
you can move the outer pages of a fold out of the gutter (spine), or 
move the inner pages to the spine. (This is called creep in English, 
Bundversatz in German.) That means, your outer margin will have 
different width, depending on the position of the page in its fold.


See e.g. https://helpx.adobe.com/indesign/using/printing-booklets.html

A guy on the LilyPond mailing list had the interesting idea to adapt 
the line width to this creep, to keep an even outer margin - it would 
mean that TeX needs to know about imposition while breaking lines.


What do you think?

http://wiki.contextgarden.net/Command/definepageshift
http://wiki.contextgarden.net/Command/setuppageshift

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
___

Re: [NTG-context] Clickable question/answer numbers

2016-11-07 Thread Otared Kavian
Hi Dalyoung,

Yes I see what your problem might had been. Recently ConTeXt creates a fine 
named FILENAME.tuc when one typesets FILENAME.tex. This *.tuc file creates 
difficulties when the typesetting is stopped for some reason or another, 
because then at times it is impossible to typeset again the same file even if 
the error has been fixed.

Maybe we have to ask Hans whether this behavior is intended or not: in any case 
one has to remove that *.tuc file manually in order to typeset again.

Best regards: OK

> On 7 Nov 2016, at 13:19, Jeong Dal  wrote:
> 
> Dear Otared,
> 
> It is not the problem of your code. 
> Strangely, the code you just sent to me is stopped by the same reason during 
> the compilation
> even though it does not contain the word “myanswer”.
> After removing *.tmc file, the error disappear.  
> I still don’t know why such an error occurred.
> 
> Anyway, I got a nice sample which is very useful.
> 
> Thank you.
> 
> Best regards,
> 
> Dalyoung
> ___
> 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
> ___

___
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
___

Re: [NTG-context] Clickable question/answer numbers

2016-11-07 Thread Jeong Dal
Dear Otared,

It is not the problem of your code. 
Strangely, the code you just sent to me is stopped by the same reason during 
the compilation
even though it does not contain the word “myanswer”.
After removing *.tmc file, the error disappear.  
I still don’t know why such an error occurred.

Anyway, I got a nice sample which is very useful.

Thank you.

Best regards,

Dalyoung
___
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
___