ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* SimpleSlides and Visual counters
@ 2021-11-15 14:33 Otared Kavian via ntg-context
  2021-11-16 17:34 ` Aditya Mahajan via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Otared Kavian via ntg-context @ 2021-11-15 14:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

Hi all, in particular Aditya M. and Thomas A.S.,

It seems that the visual counter in  SimpleSlides module (the version I have from ConTeXt Garden is from 2014) does not work fine with the latest LMTX.
Is the issue is known ? If so, is there a new version of SimpleSlides in which the issue has been fixed ?

Best regards: Otared
___________________________________________________________________________________
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] 6+ messages in thread

* Re: SimpleSlides and Visual counters
  2021-11-15 14:33 SimpleSlides and Visual counters Otared Kavian via ntg-context
@ 2021-11-16 17:34 ` Aditya Mahajan via ntg-context
  2021-11-16 22:11   ` Otared Kavian via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Aditya Mahajan via ntg-context @ 2021-11-16 17:34 UTC (permalink / raw)
  To: Otared Kavian via ntg-context; +Cc: Aditya Mahajan

On Mon, 15 Nov 2021, Otared Kavian via ntg-context wrote:

Hi Otared,

> It seems that the visual counter in  SimpleSlides module (the version I have from ConTeXt Garden is from 2014) does not work fine with the latest LMTX.
> Is the issue is known ? If so, is there a new version of SimpleSlides in which the issue has been fixed ?

I haven't looked at simpleslides in over a decade! The module did use some low-level macros, which are unlikely to work with LMTX without change. 

It could also be a bug with visualcounter module. I haven't tested in with LMTX (I still use MkIV for most of my presentations). If you can post a minimal example, I could take a look.

Thanks,
Aditya

___________________________________________________________________________________
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] 6+ messages in thread

* Re: SimpleSlides and Visual counters
  2021-11-16 17:34 ` Aditya Mahajan via ntg-context
@ 2021-11-16 22:11   ` Otared Kavian via ntg-context
  2022-01-16 14:56     ` Otared Kavian via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Otared Kavian via ntg-context @ 2021-11-16 22:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

Hi Aditya,

Thank you for your attention and your kind reply.

I am sending a setup file with an example of presentation, which shows the issue with LMTX while with mkiv the result is fine.
Actually as you can see in the setup file, I have slightly modified the visula counter in order for it to be interactive (clicking in the center of the visula counter gives a jump to the previous location…).

Best regards: Otared


[-- Attachment #2: presentation.tex --]
[-- Type: application/octet-stream, Size: 441 bytes --]

% !TEX useConTeXtSyncParser 
%!TEX TS-program = ConTeXt (LuaTeX)

\setupsynctex[state=start,method=max]
\input conf-pre-setup.tex

\starttext

\setupTitle
	[title={Somewhere university},
	author={Someone Else},
	date={Somewhere, Someday 2021}]
\placeTitle

\placeListOfTopics{Today's talk}

\page
\Topic{Knuth} 

\input knuth.tex

\Topic{Ward} 

\input ward.tex

\Topic{Lorem} 

\input lorem.tex

\Topic{Thuan} 

\input thuan.tex

\stoptext

[-- Attachment #3: Type: text/plain, Size: 1 bytes --]



[-- Attachment #4: conf-pre-setup.tex --]
[-- Type: application/octet-stream, Size: 2419 bytes --]

\usemodule[simpleslides]
	[style=swoosh]

%%%%%%%%%%%%%%%%%%%%%%
%%% we redefine the visualcounter circle to make it interactive:
%%% clicking on the page number shown in the middle
%%% makes the PDF viewer to do a PreviousJump

\setupinteraction[state=start]
\startuseMPgraphic{simpleslides:MP:counter}
save b, s, t, p, circcenter, theta, pic ;
path p[] ;
pair t[] ;
pair s[] ;
pair circcenter ; 
circcenter = urcorner Page shifted (-1cm,-1cm) ;
% circcenter = lrcorner Page shifted (-1cm,1cm) ; 
pair zt, zr, zb, zl ;
picture pic ;
b = 1.5cm ;
if PageNumber > 3: % the page after which the visual counter is shown
	theta = (PageNumber - 1)/(NOfPages - 1) ;
 	p[4] = fullcircle scaled b rotated 90 ;
	p[4] := p[4] shifted circcenter ;
 	fill p[4] withcolor \MPcolor{simpleslides:altcontrastcolor} ;
 	t[0] = center p[4] ;
 	t[1] = point 1 along p[4] ;
 	t[2] = point -theta along p[4] ;
 	t[3] = point -theta/2 along p[4] ;
 	p[5] = t[0] -- t[1] .. t[3] .. t[2] -- cycle ;
 	fill p[5] withcolor \MPcolor{simpleslides:contrastcolor} ;
 	for i = 1 upto NOfPages :
 		s[i] = point i/(NOfPages -1) along p[4] ;
 		pickup pencircle scaled 1pt ;
 		draw s[i] -- t[0] withcolor \MPcolor{simpleslides:backgroundcolor} ;
 	endfor ;
 	zt = t[0] shifted (0, b * 0.2) ;
	zr = t[0] shifted (b * 0.2, 0) ;
	zb = t[0] shifted (0, -b * 0.2) ;
	zl = t[0] shifted (-b * 0.2, 0) ;
	p[3] = zt .. zr .. zb .. zl .. cycle ;
 	fill p[3] withcolor  \MPcolor{simpleslides:contrastcolor} ;
 	draw p[3] withcolor \MPcolor{simpleslides:backgroundcolor} ;
 	label(textext("\start\switchtobodyfont[10pt]%
	\setupinteraction[color=simpleslides:backgroundcolor,style=normal]%
	\startcolor[simpleslides:backgroundcolor]
	\goto{\pagenumber}[PreviousJump]
	\stopcolor\stop"),center p[3]) ;
fi ;
\stopuseMPgraphic

\definelist[ListOfTopics]
\setuplist[ListOfTopics][alternative=f]
\define[1]\GoToMyList{%
	\start
	\setupinteraction[color=simpleslides:backgroundcolor,style=normal]
	\goto{#1}[ListOfTopics]
	\stop}
	
\define[1]\Topic{%
	\SlideTitle{\GoToMyList{#1}}
	\unexpanded\define\TopicTitle{#1}
	\writetolist[ListOfTopics]{}{#1}
	}
\define\Slide{\SlideTitle{\GoToMyList{\TopicTitle}}}

\define[1]\placeListOfTopics{%
	\SlideTitle{#1}
	\start
	\setupinteraction[color=simpleslides:altcontrastcolor,style=bold]
	\startalignment[middle]
		\completelist[ListOfTopics]
	\stopalignment
	\reference[ListOfTopics]{}
	\stop}
%%%%%%%%%%%%%%%%%%%%%%

\endinput

[-- Attachment #5: Type: text/plain, Size: 1339 bytes --]



> On 16 Nov 2021, at 18:34, Aditya Mahajan via ntg-context <ntg-context@ntg.nl> wrote:
> 
> On Mon, 15 Nov 2021, Otared Kavian via ntg-context wrote:
> 
> Hi Otared,
> 
>> It seems that the visual counter in  SimpleSlides module (the version I have from ConTeXt Garden is from 2014) does not work fine with the latest LMTX.
>> Is the issue is known ? If so, is there a new version of SimpleSlides in which the issue has been fixed ?
> 
> I haven't looked at simpleslides in over a decade! The module did use some low-level macros, which are unlikely to work with LMTX without change. 
> 
> It could also be a bug with visualcounter module. I haven't tested in with LMTX (I still use MkIV for most of my presentations). If you can post a minimal example, I could take a look.
> 
> Thanks,
> Aditya
> 
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________


[-- Attachment #6: 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] 6+ messages in thread

* Re: SimpleSlides and Visual counters
  2021-11-16 22:11   ` Otared Kavian via ntg-context
@ 2022-01-16 14:56     ` Otared Kavian via ntg-context
  2022-01-16 15:14       ` Thomas A. Schmitz via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Otared Kavian via ntg-context @ 2022-01-16 14:56 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

[-- Attachment #1: Type: text/plain, Size: 619 bytes --]

Hi Aditya,

Some time ago I reported an issue with LMTX regarding your visual counter (at least the version used in the simpleslides module).
Now I think I have found where the issue comes from: it is due to the fact that somehow the conditional

	if PageNumber > 2 :
		
		[some code]

	fi ;

is not treated correctly, and if one removes the conditional while keeping only [some code] above, then the visual counter is shown correctly. 

I am sending you the TeX file where you can see that if lines 17 and 46 are uncommented then the visual counter does not show up.

Thanks for your help: Otared K.


[-- Attachment #2: bug-visual-counter.tex --]
[-- Type: application/octet-stream, Size: 1955 bytes --]

\setupinteraction[state=start]
\usemodule[simpleslides]
	[style=swoosh]

\startuseMPgraphic{simpleslides:MP:counter}
	save b, s, t, p, circcenter, theta, pic ;
	path p[] ;
	pair t[] ;
	pair s[] ;
	pair circcenter ; 
	circcenter = urcorner Page shifted (-1cm,-1cm) ;
%	circcenter = lrcorner Page shifted (-1cm,1cm) ; 
	pair zt, zr, zb, zl ;
	picture pic ;
	b = 1.5cm ;
% the following if does not work in LMTX
%	if np > 2 : % the page after which the visual counter is shown
		theta = (PageNumber - 1)/(NOfPages - 1) ;
		p[4] = fullcircle scaled b rotated 90 ;
		p[4] := p[4] shifted circcenter ;
		fill p[4] withcolor \MPcolor{simpleslides:altcontrastcolor} ;
		t[0] = center p[4] ;
		t[1] = point 1 along p[4] ;
		t[2] = point -theta along p[4] ;
		t[3] = point -theta/2 along p[4] ;
		p[5] = t[0] -- t[1] .. t[3] .. t[2] -- cycle ;
		fill p[5] withcolor \MPcolor{simpleslides:contrastcolor} ;
		for i = 1 upto NOfPages :
			s[i] = point i/(NOfPages -1) along p[4] ;
			pickup pencircle scaled 1pt ;
			draw s[i] -- t[0] 
				withcolor \MPcolor{simpleslides:backgroundcolor} ;
		endfor ;
		zt = t[0] shifted (0, b * 0.2) ;
		zr = t[0] shifted (b * 0.2, 0) ;
		zb = t[0] shifted (0, -b * 0.2) ;
		zl = t[0] shifted (-b * 0.2, 0) ;
		p[3] = zt .. zr .. zb .. zl .. cycle ;
		fill p[3] withcolor  \MPcolor{simpleslides:contrastcolor} ;
		draw p[3] withcolor \MPcolor{simpleslides:backgroundcolor} ;
		label(textext("\start\switchtobodyfont[10pt]%
			\setupinteraction[color=simpleslides:backgroundcolor,style=normal]%
			\startcolor[simpleslides:backgroundcolor]
			\goto{\pagenumber}[PreviousJump]
			\stopcolor\stop"),center p[3]) ;
%	fi ;
\stopuseMPgraphic

\starttext

\setupTitle
	[title={Somewhere university},
	author={Someone Else},
	date={Somewhere, Someday 2021}]
\placeTitle

\page
\SlideTitle{Knuth} 

\input knuth.tex

\SlideTitle{Ward} 

\input ward.tex

\SlideTitle{Lorem} 

\input lorem.tex

\SlideTitle{Thuan} 

\input thuan.tex

\stoptext

[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




[-- Attachment #4: bug-visual-counter.pdf --]
[-- Type: application/pdf, Size: 17277 bytes --]

[-- Attachment #5: Type: text/plain, Size: 1942 bytes --]




> On 16 Nov 2021, at 23:11, Otared Kavian <otared@gmail.com> wrote:
> 
> Hi Aditya,
> 
> Thank you for your attention and your kind reply.
> 
> I am sending a setup file with an example of presentation, which shows the issue with LMTX while with mkiv the result is fine.
> Actually as you can see in the setup file, I have slightly modified the visula counter in order for it to be interactive (clicking in the center of the visula counter gives a jump to the previous location…).
> 
> Best regards: Otared
> 
> <presentation.tex>
> <conf-pre-setup.tex>
> 
>> On 16 Nov 2021, at 18:34, Aditya Mahajan via ntg-context <ntg-context@ntg.nl> wrote:
>> 
>> On Mon, 15 Nov 2021, Otared Kavian via ntg-context wrote:
>> 
>> Hi Otared,
>> 
>>> It seems that the visual counter in  SimpleSlides module (the version I have from ConTeXt Garden is from 2014) does not work fine with the latest LMTX.
>>> Is the issue is known ? If so, is there a new version of SimpleSlides in which the issue has been fixed ?
>> 
>> I haven't looked at simpleslides in over a decade! The module did use some low-level macros, which are unlikely to work with LMTX without change. 
>> 
>> It could also be a bug with visualcounter module. I haven't tested in with LMTX (I still use MkIV for most of my presentations). If you can post a minimal example, I could take a look.
>> 
>> Thanks,
>> Aditya
>> 
>> ___________________________________________________________________________________
>> 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
>> ___________________________________________________________________________________
> 


[-- Attachment #6: 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] 6+ messages in thread

* Re: SimpleSlides and Visual counters
  2022-01-16 14:56     ` Otared Kavian via ntg-context
@ 2022-01-16 15:14       ` Thomas A. Schmitz via ntg-context
  2022-01-16 15:38         ` Otared Kavian via ntg-context
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas A. Schmitz via ntg-context @ 2022-01-16 15:14 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Thomas A. Schmitz


On 16.01.22 15:56, Otared Kavian via ntg-context wrote:
> Hi Aditya,
> 
> Some time ago I reported an issue with LMTX regarding your visual counter (at least the version used in the simpleslides module).
> Now I think I have found where the issue comes from: it is due to the fact that somehow the conditional
> 
> 	if PageNumber > 2 :
> 		
> 		[some code]
> 
> 	fi ;

Hi Otared,

I'm not Aditya, but I've encountered the same problem within 
simpleslides. Can you replace PageNumber with RealPageNumber and see 
whether this solves your problem?

Best

Thomas
___________________________________________________________________________________
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] 6+ messages in thread

* Re: SimpleSlides and Visual counters
  2022-01-16 15:14       ` Thomas A. Schmitz via ntg-context
@ 2022-01-16 15:38         ` Otared Kavian via ntg-context
  0 siblings, 0 replies; 6+ messages in thread
From: Otared Kavian via ntg-context @ 2022-01-16 15:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

Hi Thomas,

Thanks for your attention. Indeed I could have asked you, but since Aditya answered my previous message I continued asking him…

Anyway, you are correct: replacing PageNumber with RealPageNumber everywhere, the visual counter is shown correctly…

For the sake of the mail archives, in case someone else encounters the issue, I add the example below.

Many thanks for help !
Best regards: Otared 

% begin interactive-visual-counter.tex
%% to use with the simpleslides module
\setupinteraction[state=start]
\usemodule[simpleslides]
	[style=swoosh]

\startuseMPgraphic{simpleslides:MP:counter}
	save b, s, t, p, circcenter, theta, pic ;
	path p[] ;
	pair t[] ;
	pair s[] ;
	pair circcenter ; 
	circcenter = urcorner Page shifted (-1cm,-1cm) ; % the counter is shown in the upper right corner
%	circcenter = lrcorner Page shifted (-1cm,1cm) ; % the counter is shown in the lower right corner
	pair zt, zr, zb, zl ;
	picture pic ;
	b = 1.5cm ;
	if RealPageNumber > 1 : % the page after which the visual counter is shown
		theta = (RealPageNumber - 1)/(NOfPages - 1) ;
		p[4] = fullcircle scaled b rotated 90 ;
		p[4] := p[4] shifted circcenter ;
		fill p[4] withcolor \MPcolor{simpleslides:altcontrastcolor} ;
		t[0] = center p[4] ;
		t[1] = point 1 along p[4] ;
		t[2] = point -theta along p[4] ;
		t[3] = point -theta/2 along p[4] ;
		p[5] = t[0] -- t[1] .. t[3] .. t[2] -- cycle ;
		fill p[5] withcolor \MPcolor{simpleslides:contrastcolor} ;
		for i = 1 upto NOfPages :
			s[i] = point i/(NOfPages -1) along p[4] ;
			pickup pencircle scaled 1pt ;
			draw s[i] -- t[0] 
				withcolor \MPcolor{simpleslides:backgroundcolor} ;
		endfor ;
		zt = t[0] shifted (0, b * 0.2) ;
		zr = t[0] shifted (b * 0.2, 0) ;
		zb = t[0] shifted (0, -b * 0.2) ;
		zl = t[0] shifted (-b * 0.2, 0) ;
		p[3] = zt .. zr .. zb .. zl .. cycle ;
		fill p[3] withcolor  \MPcolor{simpleslides:contrastcolor} ;
		draw p[3] withcolor \MPcolor{simpleslides:backgroundcolor} ;
		label(textext("\start\switchtobodyfont[10pt]%
			\setupinteraction[color=simpleslides:backgroundcolor,style=normal]%
			\startcolor[simpleslides:backgroundcolor]
			\goto{\pagenumber}[PreviousJump]
			\stopcolor\stop"),center p[3]) ;
	fi ;
\stopuseMPgraphic

\starttext

\setupTitle
	[title={Somewhere university},
	author={Someone Else},
	date={Somewhere, Someday 2021}]
\placeTitle

\page
\SlideTitle{Knuth} 

\input knuth.tex

\SlideTitle{Ward} 

\input ward.tex

\SlideTitle{Lorem} 

\input lorem.tex

\SlideTitle{Thuan} 

\input thuan.tex

\stoptext
% end interactive-visual-counter.tex



> On 16 Jan 2022, at 16:14, Thomas A. Schmitz via ntg-context <ntg-context@ntg.nl> wrote:
> 
> 
> On 16.01.22 15:56, Otared Kavian via ntg-context wrote:
>> Hi Aditya,
>> Some time ago I reported an issue with LMTX regarding your visual counter (at least the version used in the simpleslides module).
>> Now I think I have found where the issue comes from: it is due to the fact that somehow the conditional
>> 	if PageNumber > 2 :
>> 		
>> 		[some code]
>> 	fi ;
> 
> Hi Otared,
> 
> I'm not Aditya, but I've encountered the same problem within simpleslides. Can you replace PageNumber with RealPageNumber and see whether this solves your problem?
> 
> Best
> 
> Thomas
> ___________________________________________________________________________________
> 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] 6+ messages in thread

end of thread, other threads:[~2022-01-16 15:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-15 14:33 SimpleSlides and Visual counters Otared Kavian via ntg-context
2021-11-16 17:34 ` Aditya Mahajan via ntg-context
2021-11-16 22:11   ` Otared Kavian via ntg-context
2022-01-16 14:56     ` Otared Kavian via ntg-context
2022-01-16 15:14       ` Thomas A. Schmitz via ntg-context
2022-01-16 15:38         ` Otared Kavian 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).