1

I tried this beautiful solution to create a border in the page, now I want to create many pages without contents. The main idea is to print just the border to take notes. I tried many options inside document but nothing has worked yet. The \lipsum[2-20] worked, but I don't want lipsum code.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[scale=1,angle=0,opacity=1,color=black!60]{background}
\usepackage{tikzpagenodes}
\usepackage{lastpage}
\usepackage{lmodern}
\usepackage{lipsum}

\makeatletter

% A length to control the separation of the text and the frame
\newlength\AUCFrameSep
\setlength\AUCFrameSep{2cm}

% A length to control the height of the minipages used in the header
\newlength\AUCBoxHt
\setlength\AUCBoxHt{1.5cm}

% A length to control the width of the frame
\newlength\AUCFrameWd
\setlength\AUCFrameWd{\textwidth}
\addtolength\AUCFrameWd{2\AUCFrameSep}

% Definition of the user commands to fill the header
% Initially they are empty
\newcommand\Description[1]{\gdef\@ACUdescription{\textsc{#1}}}
\newcommand\LibNum[1]{\gdef\@ACUlibnum{\textsc{#1}}}
\newcommand\Rev[1]{\gdef\@ACUrev{#1}}
\Description{}
\LibNum{}
\Rev{}

% Command to build each one of the boxes for the header
% \AUCBox{<width>}{<title>}{<contents>}
% The optional argument controls the height of the minipages;
% default value= \AUCBoxHt 
\newcommand\AUCBox[4][\AUCBoxHt]{%
\fbox{\begin{minipage}[t][#1][t]{#2}
\begin{flushleft}\footnotesize #3\end{flushleft}
\centering#4
\end{minipage}}}

% We define the background: the header and the frame
\backgroundsetup{%
contents={%
\begin{tikzpicture}[remember picture,overlay]
\draw 
  ([xshift=-\AUCFrameSep,yshift=-2cm]current page text area.north west|-current page.north west)
  rectangle
  ([xshift=\AUCFrameSep,yshift=-1.5\AUCFrameSep]current page text area.south east);
\node[anchor=north west,xshift=-\the\dimexpr\AUCFrameSep+\fboxrule\relax,yshift=-2cm,inner sep=0pt,outer sep=0pt] at (current page text area.north west|-current page.north west)
{%
  \sffamily\small%
  \setlength\fboxsep{2pt}%
  \AUCBox{\dimexpr.6\AUCFrameWd-3\fboxrule-8\fboxsep\relax}{Description}{\@ACUdescription}\kern-\fboxrule%
  \AUCBox{.175\AUCFrameWd}{Lib Num}{\@ACUlibnum}\kern-\fboxrule%
  \AUCBox{0.10\AUCFrameWd}{Rev.}{\@ACUrev}\kern-\fboxrule%
  \AUCBox{0.125\AUCFrameWd}{Page}{\scshape\thepage\ of \pageref{LastPage}}%
};%
\end{tikzpicture}%
  }
}
\makeatother

\Description{\vskip-2ex%
  Description line 1 \\
  Description line 2 \\
  Description line 3 \\
}
\LibNum{Doc 12345}
\Rev{---}

\usepackage{afterpage}

\newcommand\blankpage{%
    \null
    \thispagestyle{empty}%
    \addtocounter{page}{-1}%
    \newpage}

\begin{document}

\lipsum[2-20]

\end{document}

PD: Thanks for the border to: Page header with box sections & page border

  • Welcome! \newpage? – cfr Dec 2 '15 at 4:03
  • Actually, \strut\newpage works better. – John Kormylo Dec 2 '15 at 5:11
  • Noup, with strut the page two is empty and if I create three pages all got empties. With \newpage doesn't show anaything. Thanks. – Chrispaz Dec 2 '15 at 16:11
  • Could you clarify why \begin{document} \strut \newpage \strut \newpage \strut \end{document} doesn't meet your specification? It seems to print the border for each page with a \strut on it. I'm confused why this doesn't do the job. – Dai Bowen Dec 5 '16 at 23:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.