Hi,
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?
Text Formatting ⇒ Page Border and Heading Color
NEW: TikZ book now 40% off at Amazon.com for a short time.

Page Border and Heading Color
I can't run your code since half of it is missing. Please provide a working minimal example.
Thank you
Thank you
OS: Kubuntu
Distribution: TexLive
Editor: Kile
Distribution: TexLive
Editor: Kile
Re: Page Border and Heading Color
\documentclass[11pt, twoside]{article}
%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}
%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
You should put code inside [ code ] boxes, as per the Board Rules.
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:
(Actually, I'm not sure the \lhead ... \rfoot need to have \color{black} in them, since it seems to tackle the \headrule first, but just in case.)
Not a very elegant solution. Maybe someone else will know of a better way to handle this.
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
Code, edit and compile here:
\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
Thanks for replying so quickly! I'll use that for now.
- 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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10