1

to all

Previously asked the question how to add the borders for selected pages,i got the answer but i'm facing problem.I'm using two types of page numbering roman and Arabic.\AddToShipoutPictureBG{\ifnum\value{page}<3 this line will select the pages.The boarders will come both roman and Arabic pages. but i want only in the roman page numbered page only not in the Arabic page numbered pages. so plz help me what changes i have to make...

Thank you

\documentclass[12pt]{book}
\usepackage{tikz}
\usepackage{eso-pic}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathmorphing}
\AddToShipoutPictureBG{\ifnum\value{page}<3
\begin{tikzpicture}[overlay,remember picture]
\draw [line width=3pt]
       ($ (current page.north west) + (1.5cm,-2.0cm) $)
    rectangle
    ($ (current page.south east) + (-1.5cm,1.8cm) $);
\draw [line width=1pt]
    ($ (current page.north west) + (1.65cm,-2.15cm) $)
    rectangle
    ($ (current page.south east) + (-1.65cm,1.95cm) $); 
\end{tikzpicture}%
\fi}
\begin{document}

\pagenumbering{roman}
\begin{titlepage}


\section*{\large{DECLARATION}}

%-----some paragraph-------

\newpage

\begin{center}
\section*{\large{ACKNOWLEDGEMENT}}
\end{center}

%-----some paragraph-------
\end{titlepage}
\newpage

\tableofcontents
\newpage 

\pagenumbering{arabic}

%-----Start chapters-------
\end{document}

2 Answers 2

1

Use \frontmatter and \mainmatter:

\documentclass[12pt]{book}
\usepackage{tikz}
\usepackage{eso-pic}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathmorphing}
\makeatletter
\AddToShipoutPictureBG{\if@mainmatter\else
\begin{tikzpicture}[overlay,remember picture]
\draw [line width=3pt]
       ($ (current page.north west) + (1.5cm,-2.0cm) $)
    rectangle
    ($ (current page.south east) + (-1.5cm,1.8cm) $);
\draw [line width=1pt]
    ($ (current page.north west) + (1.65cm,-2.15cm) $)
    rectangle
    ($ (current page.south east) + (-1.65cm,1.95cm) $); 
\end{tikzpicture}%
\fi}
\makeatother
\begin{document}
\frontmatter
\begin{titlepage}
\section*{\large{DECLARATION}}

%-----some paragraph-------

\newpage

\begin{center}
\section*{\large{ACKNOWLEDGEMENT}}
\end{center}

%-----some paragraph-------
\end{titlepage}

\tableofcontents

\mainmatter
%-----Start chapters-------
\chapter{foo}

\end{document}
7
  • Thank u. but can i control the border ? control means can i put borders only two pages? Commented Mar 7, 2020 at 10:04
  • Sure. Define \newifborder\bordertrue and instead of \if@mainmatter\else use \ifborder. and put a \borderfalse into your document where the borders should end.
    – user187802
    Commented Mar 7, 2020 at 11:52
  • @sathyamurthy, do you see/test my answer? there you can find simple solution for framing only two pages ...
    – Zarko
    Commented Mar 7, 2020 at 13:35
  • your solution also put frames on \backmatter part of a book.
    – Zarko
    Commented Mar 7, 2020 at 13:41
  • @user187802 Thank u so much Commented Mar 8, 2020 at 12:43
1

From your question is not clear, if you like to have frame around all roman numbered pages or just around first two roman numbered package. In later case the simplest way is to define new command for drawing frame and insert this command at this two pages:

\documentclass[12pt]{book}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand\frm{
\begin{tikzpicture}[overlay,remember picture]
\draw [line width=3pt]
    ($ (current page.north west) + (1.5cm,-2.0cm) $)
    rectangle
    ($ (current page.south east) + (-1.5cm,1.8cm) $);
\draw [line width=1pt]
    ($ (current page.north west) + (1.65cm,-2.15cm) $)
    rectangle
    ($ (current page.south east) + (-1.65cm,1.95cm) $);
\end{tikzpicture}%
}
\usepackage{lipsum}

\begin{document}
\frontmatter
\begin{titlepage}
\thispagestyle{empty}
\frm
\section*{\large{DECLARATION}}

\lipsum[1]

\clearpage
\thispagestyle{empty}
\frm

\begin{center}
\section*{\large{ACKNOWLEDGEMENT}}
\end{center}

\lipsum[2]
\end{titlepage}

\clearpage

\tableofcontents

\clearpage
\mainmatter
\chapter{Introduction}

\chapter{State of the art}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .