2

I'm beginner in latex. I'm trying crate a my internship report so i want to crate a page boarder for first two pages. i created the first page but at the second page is not getting boarders, it getting header and footers what i given. so please help me to put the boarder at second page also....

here what i have tried,

\documentclass[12pt]{book}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}

\pagenumbering{roman}
\begin{titlepage}

\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}

\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}

(in code I'm not mention the header and footers)

I searched lots but i got only how to add one page boarders so help me to put border for two pages also

2 Answers 2

2

Welcome! Here is one possible way using eso-pic.

\documentclass[12pt]{book}
\usepackage{tikz}
\usepackage{eso-pic}
\usetikzlibrary{calc}
\usetikzlibrary{decorations.pathmorphing}
\AddToShipoutPictureBG{\ifnum\value{page}<3% <- change this if you want more
% or less pages to have a frame
\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}

\begin{titlepage}


\section*{DECLARATION}

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

\newpage
\thispagestyle{empty}
\begin{center}
\large\bfseries ACKNOWLEDGEMENT
\end{center}

%-----some paragraph-------
\end{titlepage}
\newpage
\chapter{Some chapter}
%-----Start chapters-------
\end{document}

enter image description here

7
  • thank u so much for your answer.I have small problem i tried your code, it works for me but the board is applying 1St chapter also and the second page acknowledgement's page board is coming along with header and footers .what changes i have to make? Commented Mar 7, 2020 at 5:45
  • @sathyamurthy Better now?
    – user194703
    Commented Mar 7, 2020 at 5:50
  • Actually better but i don't want borders in chapters can u change that ? it is possible? Commented Mar 7, 2020 at 5:52
  • @sathyamurthy I am sorry, I cannot understand what you are saying. What does " i don't want borders in chapters" mean?
    – user194703
    Commented Mar 7, 2020 at 5:53
  • Actually in the book template chapters (only chapter page)did not have headers and footers in the next page (same chapter only) header and footers will come.but it is overlapping the header and footers with the boarders in the next page (chapter's second page) Commented Mar 7, 2020 at 5:58
0

Here is what worked for me - it maybe useful for others. In a book type of document - I wanted first page to have border. Note the use of \AddToShipoutPictureBG* instead of \AddToShipoutPictureBG{}.

\begin{document}

\frontmatter
\begin{titlepage}
    \makeatletter
    \AddToShipoutPictureBG*{
        \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}
    }
    \makeatother
    
    \input{./coverpage/coverpage-thesis}
\end{titlepage}
1
  • This is covered in large part by the current (accepted) answer. I'd suggest turning your reference to \AddToShipoutPictureBG* rather than \AddToShipoutPictureBG into a comment.
    – Werner
    Commented Jan 29, 2022 at 4:00

You must log in to answer this question.

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