3

I would like to change color of the Headline and Footline in newlfm package. I have changed width of the line using:

\newlfmP{Headlinewd=4pt,Footlinewd=4pt}

and now I would like to change the color of these lines for

\definecolor{myblue}{RGB}{29,57,127}

Is it possible to do it?

2

The head and foot rules are produced using \headrule and \footrule. You can easily patch them to produce colored rules with the help of the etoolbox package.

\documentclass{newlfm}
\usepackage{xcolor}
\usepackage{etoolbox}

\newlfmP{Headlinewd=4pt,Footlinewd=4pt}
\definecolor{myblue}{RGB}{29,57,127}

\pretocmd\headrule{\color{myblue}}{}{}
\pretocmd\footrule{\color{myblue}}{}{}

\begin{document}
\begin{newlfm}
Text
\end{newlfm}
\end{document}
1

newlfm uses fancyhdr to set the headers/footers of the letter. To that end, you can follow the instructions in fancyhdr color and width of line? or redefine \headrule and \footrule directly from fancyhdr.sty:

enter image description here

\documentclass{newlfm}

\usepackage{xcolor}

\definecolor{myblue}{RGB}{29,57,127}
\newlfmP{Headlinewd=4pt,Footlinewd=4pt}

\renewcommand{\headrule}{\color{myblue}\hrule height \headrulewidth width \headwidth
  \vskip-\headrulewidth}
\renewcommand{\footrule}{\vskip-\footruleskip\vskip-\footrulewidth
  \color{myblue}\hrule width \headwidth height \footrulewidth \vskip\footruleskip}

\begin{document}

\begin{newlfm}
Some letter content.
\end{newlfm}

\end{document}

In general, there is no need to use newlfm, as it can easily be substituted for the regular article class.

  • Why the \hbox and \leaders? The fancyhdr documentation shows \renewcommand{\headrule}{{\color{red}\hrule...\vskip-\headrulewidth}}. I don't think I've ever used \leaders directly, so this may not apply, but it looks like you need the \vskip-\headrulewidth. – TH. Jun 5 '17 at 19:39
  • @TH.: Correct. I've updated it based on the content within fancydr.sty. – Werner Jun 5 '17 at 19:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.