[NTG-context] SimpleSlides and Visual counters

Otared Kavian otared at gmail.com
Sun Jan 16 16:38:32 CET 2022


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 at 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 at 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
> ___________________________________________________________________________________



More information about the ntg-context mailing list