6

I used a former question on TeX.SE to find the command \part*{}. I like everything about it but the font for it is huge. How can I tone down the size of the font for this command.

\documentclass{article}
\begin{document}

\part*{Min}
new
\section{a}
new2
\section{b}
new3

\end{document}
0

1 Answer 1

7

The definition of \part and \part* in article.cls is:

\def\@part[#1]#2{% <------------------------------- \part[..]{...}
    \ifnum \c@secnumdepth >\m@ne
      \refstepcounter{part}%
      \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}%
    \else
      \addcontentsline{toc}{part}{#1}%
    \fi
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \normalfont
     \ifnum \c@secnumdepth >\m@ne
       \Large\bfseries \partname\nobreakspace\thepart% Part font
       \par\nobreak
     \fi
     \huge \bfseries #2% Title font
     \markboth{}{}\par}%
    \nobreak
    \vskip 3ex
    \@afterheading}
\def\@spart#1{% <------------------------------- \part*{...}
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \normalfont
     \huge \bfseries #1\par}% Title font
     \nobreak
     \vskip 3ex
     \@afterheading}

You can include these in your document and modify the "font" parts (highlighted above; "Part font" and "Title font") to your liking. There's also packages like titlesec and sectsty that can help. Using the latter, is as easy as

\usepackage{sectsty}% http://ctan.org/pkg/secsty
\partfont{\large\bfseries}

to change the "Part font" to \large\bfseries.

Expanding on the former (raw) LaTeX code, to change the font specifically for \part*, use something like

\def\@spart#1{% <------------------------------- \part*{...}
    {\parindent \z@ \raggedright
     \interlinepenalty \@M
     \normalfont
     \large \bfseries #1\par}% Title font
     \nobreak
     \vskip 3ex
     \@afterheading}

where I've changed the \huge font size to \large, keeping it bold.

Remember to wrap the macro redefinition with a \makeatletter...\makeatother pair. See What do \makeatletter and \makeatother do?

1
  • Beautiful. I went with LARGE instead but spot on with sectsty approach. Thank you. +1 Nov 1, 2012 at 0:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .