I like to put frame around each page. Only around the text area of the page. Not including the header and footer.
I am also using fancyhdr. After some struggle, I got the following.
But the frame around the text area is too close to the text itself. I am not sure how to add extra space. Should I make textwidth itself smaller? Or make frame wider? And how to do these things. This is what I have now:
I am using Tikz code I found on the net and made small modification to change thickness and color of the frame. Here is MWE
\documentclass[12pt,oneside]{book}
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage{blindtext}
%%%%%%%%%%%%%%%%%%%%%%%%% fancyhdr
\usepackage{textcase}
\usepackage{fancyhdr}
\fancyhead{} % clear all header fields
\fancyfoot{} % clear all footer fields
\renewcommand{\headrulewidth}{0pt}% default is 0pt
\fancyhead[R]{{\footnotesize\scshape\thepage}}
\fancyhead[L]{\leftmark}
\fancyfoot[L]{\nouppercase{\rightmark}}
\renewcommand{\footrulewidth}{0pt}% default is 0pt
\pagestyle{fancy}
\usepackage{tikzpagenodes}
\usepackage[contents={}]{background}
\AddEverypageHook{%
\tikz[remember picture,overlay]{
\draw[line width=.5pt,rounded corners,gray] (current page text area.north east) -- (current page text area.north west)
-- (current page text area.south west) -- (current page text area.south east) -- cycle;
}
}
\setcounter{tocdepth}{1} % 4 for main TOC must be in preamble
\setcounter{secnumdepth}{5}
\begin{document}
\title{My most important work\vspace{-8pt}}
\author{me}
\date{\today}
\maketitle
\tableofcontents
\blinddocument
\end{document}
Need something similar to Vector frame on all pages
But I could not make the above work with fancyhdr , it messed it up. Will keep trying.
The space buffer does not have to be too large. I just do not like the text touching the frame, makes it hard to read.
I basically need something like this:
using TL 2023 with lualatex




