Text Formatting ⇒ Page Border and Heading Color
Page Border and Heading Color
I'm new to LaTeX and have run into an issue. I want a colored border around my title page. I achieved this, but now the heading on the next page shows up as the same color as my border, and I can't find a way to keep my page border color while changing my heading back to black. What I have done is:
\pagestyle{fancy}
\headheight 20pt
\headwidth \textwidth
\lhead{Text}
\chead{Text}
\rhead {Text}
For the heading. Then for the titlepage:
\begin{document}
\begin{titlepage}
\color{MyDarkBlue}
\setlength\fboxrule{3pt}
\thisfancypage{\fbox}{}
Text
\end{titlepage}
\newpage
Anyone have any ideas for me as to why this is happening?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
Page Border and Heading Color
Thank you
Distribution: TexLive
Editor: Kile
Re: Page Border and Heading Color
%Header%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[a4paper,margin=1in, inner=1in, outer=1in, hmarginratio=1:1]{geometry}
\usepackage[pdftex]{graphicx}
\usepackage{subfig}
\usepackage[usenames]{color}
\usepackage{wrapfig}
\usepackage{fancyhdr}
\usepackage{times}
\usepackage{multirow}
\usepackage{parskip}
\usepackage[table]{xcolor}
\usepackage{float}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage{color}
\usepackage{array}
\usepackage{fancybox}
\pagestyle{fancy}
\headheight 20pt
\headwidth \textwidth
\lhead{Text}
\chead{Text}
\rhead {Text}
\lfoot{ Text}
\cfoot{Text}
\rfoot{Text}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}
\setlength{\parindent}{0in}
\raggedbottom
%Redefine \cleardoublepage%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\def\cleardoublepage{\clearpage \if@twoside \ifodd\c@page\else
\hbox{}
\vspace{\fill}
\begin{center}
This page intentionally left blank.
\end{center}
\vspace{\fill}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
%Title Page Border Color%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{MyDarkBlue}{rgb}{0,0.08,0.45}
%Title Page%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\begin{titlepage}
\color{MyDarkBlue}
\setlength\fboxrule{3pt}
\thisfancypage{\fbox}{}
Text
\end{titlepage}
\newpage
Text
\newpage
Text
\end{document}
Page Border and Heading Color
Anyway, your problem is strange. I couldn't quite figure out why it was showing this behavior either. Probably a bad interaction between \thisfancypage and the titlepage environment. The only workaround I could see what to force the normal headers to be black by putting this right in their definitions:
Code: Select all
\pagestyle{fancy}
\headheight 20pt
\headwidth \textwidth
\let\oldheadrule=\headrule
\renewcommand{\headrule}{\color{black}\oldheadrule}
\lhead{\color{black}Text}
\chead{\color{black}Text}
\rhead{\color{black}Text}
\lfoot{\color{black}Text}
\cfoot{\color{black}Text}
\rfoot{\color{black}Text}
Not a very elegant solution. Maybe someone else will know of a better way to handle this.
Re: Page Border and Heading Color
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Page Border and Heading Color
If that solves the problem for now, then please mark the topic accordingly as written in the Board Rules (to be read before posting). Please catch up on tagging code as such in your former posts here.loki wrote:Thanks for replying so quickly! I'll use that for now.
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10