开发者

how to set header font color in Latex

Is it possible to cha开发者_Python百科nge the header font color in Latex?


You could have a look at the sectsty package.

The secsty package provides a set of commands for changing the fount 1 used for the various sectional headings in the standard LATEX 2ε document classes

From the manual:

Make sure you include the package in your document by saying in your document preamble:

\usepackage{sectsty}
You will then have some new commands available. For example:
\allsectionsfont{\sffamily}
will give you sanserif for all sectional headings.
 

  • Here is the full manual


If you want to change the section heading's font color all at once, then you need to re-define the startsection command.

The following link has a detailed description of customizing sectiong headings' font color, Title and Section Headings

I have copy pasted the relevant code that needs to be inserted into the preamble,

\renewcommand\section{%
\@startsection{section}{1}{\z@}%
              {-3.5ex \@plus -1ex \@minus -.2ex}%
              {2.3ex \@plus.2ex}%
              {\color{RoyalBlue}\sffamily\Large\bfseries}}
\renewcommand\subsection{%
\@startsection{subsection}{2}{\z@}%
              {-3.25ex\@plus -1ex \@minus -.2ex}%
              {1.5ex \@plus .2ex}%
              {\color{RoyalBlue}\sffamily\large\bfseries}}

Also, you must remember to import the color package

\usepackage{color}

Here is the link for more information on colors, Color Info

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜