Text Formattingformating minitoc page numbers

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
jimbo
Posts: 5
Joined: Thu Dec 16, 2010 3:56 pm

formating minitoc page numbers

Post by jimbo »

Hello all,

I have a document using tocloft and minitoc. I have formatted the table of contents using tocloft such that the text remains in \rm font, however the page numbers (to match my footers throughout the document) are in \sfseries font. This is done using...

\usepackage{tocloft}
\renewcommand{\cftpartpagefont}{\small\bfseries\sffamily}
\renewcommand{\cftchappagefont}{\small\bfseries\sffamily}
\renewcommand{\cftsecpagefont}{\small\sffamily}
\renewcommand{\cftsubsecpagefont}{\small\sffamily}
\renewcommand{\cftsubsubsecpagefont}{\small\sffamily}
\renewcommand{\cftparapagefont}{\small\sffamily}
\renewcommand{\cftsubparapagefont}{\small\sffamily}
\renewcommand{\cftfigpagefont}{\small\sffamily}
\renewcommand{\cfttabpagefont}{\small\sffamily}

...which works just fine.

What I would like is the same formatting for the minitocs. I cannot see a way of changing the font of the minitoc page numbers in the same way without changing the text as well.

Does anyone know how to do this?

Thanks in advance

Jimbo

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

achim
Posts: 49
Joined: Wed Aug 05, 2009 2:29 pm

formating minitoc page numbers

Post by achim »

I usually use the fancyhdr package to change the head and foot like of my documents. I don't think you can define the page numbering specifically for specific environments like minitoc. But you could define two commands (\minitocheader, \normalheader) which change the header style to the one you want in the normal text and in the minitoc pages. Either manually change the header layout before calling the minitoc and change it back afterwards or make a new minitoc command which calls it automatically.

Option one:

Code: Select all

\minitocheader
\minitoc % Is this the right syntax? I never worked with it...
\normalheader
Option two:

Code: Select all

\newcommand{\myminitoc}{%
\minitocheader
\minitoc % Is this the right syntax? I never worked with it...
\normalheader
}
OS: Kubuntu
Distribution: TexLive
Editor: Kile
jimbo
Posts: 5
Joined: Thu Dec 16, 2010 3:56 pm

Re: formating minitoc page numbers

Post by jimbo »

Hello,

Thanks for the reply - I think however I was not clear. I would like to format the page number next to the section name within the minitoc environment. ie I have 'section name.................3' and I want to change the formatting of the '3' relative to the 'section name. I would like 'section name' in 'times roman' and '3' in sans serif. i can change both but not each individually.

I can however do this for the toc using tocloft and the commands given in my previous post, however I have not found the equivalent for minitoc.

Thanks,

Jimbo
Post Reply