How can I change the \section{} style? Especially I want to change the color of section heading.
I happen to find some neat style following Edward R. Tufte (http://code.google.com/p/tufte-latex/), and I'm trying to find a way to modify the section color.
color package works fine, but the thing is that the color chapter number is not changed.
\section{\color{Red}ELPA}
The simplest command to change the color of elements in the LaTeX document is \color{color}. This command switches the color for the current group in which the command is inserted. This shows the basic use of colors in \LaTeX. \item {\color{red} And red!}
The color command is declared as {\color{mentioned-color}some text}. The textcolor command is used for all in one paragraph, while the color command is used for the text to run over other tex environments and the multiple lines. To change the background color, you can use the command \pagecolor{mentioned-color}.
Use package titlesec
.
Put this in the LaTeX header (before \begin{document}
)
\usepackage{titlesec}
\usepackage{color}
\titleformat{\section}
{\color{red}\normalfont\Large\bfseries}
{\color{red}\thesection}{1em}{}
\usepackage{sectsty} %\allsectionsfont{\color{blue}\itshape\underline} \sectionfont{\color{blue}\itshape\selectfont} \subsectionfont{\color{green}\itshape\selectfont}
I could change color using sectsty style.
Have you tried using the color
package?
\usepackage[usenames, dvipsnames]{color}
\section{\color{Red} Section Header}
You can also define your own colors:
\usepackage[usenames, dvipsnames]{color}
\definecolor{MetallicGold}{RGB}{212, 175, 55}
\section{\color{MetallicGold} Section Header}
You can define a command to make it simplier to type:
\usepackage[usenames, dvipsnames]{color}
\definecolor{MetallicGold}{RGB}{212, 175, 55}
\newcommand{\coloredsection}[2]{\section{\color{#1} #2} }
\coloredsection{MetallicGold}{Section Header}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With