% rtitle.tex
% \def\stylerunning#1{{\crimmedium #1}}


\definemarking[P]
\definemarking[I]

\startluacode
userdata = userdata or {}
function userdata.print(start, step, limit, cond)
	
	local nstart = tonumber(start)
	local var = nstart
	local ncond = tonumber(cond)
	local dd = 0
	while (step > 0 and var <= limit) or (step <= 0 and var >= limit) 
	do
		local v = var
		if ncond == v 
		then 
		
			local i = nil
			if nstart == 2 then
				context(" \\vbox to 16pt{ \\hbox{")
				commands.getmarking("I", interfaces.variables.page, interfaces.variables.last)
				context(" ← ")
				commands.getmarking("P", interfaces.variables.page, interfaces.variables.current)
				context(" }}")
			end
			
			
			if nstart == 3 then
				context(" \\vbox to 16pt{ \\hbox{")
				commands.getmarking("P", interfaces.variables.page, interfaces.variables.current)
				context(" → ")
				commands.getmarking("I", interfaces.variables.page, interfaces.variables.first)
				context(" }}")
			end
			
			dd = 1
			break
		end 
		var = var + step
	end


end
\stopluacode

\def\blabla#1{%
	\ctxlua{userdata.print("#1", 4, 400, tex.count.pageno);}
}



\setupfootertexts[\blabla{3}][][][\blabla{2}]

\setupfooter[style={\consolmicro}]

