* Metafun, difficulty with graphical element in the margin
@ 2022-03-18 19:29 Willi Egger via ntg-context
2022-03-19 5:41 ` śrīrāma via ntg-context
` (2 more replies)
0 siblings, 3 replies; 13+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-18 19:29 UTC (permalink / raw)
To: Mailing list for ConTeXt users; +Cc: Willi Egger
[-- Attachment #1: Type: text/plain, Size: 531 bytes --]
Good evening!
I have a dictionary where I would like to include thumb-pictures in the margin. — When I use the attached code with a single \startchapter...\stopchapter, it works. However if I add another \startchapter…\stopchapter before loading the setups for the thumb-picture metafun throws an error about not having complete information for performing a transformation.
I am currently using the before last version of LMTX-ConTeXT (January 21st 2022).
Could someone try to compile?
Thanks, kind regards
Willi
[-- Attachment #2: test-thumb-picture.tex --]
[-- Type: application/octet-stream, Size: 1950 bytes --]
% ConTeXt file
% filename: test-thumb-pictures
% 18-03-2022
\startsetups[Thumb-pictures]
\definecolor[chap_frame][black] %[g=1,t=1,a=12]
\definecolor[textcolor][white] %[r=1,t=1,a=12]
\startuseMPgraphic{chapter-thumb}
path chap_frame ;
pair pos,a,b ;
picture Chap ;
if \somenamedheadnumber{chapter}{current} > 0 :
curr_chap := \somenamedheadnumber{chapter}{current} ;
else :
curr_chap := 1 ;
fi;
if \somenamedheadnumber{chapter}{last} > 0 :
last_chap := \somenamedheadnumber{chapter}{last} ;
else :
last_chap := 1 ;
fi;
if \somenamedheadnumber{section}{current} > 0 :
curr_sect := \somenamedheadnumber{section}{current} ;
else:
curr_sect := 1 ;
fi;
if \somenamedheadnumber{section}{last} > 0 :
last_sect := \somenamedheadnumber{section}{last};
else:
last_sect := 1;
fi;
if curr_chap < 11 :
skip := TextHeight * (curr_chap-1)/11 ;
elseif curr_chap < 21 :
skip := TextHeight * (curr_chap-11)/11 ;
else:
skip := TextHeight * (curr_chap-21)/11 ;
fi;
Chap := textext("\bfa\textcolor\getmarking[chapter]");
StartPage ;
chap_frame := lcircle xscaled (2*RightMarginWidth) yscaled (1.5*RightMarginWidth);
a := ulcorner chap_frame ;
b := urcorner chap_frame ;
pos := urcorner Field[Text][RightMarginSeparator] -
ulcorner chap_frame - (-1mm,skip);
fill chap_frame shifted pos withcolor \MPcolor{chap_frame};
draw Chap rotated 90 shifted (xpart pos-4mm,ypart pos) ;
StopPage ;
\stopuseMPgraphic
\defineoverlay[chapter-thumb][\useMPgraphic{chapter-thumb}]
\setupbackgrounds[rightpage][background=chapter-thumb]
\stopsetups
\showframe
\starttext
\startchapter[title=Test A]
\samplefile{ward}
\stopchapter
\page[yes]
% \startchapter[title=Test B]
% \samplefile{ward}
% \stopchapter
\setups{Thumb-pictures}
\startchapter[title=Test C]
\samplefile{ward}
\stopchapter
%
\stoptext
[-- Attachment #3: test-thumb-picture.pdf --]
[-- Type: application/pdf, Size: 15533 bytes --]
[-- Attachment #4: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
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] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-18 19:29 Metafun, difficulty with graphical element in the margin Willi Egger via ntg-context
@ 2022-03-19 5:41 ` śrīrāma via ntg-context
2022-03-19 8:39 ` Hans Hagen via ntg-context
2022-03-19 15:52 ` Otared Kavian via ntg-context
2 siblings, 0 replies; 13+ messages in thread
From: śrīrāma via ntg-context @ 2022-03-19 5:41 UTC (permalink / raw)
To: Mailing list for ConTeXt users; +Cc: śrīrāma, Willi Egger
On Saturday, March 19, 2022 12:59 AM Willi Egger via ntg-context wrote:
> Could someone try to compile?
I have compiled your test file with both the below versions :
• mtx-context | current version: 2022.01.21 20:13
• mtx-context | current version: 2022.03.12 17:56
In both cases, no errors were emitted by MetaFun; the output also seems to be as expected (thumb pictures progressively moving downward with every chapter).
Sreeram
___________________________________________________________________________________
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] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-18 19:29 Metafun, difficulty with graphical element in the margin Willi Egger via ntg-context
2022-03-19 5:41 ` śrīrāma via ntg-context
@ 2022-03-19 8:39 ` Hans Hagen via ntg-context
2022-03-19 15:52 ` Otared Kavian via ntg-context
2 siblings, 0 replies; 13+ messages in thread
From: Hans Hagen via ntg-context @ 2022-03-19 8:39 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Hans Hagen, Willi Egger
On 3/18/2022 8:29 PM, Willi Egger via ntg-context wrote:
> Good evening!
>
> I have a dictionary where I would like to include thumb-pictures in the margin. — When I use the attached code with a single \startchapter...\stopchapter, it works. However if I add another \startchapter…\stopchapter before loading the setups for the thumb-picture metafun throws an error about not having complete information for performing a transformation.
>
> I am currently using the before last version of LMTX-ConTeXT (January 21st 2022).
>
> Could someone try to compile?
works here (with the latest)
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | www.pragma-ade.nl | 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://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-18 19:29 Metafun, difficulty with graphical element in the margin Willi Egger via ntg-context
2022-03-19 5:41 ` śrīrāma via ntg-context
2022-03-19 8:39 ` Hans Hagen via ntg-context
@ 2022-03-19 15:52 ` Otared Kavian via ntg-context
2022-03-19 20:42 ` Willi Egger via ntg-context
2 siblings, 1 reply; 13+ messages in thread
From: Otared Kavian via ntg-context @ 2022-03-19 15:52 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Otared Kavian
Hi Willi,
Your test file works fine if I place
\setups{Thumb-pictures}
before \starttext (using version 2022.03.12 17:56 LMTX).
However in the file you sent the choice of the command
\setups{Thumb-pictures}
is between chapter A and B, which seems starnge to me...
Best regards: Otared K.
> On 18 Mar 2022, at 20:29, Willi Egger via ntg-context <ntg-context@ntg.nl> wrote:
>
> Good evening!
>
> I have a dictionary where I would like to include thumb-pictures in the margin. — When I use the attached code with a single \startchapter...\stopchapter, it works. However if I add another \startchapter…\stopchapter before loading the setups for the thumb-picture metafun throws an error about not having complete information for performing a transformation.
>
> I am currently using the before last version of LMTX-ConTeXT (January 21st 2022).
>
> Could someone try to compile?
>
> Thanks, kind regards
>
> Willi<test-thumb-picture.tex><test-thumb-picture.pdf>___________________________________________________________________________________
> 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-19 15:52 ` Otared Kavian via ntg-context
@ 2022-03-19 20:42 ` Willi Egger via ntg-context
2022-03-19 22:39 ` Otared Kavian via ntg-context
2022-03-20 10:28 ` Wolfgang Schuster via ntg-context
0 siblings, 2 replies; 13+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-19 20:42 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Willi Egger
Hello Otared,
thanks so much for your testing and comments. — Tthe problem is, that this thumb-picture should only be placed in the \startboydmatter..\stopbodymatter sections. In the case of this book however there are the title pages and quite some text including the TOC in the \startfrontmatter..\stopfrontmatter. SO I end up with being forced to invoke the setups at the beginning of the bodymatter.
Thanks!
Kind regards
Willi
> On 19 Mar 2022, at 16:52, Otared Kavian via ntg-context <ntg-context@ntg.nl> wrote:
>
> Hi Willi,
>
> Your test file works fine if I place
> \setups{Thumb-pictures}
> before \starttext (using version 2022.03.12 17:56 LMTX).
> However in the file you sent the choice of the command
> \setups{Thumb-pictures}
> is between chapter A and B, which seems starnge to me...
>
> Best regards: Otared K.
>
>> On 18 Mar 2022, at 20:29, Willi Egger via ntg-context <ntg-context@ntg.nl> wrote:
>>
>> Good evening!
>>
>> I have a dictionary where I would like to include thumb-pictures in the margin. — When I use the attached code with a single \startchapter...\stopchapter, it works. However if I add another \startchapter…\stopchapter before loading the setups for the thumb-picture metafun throws an error about not having complete information for performing a transformation.
>>
>> I am currently using the before last version of LMTX-ConTeXT (January 21st 2022).
>>
>> Could someone try to compile?
>>
>> Thanks, kind regards
>>
>> Willi<test-thumb-picture.tex><test-thumb-picture.pdf>___________________________________________________________________________________
>> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-19 20:42 ` Willi Egger via ntg-context
@ 2022-03-19 22:39 ` Otared Kavian via ntg-context
2022-03-20 15:46 ` Willi Egger via ntg-context
2022-03-20 10:28 ` Wolfgang Schuster via ntg-context
1 sibling, 1 reply; 13+ messages in thread
From: Otared Kavian via ntg-context @ 2022-03-19 22:39 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Otared Kavian
Hi Willi,
How about invoking the command \setups{Thumb-pictures} between a \start \stop pair as in the following:
\showframe
\starttext
\startfrontmatter
\startchapter[title=Test A]
\samplefile{knuth}
\stopchapter
\stopfrontmatter
%\page[yes]
\start
\setups{Thumb-pictures}
\startbodymatter
\startchapter[title=Test B]
\samplefile{ward}
\stopchapter
\startchapter[title=Test C]
\samplefile{ward}
\stopchapter
\startchapter[title=Test D]
\samplefile{ward}
\stopchapter
\stopbodymatter
\stop
\startbackmatter
\dorecurse{5}{\startchapter[title=Test #1]
\samplefile{thuan}
\stopchapter}
\stopbackmatter
\stoptext
> On 19 Mar 2022, at 21:42, Willi Egger via ntg-context <ntg-context@ntg.nl> wrote:
>
> Hello Otared,
>
> thanks so much for your testing and comments. — Tthe problem is, that this thumb-picture should only be placed in the \startboydmatter..\stopbodymatter sections. In the case of this book however there are the title pages and quite some text including the TOC in the \startfrontmatter..\stopfrontmatter. SO I end up with being forced to invoke the setups at the beginning of the bodymatter.
>
> Thanks!
> Kind regards
>
> Willi
>
>> On 19 Mar 2022, at 16:52, Otared Kavian via ntg-context <ntg-context@ntg.nl> wrote:
>>
>> Hi Willi,
>>
>> Your test file works fine if I place
>> \setups{Thumb-pictures}
>> before \starttext (using version 2022.03.12 17:56 LMTX).
>> However in the file you sent the choice of the command
>> \setups{Thumb-pictures}
>> is between chapter A and B, which seems starnge to me...
>>
>> Best regards: Otared K.
>>
>>> On 18 Mar 2022, at 20:29, Willi Egger via ntg-context <ntg-context@ntg.nl> wrote:
>>>
>>> Good evening!
>>>
>>> I have a dictionary where I would like to include thumb-pictures in the margin. — When I use the attached code with a single \startchapter...\stopchapter, it works. However if I add another \startchapter…\stopchapter before loading the setups for the thumb-picture metafun throws an error about not having complete information for performing a transformation.
>>>
>>> I am currently using the before last version of LMTX-ConTeXT (January 21st 2022).
>>>
>>> Could someone try to compile?
>>>
>>> Thanks, kind regards
>>>
>>> Willi<test-thumb-picture.tex><test-thumb-picture.pdf>___________________________________________________________________________________
>>> 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
>> ___________________________________________________________________________________
>
> ___________________________________________________________________________________
> 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-19 20:42 ` Willi Egger via ntg-context
2022-03-19 22:39 ` Otared Kavian via ntg-context
@ 2022-03-20 10:28 ` Wolfgang Schuster via ntg-context
2022-03-20 15:53 ` Willi Egger via ntg-context
1 sibling, 1 reply; 13+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2022-03-20 10:28 UTC (permalink / raw)
To: mailing list for ConTeXt users, Willi Egger via ntg-context
Cc: Wolfgang Schuster, Willi Egger
Willi Egger via ntg-context schrieb am 19.03.2022 um 21:42:
> Hello Otared,
>
> thanks so much for your testing and comments. — Tthe problem is, that this thumb-picture should only be placed in the \startboydmatter..\stopbodymatter sections. In the case of this book however there are the title pages and quite some text including the TOC in the \startfrontmatter..\stopfrontmatter. SO I end up with being forced to invoke the setups at the beginning of the bodymatter.
Use sectionblockenvironment to set value which are only applied in the
frontmatter, bodymatter etc.
%%%% begin example
% Global settings for all chapters
\setuphead[chapter][style=\ssc]
% Local settings for chapter in the bodymatter block
\startsectionblockenvironment[bodypart]
\setuphead[chapter][color=blue]
\stopsectionblockenvironment
\starttext
\startfrontmatter
\title{Table of content}
\placecontent
\stopfrontmatter
\startbodymatter
\chapter{Knuth}
\input knuth
\chapter{Zapf}
\input zapf
\stopbodymatter
\stoptext
%%%% end example
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] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-19 22:39 ` Otared Kavian via ntg-context
@ 2022-03-20 15:46 ` Willi Egger via ntg-context
0 siblings, 0 replies; 13+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-20 15:46 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Willi Egger
Hi Otared,
thank you for your help. — I tried your approach aswel on my Mac as also on Linux. Unfortunately neither installation did give me a positive result. The error remains.
Kind regards
Willi
> On 19 Mar 2022, at 23:39, Otared Kavian via ntg-context <ntg-context@ntg.nl> wrote:
>
> Hi Willi,
>
> How about invoking the command \setups{Thumb-pictures} between a \start \stop pair as in the following:
>
> \showframe
>
> \starttext
>
> \startfrontmatter
> \startchapter[title=Test A]
> \samplefile{knuth}
> \stopchapter
>
> \stopfrontmatter
>
> %\page[yes]
>
> \start
> \setups{Thumb-pictures}
>
> \startbodymatter
> \startchapter[title=Test B]
> \samplefile{ward}
> \stopchapter
>
> \startchapter[title=Test C]
> \samplefile{ward}
> \stopchapter
>
> \startchapter[title=Test D]
> \samplefile{ward}
> \stopchapter
>
>
> \stopbodymatter
> \stop
>
> \startbackmatter
> \dorecurse{5}{\startchapter[title=Test #1]
> \samplefile{thuan}
> \stopchapter}
>
> \stopbackmatter
>
> \stoptext
>
>
>> On 19 Mar 2022, at 21:42, Willi Egger via ntg-context <ntg-context@ntg.nl> wrote:
>>
>> Hello Otared,
>>
>> thanks so much for your testing and comments. — Tthe problem is, that this thumb-picture should only be placed in the \startboydmatter..\stopbodymatter sections. In the case of this book however there are the title pages and quite some text including the TOC in the \startfrontmatter..\stopfrontmatter. SO I end up with being forced to invoke the setups at the beginning of the bodymatter.
>>
>> Thanks!
>> Kind regards
>>
>> Willi
>>
>>> On 19 Mar 2022, at 16:52, Otared Kavian via ntg-context <ntg-context@ntg.nl> wrote:
>>>
>>> Hi Willi,
>>>
>>> Your test file works fine if I place
>>> \setups{Thumb-pictures}
>>> before \starttext (using version 2022.03.12 17:56 LMTX).
>>> However in the file you sent the choice of the command
>>> \setups{Thumb-pictures}
>>> is between chapter A and B, which seems starnge to me...
>>>
>>> Best regards: Otared K.
>>>
>>>> On 18 Mar 2022, at 20:29, Willi Egger via ntg-context <ntg-context@ntg.nl> wrote:
>>>>
>>>> Good evening!
>>>>
>>>> I have a dictionary where I would like to include thumb-pictures in the margin. — When I use the attached code with a single \startchapter...\stopchapter, it works. However if I add another \startchapter…\stopchapter before loading the setups for the thumb-picture metafun throws an error about not having complete information for performing a transformation.
>>>>
>>>> I am currently using the before last version of LMTX-ConTeXT (January 21st 2022).
>>>>
>>>> Could someone try to compile?
>>>>
>>>> Thanks, kind regards
>>>>
>>>> Willi<test-thumb-picture.tex><test-thumb-picture.pdf>___________________________________________________________________________________
>>>> 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
>>> ___________________________________________________________________________________
>>
>> ___________________________________________________________________________________
>> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-20 10:28 ` Wolfgang Schuster via ntg-context
@ 2022-03-20 15:53 ` Willi Egger via ntg-context
2022-03-20 16:00 ` Wolfgang Schuster via ntg-context
0 siblings, 1 reply; 13+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-20 15:53 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Willi Egger
Hoi Wolfgang!
thank you for your suggestion. Your example indeed works. However if I apply this to my situation, which is
\startsectionblockenvironment[bodymatter]
\setups{Thumb-pictures}
\stopsectionblockenvironment
nothing happens. I.e. I get no error, but also no picture, indicating, that the \setups command is not executed..
Kind regards
Willi
> On 20 Mar 2022, at 11:28, Wolfgang Schuster via ntg-context <ntg-context@ntg.nl> wrote:
>
> Willi Egger via ntg-context schrieb am 19.03.2022 um 21:42:
>> Hello Otared,
>> thanks so much for your testing and comments. — Tthe problem is, that this thumb-picture should only be placed in the \startboydmatter..\stopbodymatter sections. In the case of this book however there are the title pages and quite some text including the TOC in the \startfrontmatter..\stopfrontmatter. SO I end up with being forced to invoke the setups at the beginning of the bodymatter.
>
> Use sectionblockenvironment to set value which are only applied in the frontmatter, bodymatter etc.
>
> %%%% begin example
> % Global settings for all chapters
> \setuphead[chapter][style=\ssc]
>
> % Local settings for chapter in the bodymatter block
> \startsectionblockenvironment[bodypart]
> \setuphead[chapter][color=blue]
> \stopsectionblockenvironment
>
> \starttext
>
> \startfrontmatter
>
> \title{Table of content}
>
> \placecontent
>
> \stopfrontmatter
>
> \startbodymatter
>
> \chapter{Knuth}
>
> \input knuth
>
> \chapter{Zapf}
>
> \input zapf
>
> \stopbodymatter
>
> \stoptext
> %%%% end example
>
> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-20 15:53 ` Willi Egger via ntg-context
@ 2022-03-20 16:00 ` Wolfgang Schuster via ntg-context
2022-03-20 16:05 ` Willi Egger via ntg-context
0 siblings, 1 reply; 13+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2022-03-20 16:00 UTC (permalink / raw)
To: mailing list for ConTeXt users, Willi Egger via ntg-context
Cc: Wolfgang Schuster, Willi Egger
Willi Egger via ntg-context schrieb am 20.03.2022 um 16:53:
> Hoi Wolfgang!
>
> thank you for your suggestion. Your example indeed works. However if I apply this to my situation, which is
>
> \startsectionblockenvironment[bodymatter]
You use the wrong name for the argument:
\startsectionblockenvironment[bodypart]
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] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-20 16:00 ` Wolfgang Schuster via ntg-context
@ 2022-03-20 16:05 ` Willi Egger via ntg-context
2022-03-20 16:21 ` Wolfgang Schuster via ntg-context
0 siblings, 1 reply; 13+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-20 16:05 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Willi Egger
Hoi Wolfgang,
I tested both variants (bodymatter and bodypart. The compilation runs through, however without the thumb-picture in the margin and the metafun error is in the log.
Gruß!
Willi
> On 20 Mar 2022, at 17:00, Wolfgang Schuster via ntg-context <ntg-context@ntg.nl> wrote:
>
> Willi Egger via ntg-context schrieb am 20.03.2022 um 16:53:
>> Hoi Wolfgang!
>>
>> thank you for your suggestion. Your example indeed works. However if I apply this to my situation, which is
>>
>> \startsectionblockenvironment[bodymatter]
>
> You use the wrong name for the argument:
>
> \startsectionblockenvironment[bodypart]
>
> 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
> ___________________________________________________________________________________
___________________________________________________________________________________
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] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-20 16:05 ` Willi Egger via ntg-context
@ 2022-03-20 16:21 ` Wolfgang Schuster via ntg-context
2022-03-21 9:04 ` Willi Egger via ntg-context
0 siblings, 1 reply; 13+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2022-03-20 16:21 UTC (permalink / raw)
To: mailing list for ConTeXt users, Willi Egger via ntg-context
Cc: Wolfgang Schuster, Willi Egger
[-- Attachment #1: Type: text/plain, Size: 550 bytes --]
Willi Egger via ntg-context schrieb am 20.03.2022 um 17:05:
> Hoi Wolfgang,
>
> I tested both variants (bodymatter and bodypart. The compilation runs through, however without the thumb-picture in the margin and the metafun error is in the log.
1. Do you use \startfrontmatter and \startbodymatter in your document to
create blocks?
2. Is you installation up-to-date?
Attached is a slightly modified version of your example, the only thing
which has to be local to the bodypart is the background setting to
enable the thumb pictures.
Wolfgang
[-- Attachment #2: test.tex --]
[-- Type: text/plain, Size: 9048 bytes --]
\definecolor [chap_frame] [black]
\definecolor [textcolor] [white]
\startuseMPgraphic{chapter-thumb}
path chap_frame ;
pair pos,a,b ;
picture Chap ;
if \somenamedheadnumber{chapter}{current} > 0 :
curr_chap := \somenamedheadnumber{chapter}{current} ;
else :
curr_chap := 1 ;
fi;
if \somenamedheadnumber{chapter}{last} > 0 :
last_chap := \somenamedheadnumber{chapter}{last} ;
else :
last_chap := 1 ;
fi;
if \somenamedheadnumber{section}{current} > 0 :
curr_sect := \somenamedheadnumber{section}{current} ;
else:
curr_sect := 1 ;
fi;
if \somenamedheadnumber{section}{last} > 0 :
last_sect := \somenamedheadnumber{section}{last} ;
else:
last_sect := 1;
fi;
if curr_chap < 11 :
skip := TextHeight * (curr_chap-1)/11 ;
elseif curr_chap < 21 :
skip := TextHeight * (curr_chap-11)/11 ;
else:
skip := TextHeight * (curr_chap-21)/11 ;
fi;
Chap := textext("\bfa\textcolor\getmarking[chapter]") ;
StartPage ;
chap_frame := lcircle xscaled (2*RightMarginWidth) yscaled (1.5*RightMarginWidth) ;
a := ulcorner chap_frame ;
b := urcorner chap_frame ;
pos := urcorner Field[Text][RightMarginSeparator] - ulcorner chap_frame - (-1mm,skip) ;
fill chap_frame shifted pos withcolor "chap_frame" ;
draw Chap rotated 90 shifted (xpart pos-4mm,ypart pos) ;
StopPage ;
\stopuseMPgraphic
\defineoverlay[chapter-thumb][\useMPgraphic{chapter-thumb}]
\startsectionblockenvironment[bodypart]
\setupbackgrounds[rightpage][background=chapter-thumb]
\stopsectionblockenvironment
\showframe
\starttext
\startfrontmatter
\startchapter[title=Test A]
\samplefile{ward}
\stopchapter
\stopfrontmatter
\startbodymatter
\startchapter[title=Test C]
\samplefile{ward}
\stopchapter
\stopbodymatter
\stoptext
% Global settings for all chapters
\setuphead[chapter][style=\ssc]
% Local settings for chapter in the bodymatter block
\startsectionblockenvironment[bodypart]
\setuphead[chapter][color=blue]
\stopsectionblockenvironment
\starttext
\startfrontmatter
\title{Table of content}
\placecontent
\stopfrontmatter
\startbodymatter
\chapter{Knuth}
\input knuth
\chapter{Zapf}
\input zapf
\stopbodymatter
\stoptext
\starttext
a\texttilde b\lettertilde c\textasciitilde d
\stoptext
\definepageinjectionalternative
[chapter:image]
[renderingsetup=pageinjection:chapter:image]
\startsetups [pageinjection:chapter:image]
\centerbox{\externalfigure[\dummyparameter{name}]}
\stopsetups
\definepageinjection
[chapter:start]
[empty]
[page=left]
\definepageinjection
[chapter:insert]
[previouspage]
[alternative=chapter:image,
offset=1cm,
pagestate=stop]
\setuphead
[chapter]
[beforesection={\pageinjection[chapter:start]},
insidesection={\pageinjection[chapter:insert][name={chapter-\namedheadnumber{chapter}}]}]
\setuppagenumbering
[alternative=doublesided]
\setupexternalfigures
[location=default]
\useexternalfigure [chapter-1] [mill] [factor=max]
\useexternalfigure [chapter-2] [hacker] [orientation=90,scale=2000]
\useexternalfigure [chapter-3] [cow] [orientation=90,height=\framedwidth]
\starttext
\startchapter [title={Mill}]
\dorecurse{7}{\samplefile{lorem}}
\stopchapter
\startchapter [title={Hacker}]
\dorecurse{11}{\samplefile{lorem}}
\stopchapter
\startchapter [title={cow}]
\dorecurse{7}{\samplefile{lorem}}
\stopchapter
\stoptext
\setupbodyfont[termes]
\starttext
plays \m{\frac{2}{3} A}, \m{\frac{1}{3} D}.
\stoptext
\definefallbackfamily[story][serif][notoserif][range={greekandcoptic,greekextended},force=yes]
\definefontfamily[story][serif][TeX Gyre Schola]
\definefontfamily [story] [sans] [Latin Modern Sans]
\definefontfamily [story] [mono] [Latin Modern Mono] [features=none]
\definetypeface [story] [ss] [sans] [modern] [default]
\definetypeface [story] [ss] [mono] [modern] [default]
\definetypeface [story] [ss] [sans] [modern-designsize] [default]
\definetypeface [story] [ss] [mono] [modern-designsize] [default]
\definefontfamily[story][mm][TeX Gyre Pagella Math]
\definetypeface [story] [mm] [math] [pagella] [default]
\setupbodyfont[story,11pt]
\usebodyfont[termes]
\showframe
\startsetups [blockquote:style]
\switchtobodyfont[termes]
\setupwhitespace[2pt]
\stopsetups
\setupdelimitedtext
[blockquote]
[spacebefore=big,
style=\directsetup{blockquote:style},
indenting=none,
indentnext=yes]
\starttext
\chapter{Testing}
\input ward
\startblockquote
\input knuth
\stopblockquote
\input zapf
{\it This is what Italic letters look like.} {\bf And these are bold.}
\startblockquote
This is what it said, in {\it Italic} and {\bf bold} letters:
\bgroup
\it This is what Italic letters look like here.
\egroup
\bgroup
\bf This is what Bold letters look like here.
\egroup
\stopblockquote
\stoptext
\definelayer [testlayer]
\setupbackgrounds [text] [text] [background=testlayer]
%\setupbackgrounds[state=repeat]
\starttext
\setlayer [testlayer] [x=1cm,y=1cm] {Text background}
\dorecurse{4}{xxx\page}
\stoptext
\starttext
text {\italicface text {\boldface text} text} text
text {\it text {\bf text} text} text: here the third instance of text is in boldface, but not in italic boldface.
text {\it text {\bi text} text} text
\stoptext
\unprotect
\def\pack_layers_positioned_box_nop
{\vpack
{\writestatus{WOLF}{\getboxlly\b_layers}%
\writestatus{WOLF}{\getboxllx\b_layers}%
\vskip-\getboxlly\b_layers
\hskip-\getboxllx\b_layers
\hsize-\dimexpr\getboxllx\b_layers-\wd\b_layers\relax
\ifconditional\c_pack_layers_repeated\copy\else\box\fi\b_layers}}
\protect
\setuppapersize[A4][A3]
\setuplayout[location=middle]
\definelayer
[test]
[%option=test,
%method=fit,
position=yes]
\setupbackgrounds [text] [text] [background=test]
\setupbackgrounds[state=repeat]
\starttext
text \setlayer[test]{layer} text
\page
text
\stoptext
\starttext
\startitemize[columns,three]
\startitem One \stopitem
\startitem Two\par Three \stopitem
\stopitemize
\stoptext
\starttext
text {\italicface text {\boldface text} text} text
\stoptext
\unprotect
\def\page_backgrounds_set_boxes
{\ifconditional\c_page_backgrounds_new
\page_backgrounds_set_boxes_r
\fi
\doifbothsides
\page_backgrounds_set_boxes_a
\page_backgrounds_set_boxes_b
\page_backgrounds_set_boxes_c
\ifx\p_page_backgrounds_state\v!repeat\else
\global\setfalse\c_page_backgrounds_new
\fi}
\protect
%\definelayer [l_page]
\definelayer [l_text]
%\setupbackgrounds [page] [background=l_page]
\setupbackgrounds [text] [text] [background=l_text]
\setupbackgrounds[state=repeat]
\starttext
%\setlayer [l_page] [x=1cm,y=1cm] {Page background}
\setlayer [l_text] [x=1cm,y=1cm] {Text background}
\tracingmacros1
\dorecurse{4}{xxx\page}
\tracingmacros0
\stoptext
\showgrid
\starttext
\samplefile{lorem}
\page
\start \setupinterlinespace[2]% 2 lines, also possible: 1.5, 3, ...
\samplefile{lorem}\par
\stop
\page
\start \setupinterlinespace[line=5.6ex]% also possible: \setupinterlinespace[5.6ex]
\samplefile{lorem}\par
\stop
\stoptext
\starttexdefinition RemovePreceding #1
\removeunwantedspaces
#1
\stoptexdefinition
\starttexdefinition RemoveFollowing #1
#1
\ignorespaces
\stoptexdefinition
\starttext
Bla \RemovePreceding{Bla} Bla
Bla \RemoveFollowing{Bla} Bla
\stoptext
\starttexdefinition Italic #1
\emphasized{#1}
\autoinsertnextspace
\stoptexdefinition
\starttexdefinition Underbar #1
\underbar{#1}
\stoptexdefinition
\starttext
Bla Bla Bla
\Underbar{\Italic{Bla} , Bla Bla.}
\stoptext
\startxmlsetups xml:test
\xmlsetsetup{#1}{*}{-}
\xmlsetsetup{#1}{article|p|italic|underline}{xml:*}
\stopxmlsetups
\xmlregistersetup{xml:test}
\startxmlsetups xml:article
\starttext
\xmlflush{#1}
\stoptext
\stopxmlsetups
\startxmlsetups xml:p
\xmlflush{#1}\par
\stopxmlsetups
\startxmlsetups xml:italic
\emph{\xmlflush{#1}}
\stopxmlsetups
\startxmlsetups xml:underline
\underbar{\xmlflush{#1}}
\stopxmlsetups
\startbuffer[test]
<?xml version="1.0" encoding="UTF-8"?>
<article>
<p>Bla Bla Bla</p>
<p>
<underline>
<italic>Bla</italic>
</underline>, Bla Bla.</p>
</article>
\stopbuffer
\starttext
\xmlprocessbuffer{test}{test}{}
\stoptext
[-- Attachment #3: Type: text/plain, Size: 493 bytes --]
___________________________________________________________________________________
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] 13+ messages in thread
* Re: Metafun, difficulty with graphical element in the margin
2022-03-20 16:21 ` Wolfgang Schuster via ntg-context
@ 2022-03-21 9:04 ` Willi Egger via ntg-context
0 siblings, 0 replies; 13+ messages in thread
From: Willi Egger via ntg-context @ 2022-03-21 9:04 UTC (permalink / raw)
To: mailing list for ConTeXt users; +Cc: Willi Egger
Hello Wolfgang,
thank you so much for your time and investigation. — Indeed your solution works fine!
I use the latest version from March 2022.
I use \startbodymatter cum suis.
Lieber Gruß
Willi
> On 20 Mar 2022, at 17:21, Wolfgang Schuster via ntg-context <ntg-context@ntg.nl> wrote:
>
> Willi Egger via ntg-context schrieb am 20.03.2022 um 17:05:
>> Hoi Wolfgang,
>>
>> I tested both variants (bodymatter and bodypart. The compilation runs through, however without the thumb-picture in the margin and the metafun error is in the log.
>
> 1. Do you use \startfrontmatter and \startbodymatter in your document to create blocks?
>
> 2. Is you installation up-to-date?
>
> Attached is a slightly modified version of your example, the only thing which has to be local to the bodypart is the background setting to enable the thumb pictures.
>
> Wolfgang
>
> <test.tex>___________________________________________________________________________________
> 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-03-21 9:04 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 19:29 Metafun, difficulty with graphical element in the margin Willi Egger via ntg-context
2022-03-19 5:41 ` śrīrāma via ntg-context
2022-03-19 8:39 ` Hans Hagen via ntg-context
2022-03-19 15:52 ` Otared Kavian via ntg-context
2022-03-19 20:42 ` Willi Egger via ntg-context
2022-03-19 22:39 ` Otared Kavian via ntg-context
2022-03-20 15:46 ` Willi Egger via ntg-context
2022-03-20 10:28 ` Wolfgang Schuster via ntg-context
2022-03-20 15:53 ` Willi Egger via ntg-context
2022-03-20 16:00 ` Wolfgang Schuster via ntg-context
2022-03-20 16:05 ` Willi Egger via ntg-context
2022-03-20 16:21 ` Wolfgang Schuster via ntg-context
2022-03-21 9:04 ` Willi Egger via ntg-context
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).