<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
sorry I attach Lua version. see below.<br>
From other source, I learned that fancyhdr is a<br>
grouped environment and as soon as Lua code exit<br>
all information get lost. <br>
So I modified the code to start group and complete and<br>
the code is working as I expected. I will post working sample <br>
as it is ready. Thank you. <br>
<p><font size="-1">-------------------- lua version begin
---------------------</font></p>
<p><font size="-1">\documentclass{article}<br>
\usepackage{calc}<br>
\usepackage{color}<br>
\usepackage{enumitem}<br>
\usepackage{fancyhdr}<br>
\usepackage{fancyvrb}<br>
\usepackage{hyperref}<br>
\usepackage{ifthen}<br>
\usepackage{listings}<br>
\usepackage{luacode}<br>
\usepackage{luatexko}<br>
\usepackage{pgf}<br>
\usepackage{tikz}<br>
\usepackage[paper=A3,pagesize]{typearea}<br>
<br>
\begin{document}<br>
<br>
\pagestyle{fancy}<br>
<br>
\begin{luacode*}<br>
tex.print([[ \fancypagestyle{mystyleeight}{ ]])<br>
tex.print([[ \fancyfoot[C]{mystyle-eight \thepage} ]])<br>
tex.print([[ } ]])<br>
tex.print([[ \fancypagestyle{mystylethree}{ ]])<br>
tex.print([[ \fancyfoot[C]{mystyle-three \thepage} ]])<br>
tex.print([[ } ]])<br>
\end{luacode*}<br>
<br>
\pagestyle{mystyleeight}<br>
page should be mystlye-eight<br>
<br>
\newpage<br>
\pagestyle{mystylethree}<br>
page should be mystlye-three<br>
<br>
\newpage<br>
\pagestyle{mystyleeight}<br>
page should be mystlye-eight<br>
<br>
\end{document}</font></p>
<p><font size="-1">-------------------- lua version end
---------------------</font></p>
</body>
</html>