Estoy usando la clase de memorias para mi tesis. Entre muchas decoraciones (por fancyhdr) se encuentran las barras verticales de colores para páginas pares e impares, como se indica de manera similar en este enlace:margen de regla de color, que quiero mantener durante toda la tesis.
El problema es que no pude aplicar estas barras para la primera página de ninguna parte dentro del frontmatter, incluidos Resumen, TOC, LOT, LOF, a pesar de que parece funcionar para las siguientes páginas. He probado consejos enesta pregunta, pero no tuvo éxito.
Por favor amablemente avíseme. Aquí está mi código mínimo:
\documentclass[twoside,12pt,a5paper]{memoir}
\usepackage{tikz,fancyhdr,lipsum}
\usetikzlibrary{calc}
\pagestyle{fancy}\fancyhf{}
\fancyhead[LO]{%
\begin{tikzpicture}[overlay,remember picture]
\fill [color=blue] (current page.north west) rectangle
($ (current page.south west) + (1cm,0cm) $);
\end{tikzpicture}
}
\fancyhead[RE]{%
\begin{tikzpicture}[overlay,remember picture]
\fill [color=orange] (current page.north east) rectangle
($ (current page.south east) + (-1cm,0cm) $);
\end{tikzpicture}
}
\begin{document}
\tableofcontents* \clearpage
\listoffigures \clearpage
\fancypagestyle{chapter}{}
\chapter{My first Chapter: Problems}
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\chapter{My Second Chapter: Problems}
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\end{document}
Respuesta1
La forma más sencilla es llamar fancy
dentro del plain
estilo y eliminar la regla principal:
\renewcommand{\headrulewidth}{0pt}
\fancypagestyle{plain}{%
\pagestyle{fancy}%
}
Sin embargo , no recomiendo usar memoir
y fancyhdr
.
\documentclass[twoside,12pt,a5paper]{memoir}
\usepackage{tikz,fancyhdr,lipsum}
\usetikzlibrary{calc}
\pagestyle{fancy}\fancyhf{}
\fancyhead[LO]{%
\begin{tikzpicture}[overlay,remember picture]
\fill [color=blue] (current page.north west) rectangle
($ (current page.south west) + (1cm,0cm) $);
\end{tikzpicture}
}
\fancyhead[RE]{%
\begin{tikzpicture}[overlay,remember picture]
\fill [color=orange] (current page.north east) rectangle
($ (current page.south east) + (-1cm,0cm) $);
\end{tikzpicture}
}
\renewcommand{\headrulewidth}{0pt}
\fancypagestyle{plain}{%
\pagestyle{fancy}%
}
\begin{document}
\tableofcontents* \clearpage
\listoffigures \clearpage
\fancypagestyle{chapter}{}
\chapter{My first Chapter: Problems}
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\chapter{My Second Chapter: Problems}
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\section{A}\subsection{B}\lipsum[1]\subsection{CS1}\lipsum[1] \subsection{C}\lipsum[1]
\end{document}