- Questo topic ha 12 risposte, 4 partecipanti ed è stato aggiornato l'ultima volta 5 anni, 3 mesi fa da .
-
Topic
-
Salve,
sto realizzando il mio primo documento in latex e sto trovando dei problemi con l’impaginazione dell’indice: come si può vedere dalla foto la seconda pagina inizia senza lasciare spazi e non compare il numero della pagina che dovrebbe essere ii. Come posso risolvere questo problema?
Vi ringrazio in anticipo
Ecco l’indice:[attachment=2629]Indice.jpg[/attachment]
Ecco il codice che sto utilizzando, preso da overleaf:
`\definecolor{myred}{RGB}{40,40,40}
\definecolor{myyellow}{RGB}{116,116,116}
\newcommand\Circle[1]{\tikz[overlay,remember picture]
\node[draw=myyellow,circle, text width=18pt,line width=1pt,align=center] {#1};}
\renewcommand\printtoctitle[1]{\HUGE\rmfamily\bfseries\color{myred}#1}
\makeatletter
\renewcommand\cftpartfont{\Huge\rmfamily\bfseries}
\renewcommand\partnumberline[1]{%
\hbox to \textwidth{\hss\Circle{\textcolor{myyellow}{#1}}\hss}%
\vskip3.5ex\color{myred}}
\renewcommand*{\l@part}[2]{%
\ifnum \c@tocdepth >-2\relax
\cftpartbreak
\begingroup
{\interlinepenalty\@M
\leavevmode
\settowidth{\@tempdima}{\cftpartfont\cftpartname}%
\addtolength{\@tempdima}{\cftpartnumwidth}%
\let\@cftbsnum \cftpartpresnum
\let\@cftasnum \cftpartaftersnum
\let\@cftasnumb \cftpartaftersnumb
\advance\memRTLleftskip\@tempdima \null\nobreak\hskip -\memRTLleftskip
\centering{\cftpartfont#1}\par%
}
\nobreak
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi}\renewcommand\chapternumberline[1]{\mbox{\Large\@chapapp~#1}\par\noindent}
\renewcommand\cftchapterfont{\Large\rmfamily}
\cftsetindents{chapter}{0pt}{0pt}
\renewcommand\cftchapterpagefont{\HUGE\rmfamily\bfseries\color{myred}}\newcommand*{\l@mychap}[3]{%
\def\@chapapp{#3}\vskip1ex%
\par\noindent\begin{minipage}{\textwidth}%
\parbox{4.7em}{%
\hfill{\cftchapterpagefont#2}%
}\hspace*{1.5em}%
\parbox{\dimexpr\textwidth-4.7em-15pt\relax}{%
\cftchapterfont#1%
}%
\end{minipage}\par\vspace{2ex}%
}\renewcommand*{\l@chapter}[2]{%
\l@mychap{#1}{#2}{\chaptername}%
}\renewcommand*{\l@appendix}[2]{%
\l@mychap{#1}{#2}{\appendixname}%
}\renewcommand\cftsectionfont{\rmfamily}
\renewcommand\cftsectionpagefont{\rmfamily\itshape\color{myred}}
\renewcommand{\cftsectionleader}{\nobreak}
\renewcommand{\cftsectionafterpnum}{\cftparfillskip}
\cftsetindents{section}{7.5em}{3em}
\renewcommand\cftsectionformatpnum[1]{%
\hskip1em\hbox to 4em{{\cftsectionpagefont #1\hfill}}}\renewcommand\cftsubsectionfont{\rmfamily}
\renewcommand\cftsubsectionpagefont{\rmfamily\itshape\color{myred}}
\renewcommand\cftsubsectionleader{\nobreak}
\renewcommand{\cftsubsectionafterpnum}{\cftparfillskip}
\renewcommand\cftsubsectiondotsep{\cftnodots}
\cftsetindents{subsection}{10.5em}{3em}
\renewcommand\cftsubsectionformatpnum[1]{%
\hskip1em\hbox to 4em{{\cftsubsectionpagefont #1\hfill}}}
\makeatother\renewcommand\cftsubsubsectionfont{\rmfamily}
\renewcommand\cftsubsubsectionpagefont{\rmfamily\itshape\color{myred}}
\renewcommand\cftsubsubsectionleader{\nobreak}
\renewcommand{\cftsubsubsectionafterpnum}{\cftparfillskip}
\renewcommand\cftsubsubsectiondotsep{\cftnodots}
\cftsetindents{subsubsection}{11.5em}{4em}
\renewcommand\cftsubsubsectionformatpnum[1]{%
\hskip1em\hbox to 4em{{\cftsubsubsectionpagefont #1\hfill}}}
\makeatother\settocdepth{subsubsection}
\setsecnumdepth{subsubsection}\newlength\Myhead
\setlength\Myhead{\dimexpr\headheight+\headsep+1in+\voffset+5ex\relax}\newlength\Myfoot
\setlength\Myfoot{\dimexpr\paperheight-\Myhead-\textheight-\footskip+5ex\relax}\newcounter{chapmark}
\newcommand\StartMark{%
\addtocontents{toc}{\protect\label{st\thechapmark}%
\protect\begin{tikzpicture}[overlay,remember picture,baseline]
\protect\node [anchor=base] (s\thechapmark) {};%
\ifnum\getpagerefnumber{st\thechapmark}=\getpagerefnumber{en\thechapmark} \else
\protect\draw[myyellow,line width=3pt] let \protect\p3= (s\thechapmark),%
\protect\p4 = (current page.south) in %
($ (4em,\protect\y3) + (0,-1ex) $) — ($ (4em,\protect\y4) + (0,\protect\the\Myfoot)$);\fi
\protect\end{tikzpicture}\par}%
}\newcommand\EndMark{
\addtocontents{toc}{\protect\label{en\thechapmark}%
\protect\begin{tikzpicture}[overlay,remember picture,baseline]
\protect\node [anchor=base] (e\thechapmark) {};
\ifnum\getpagerefnumber{st\thechapmark}=\getpagerefnumber{en\thechapmark}
\protect\draw[myyellow,line width=3pt] let \protect\p1= (s\thechapmark), \protect\p2=(e\thechapmark) in ($ (4em,\protect\y1) + (0,-1ex) $) — ($ (4em,\protect\y2) + (0,2ex) $);
\else%
\protect\draw[myyellow,line width=3pt] let \protect\p1= (e\thechapmark), \protect\p2=(current page.north) in ($(4em,\protect\y2) + (0,-\protect\the\Myhead)$) — ($ (4em,\protect\y1) + (0,1.5ex) $);
\fi
\protect\end{tikzpicture}\par}\stepcounter{chapmark}%}`
- Devi essere connesso per rispondere a questo topic.