I am trying to set a colored rule in the heading. I found some macro code that put me on the \renewcommand{\headrule} trail, but I cannot get it to work. Rule still prints black. Here is what I am using:
\documentclass[10pt]{article}
\usepackage{graphicx} % Figure manipulation
\usepackage{color}
\usepackage[plain, headings]{nccfancyhdr}
\definecolor{heading}{rgb}{0.106,0.147,0.203}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{2pt}
\makeatletter
\renewcommand{\headrule}{
\setlength\@tempdima{\headrulewidth}
\textcolor{heading}{\hrule\@height\@tempdima\@width\headwidth}
\vskip -2\@tempdima}
\makeatother
\begin{document}
Sample Text.
\end{document}
Can anyone help correct this code, or point me in another (better) direction? Thanks!
General ⇒ Heading Rule Color
NEW: TikZ book now 40% off at Amazon.com for a short time.

Heading Rule Color
Hi,
your code produces the expected result; at least on my system. Maybe the color that you are defining is too close to black that you do not appreciate the difference; tryinstead of
the rule now should be "greenish". The documentation of the xcolor package (by the way, I would also suggest you to use xcolor instead of color) contains some useful information about defining colors.
If the problem persists, please let us know.
your code produces the expected result; at least on my system. Maybe the color that you are defining is too close to black that you do not appreciate the difference; try
Code: Select all
\definecolor{heading}{rgb}{0.5,1,0}
Code: Select all
\definecolor{heading}{rgb}{0.106,0.147,0.203}
If the problem persists, please let us know.
1,1,2,3,5,8,13,21,34,55,89,144,233,...