I asked a question about visual counters in beamer, for which I got this answer. Now I need to compile it by LuaLaTeX in order to use the package luapersian(below code), but it returns some errors.
Luapersina can be downloaded from this link.


‎\setbeamertemplate{navigation symbols}{}‎

‎\pgfkeys{/visual counter/.cd‎,
 ‎thickness/.store in=\thickness‎,
 ‎radius/.store in=\radius‎,
 ‎segment distance/.store in=\segdist‎,
 ‎segment distance=8‎,
 ‎color current frame/.store in=\colcurrframe‎,
 ‎color current frame=orange‎,
 ‎color old frame/.store in=\cololdframe‎,
 ‎color old frame=blue‎,
 ‎color next frame/.store in=\colnextframe‎,
 ‎color next frame=gray!30‎,
 ‎color page number/.store in=\colpagenum‎,
 ‎color page number=white‎,
 ‎current value/.store in=\currentv‎,
 ‎current value=1‎,
 ‎total value/.store in=\totalv‎,
 ‎total value=2‎,
 ‎circled page number/.code={‎
    ‎\begin{tikzpicture}[fill color/.style={}]‎
     ‎\pgfkeys{/visual counter/.cd‎, 
       ‎current value=\insertframenumber‎,
       ‎total value=\inserttotalframenumber‎,

    ‎\foreach \s in {1,...,\tot}‎
        ‎\tikzset{fill color/.append style={\colnextframe}}%‎
        ‎\tikzset{fill color/.append style={\colcurrframe}}%‎
        ‎\tikzset{fill color/.append style={\cololdframe}}%‎
      ‎\fill[fill color]‎
        ‎({90-360/\tot * (\s‎ - ‎1)-\segdist}:\radiusout) arc‎ 
        ‎({90-360/\tot * (\s‎ - ‎1)-\segdist}:{90-360/\tot * (\s)+\segdist}:\radiusout)‎ --
        ‎({90-360/\tot * (\s)+\segdist}:\radiusin) arc‎ 
        ‎({90-360/\tot * (\s)+\segdist}:{90-360/\tot * (\s‎ - ‎1)-\segdist}:\radiusin);‎
        % ‎new addition‎
        ‎\node[inner sep=0pt,text=\colpagenum] at (0,0){\insertframenumber};‎

% ‎new footline with‎ 
‎\begin{beamercolorbox}[wd=0.95\textwidth‎, ‎ht=2ex,dp=1ex,sep=1ex]{footline}‎
‎\tikz\node[/visual counter/.cd‎,
‎segment distance=-2pt‎,
‎radius=0.5cm‎, ‎thickness=0.5cm‎,
‎color old frame=orange!50‎,
‎color current frame=cyan!80!gray!50‎,
‎color next frame=cyan!80!gray!50‎,
‎circled page number‎,






closed as unclear what you're asking by user36296, Stefan Pinnow, Jesse, Martin Schröder, Au101 Jun 12 '17 at 15:15

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Please give us some code. I don't use Persian and don't want to find out how to do that in LaTeX just in order to help here with some compilation issue. And what are the errors? – LaRiFaRi Apr 15 '14 at 15:21
  • Yes, please, edit your post and include all the relevant TeX codes, otherwise we are wildly guessing what might go wrong. – Malipivo Apr 15 '14 at 16:20
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Martin Schröder Apr 16 '14 at 11:58
  • I edited the post, please see again. – user49875 Apr 16 '14 at 13:25
  • Your example document fails to compile (even without luapersian); something seems to be wrong. Does it compile for you as is (without loading luapersian)? – Gonzalo Medina Apr 16 '14 at 13:36

Caveat emptor I don't have \usepackage{luapersian}, so I only tried to compile with lualatex

Your visible code looks fine, but when copying from your question above there where tons of invisible characters in front of after the visible text. After removing all of them, you example compiles fine with lualatex


\setbeamertemplate{navigation symbols}{}

\pgfkeys{/visual counter/.cd,
thickness/.store in=\thickness,
radius/.store in=\radius,
segment distance/.store in=\segdist,
segment distance=8,
color current frame/.store in=\colcurrframe,
color current frame=orange,
color old frame/.store in=\cololdframe,
color old frame=blue,
color next frame/.store in=\colnextframe,
color next frame=gray!30,
color page number/.store in=\colpagenum,
color page number=white,
current value/.store in=\currentv,
current value=1,
total value/.store in=\totalv,
total value=2,
circled page number/.code={
\begin{tikzpicture}[fill color/.style={}]
\pgfkeys{/visual counter/.cd, 
current value=\insertframenumber,
total value=\inserttotalframenumber,

\foreach \s in {1,...,\tot}
\tikzset{fill color/.append style={\colnextframe}}%
\tikzset{fill color/.append style={\colcurrframe}}%
\tikzset{fill color/.append style={\cololdframe}}%
\fill[fill color]
({90-360/\tot * (\s - 1)-\segdist}:\radiusout) arc 
({90-360/\tot * (\s - 1)-\segdist}:{90-360/\tot * (\s)+\segdist}:\radiusout) --
({90-360/\tot * (\s)+\segdist}:\radiusin) arc 
({90-360/\tot * (\s)+\segdist}:{90-360/\tot * (\s - 1)-\segdist}:\radiusin);
% new addition
\node[inner sep=0pt,text=\colpagenum] at (0,0){\insertframenumber};

% new footline with 
\begin{beamercolorbox}[wd=0.95\textwidth, ht=2ex,dp=1ex,sep=1ex]{footline}
\tikz\node[/visual counter/.cd,
segment distance=-2pt,
radius=0.5cm, thickness=0.5cm,
color old frame=orange!50,
color current frame=cyan!80!gray!50,
color next frame=cyan!80!gray!50,
circled page number,







enter image description here

Not the answer you're looking for? Browse other questions tagged or ask your own question.