This code generates the following output:
\documentclass{memoir}
\usepackage{lipsum}
\usepackage{titletoc}
\usepackage{tikz}
\titlecontents{psection}[2.3em]
{\large}
{\contentslabel{2.5em}}
{}
{\hspace*{.5em}\tikz[baseline]{\node[draw, inner sep=3pt, rounded corners, fill=red!30, anchor=base]{\thecontentspage};}}
\begin{document}
\tableofcontents
\chapter{Intro}
\startcontents[chapters]
\printcontents[chapters]{p}{1}{}
\lipsum[1-2]
\section{Sec1 I have title}
\lipsum[1-9]
\section{Sec2 Title goes here}
\lipsum[3-8]
\section{Sec3 Conditions goes here}
\lipsum[3-7]
\chapter{Chap2}
\startcontents[chapters]
\printcontents[chapters]{p}{1}{}
\lipsum[3]
\section{Sec1 This is a section}
\lipsum[1-9]
\section{Sec2 Final doc}
\lipsum[3-8]
\section{Sec3 Conditions goes here}
\lipsum[3-7]
\end{document}
Output:
Problem is: I want the page numbers in the in-chapter contents appears in a line vertically equal. I have highlighted my need. The yellow marker shows the page number 3, 5 and 7 should appear in a straight line according to my choice about the distance. I can make it closer or far away.
Any suggestions? Thanks.


\titlecontentsor elsewhere? – mmr Dec 15 '21 at 07:15