\documentclass{report}
\usepackage[dvipsnames]{xcolor}
\usepackage[margin=1in]{geometry}
\usepackage{afterpage}
\usepackage{tikz}
\usetikzlibrary{fadings}
\usepackage{geometry,tikz}
\usetikzlibrary{calc}
\usepackage[placement=bottom,scale=1,opacity=1]{background}
\backgroundsetup{contents={%
\begin{tikzpicture}
\fill [red] (current page.north west) rectangle ($(current page.north east)!.25!(current page.south east)$) coordinate (a);
\fill [blue] (current page.south west) rectangle (a);
\end{tikzpicture}}}
\usepackage{kantlipsum}
\usepackage{pagecolor,afterpage}
\usepackage{lipsum}
\begin{document}
\DeclareFixedFont{\titlefont}{T1}{put}{b}{}{1.01in}
\DeclareFixedFont{\subtitlefont}{T1}{ppl}{b}{}{0.5in}
\DeclareFixedFont{\subsubtitlefont}{T1}{ppl}{b}{}{0.3in}
\afterpage{\restoregeometry}
\newgeometry{left=1.5cm, right=1cm,top=1cm, bottom=1cm}
\definecolor{mytan}{HTML}{F6D5A8}
\pagecolor{SpringGreen}\afterpage{\nopagecolor}
\thispagestyle{empty}
\begin{center}
\titlefont\textcolor{yellow}{Notes}
\vspace{4cm}\\
\subsubtitlefont{Benjamín Garcés}
\vspace{1cm}\\
\subtitlefont{RING THEORY}
\vspace{1cm}\\
\subsubtitlefont{First Edition}
\end{center}
\newpagecolor{red}
\afterpage{\afterpage{\restorepagecolor}}
\chapter{Introduction to Module Theory}
\end{document}
Estou tentando criar uma primeira página com cores. Achei esse código para poder pintar metade de uma página com uma cor e a outra metade com outra diferente, o problema é que todas as páginas seguintes ficaram assim, e quero que fiquem brancas. Eu tentei \newpagecolor
e \pagecolor{white}
não funcionou para mim.
Responder1
Se você tiver um TeX relativamente recente, everypage
ele está obsoleto e você deve usar os novos ganchos.
Observe que a configuração e os pacotes de fontes envolvem vários conflitos: você precisa resolvê-los ou eles irão mordê-lo.
\documentclass[11pt]{report}
\usepackage[T1]{fontenc}% for pdfTeX or TeX only
% \usepackage{unicode-math}% for luaTeX or xeTeX only
\usepackage[dvipsnames]{xcolor}
\usepackage[spanish,es-noshorthands]{babel}
\usepackage[left=2cm,right=2cm,bottom=2cm,top=1.5cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{kantlipsum}% don't load in your real document
\begin{document}
\pagecolor{SpringGreen}% not sure where you want this as it ends up behind the blocks of blue and red
\AddToHookNext {shipout/background}
{%
\begin{tikzpicture}[remember picture,overlay]
\fill [red] (current page.north west) rectangle ($(current page.north east)!.25!(current page.south east)$) coordinate (a);
\fill [blue] (current page.south west) rectangle (a);
\end{tikzpicture}%
}%
\AddToHookNext {shipout/after}
{%
\nopagecolor%\restoregeometry
}
\DeclareFixedFont{\titlefont}{T1}{put}{b}{n}{1.01in}% pdfTeX or TeX
\DeclareFixedFont{\subtitlefont}{T1}{ppl}{b}{n}{0.5in}% pdfTeX or TeX
\DeclareFixedFont{\subsubtitlefont}{T1}{ppl}{b}{n}{0.3in}% pdfTeX or TeX
\begin{center}
\titlefont\textcolor{yellow}{NOTES}
\vspace{4cm}\\
\subsubtitlefont{Benjamín Garcés}
\vspace{1cm}\\
\subtitlefont{ADVANCED RING THEORY}
\vspace{1cm}\\
\subsubtitlefont{First Edition}
\end{center}
\clearpage
\kant[1-5]% this is the sole purpose of loading kantlipsum
\end{document}