一連の円のうち、1つの円の直径が他の円の直径と異なる

一連の円のうち、1つの円の直径が他の円の直径と異なる

各ページのフッターに、肩を並べて並ぶ一連の円を作成したいと考えています。円の数は合計ページ数と同じです。つまり、各円は 1 ページを表します。各円の中央には、現在のページ番号があります。

\foreachこれらすべての円の直径が同じであれば、これを実現するのは簡単ですpgf。ただし、現在のページを表す円の直径を大きくしたいのです。

タイプセットは、次の MWE によって生成された添付の図のようになります。誰かこれを手伝っていただけますか?

MWE:

\documentclass{article}
\usepackage{fancyhdr,geometry,color,tikz}
\geometry{showframe}

\begin{document}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\footrulewidth}{0.4pt}
some text...

\cfoot{
\begin{tikzpicture}
  \draw[fill=gray,text=white,radius=0.5](0,0)circle node{1};
  \draw[fill=red,text=white,radius=1](1.5,0)circle node{2};
  \draw[fill=gray,text=white,radius=0.5](3,0)circle node{3};  
\end{tikzpicture}
}
\end{document}

ここに画像の説明を入力してください

答え1

そんな感じ?

\documentclass{article}
\usepackage{fancyhdr,geometry,lastpage,refcount,lipsum,tikz}
\geometry{showframe}
\usetikzlibrary{positioning}
\begin{document}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\footrulewidth}{0.4pt}
some text...
\newcounter{lastpagenumber}%
\setcounter{lastpagenumber}{\getrefbykeydefault{LastPage}{page}{1}}%

\cfoot{\begin{tikzpicture}
\coordinate (cn-0);
\foreach \X [remember=\X as \LastX (initially 0)] in {1,...,\thelastpagenumber}
{\ifnum\X=\thepage
 \node[circle,fill=red,text=white,minimum size=1cm,right=0pt of cn-\LastX] (cn-\X) {\X};
 \else
 \node[circle,fill=gray,text=white,minimum size=0.5cm,right=0pt of cn-\LastX] (cn-\X) {\X};
 \fi
}
\end{tikzpicture}
}
\lipsum[1-31]
\end{document}

ここに画像の説明を入力してください

もちろん、出力はさまざまな方法でカスタマイズできます。

\documentclass{article}
\usepackage{fancyhdr,geometry,lastpage,refcount,lipsum,tikz}
\geometry{showframe}
\usetikzlibrary{positioning}
\begin{document}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\footrulewidth}{0.4pt}
some text...
\newcounter{lastpagenumber}%
\setcounter{lastpagenumber}{\getrefbykeydefault{LastPage}{page}{1}}%

\cfoot{\begin{tikzpicture}
\coordinate (cn-0);
\foreach \X [remember=\X as \LastX (initially 0)] in {1,...,\thelastpagenumber}
{\ifnum\X=\thepage
 \node[circle,draw,thick,font=\sffamily\Large\bfseries,fill=red,text=white,minimum size=1cm,right=0pt of cn-\LastX] (cn-\X) {\X};
 \else
 \node[circle,draw,font=\sffamily\bfseries,fill=gray,text=white,minimum size=0.5cm,right=0pt of cn-\LastX] (cn-\X) {\X};
 \fi
}
\end{tikzpicture}
}
\lipsum[1-31]
\end{document}

ここに画像の説明を入力してください

円が少し退屈だと思うなら、

\documentclass{article}
\usepackage{fancyhdr,geometry,lastpage,refcount,lipsum,tikzducks,tikzlings}
\geometry{showframe}
\usetikzlibrary{positioning,backgrounds}
\begin{document}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\footrulewidth}{0.4pt}
some text...
\newcounter{lastpagenumber}%
\setcounter{lastpagenumber}{\getrefbykeydefault{LastPage}{page}{1}}%

\cfoot{\begin{tikzpicture}
\coordinate (cn-0);
\foreach \X [remember=\X as \LastX (initially 0)] in {1,...,\thelastpagenumber}
{\ifnum\X=\thepage
 \node[font=\sffamily\Large\bfseries,text=white,minimum size=1cm,right=0pt of cn-\LastX] (cn-\X) {\X};
 \begin{scope}[scale=0.4,on background layer,shift={(cn-\X.center)},yshift=-3em]
 \marmot
 \end{scope}
 \else
 \node[font=\sffamily\bfseries,text=black,minimum size=0.5cm,right=0pt of cn-\LastX] (cn-\X) {\X};
 \begin{scope}[scale=0.3,on background layer,shift={(cn-\X.center)},yshift=-3em]
 \koala
 \end{scope}
 \fi
}
\end{tikzpicture}
}
\lipsum[1-31]
\end{document}

ここに画像の説明を入力してください

関連情報