1

I have the following code to draw the border of the title page. I want to put the margin for the border on the left and right. How can I set left margin of 1.5 inch and right 1 inch.

\documentclass[12pt, a4, openany, oneside]{book}
\renewcommand{\baselinestretch}{1.6}
\usepackage[left=1.5in,top=1.0in,right=1.0in,bottom=1.0in]{geometry}
%\setlrmarginsandblock{2.5cm}{2.5cm}{*} % Left and right margin
%\setulmarginsandblock{3cm}{3cm}{*}  % Upper and lower margin
%\checkandfixthelayout

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{5}{\z@}%
            {-2.5ex\@plus -1ex \@minus -.25ex}%
            {1.25ex \@plus .25ex}%
            {\normalfont\normalsize\bfseries}}

\renewcommand\subparagraph{%
 \@startsection {subparagraph}{5}{\z@ }{2.25ex \@plus 1ex
 \@minus .2ex}{-1em}{\normalfont \normalsize \bfseries }}%


\usepackage{enumitem}
\setlistdepth{9} % deep listing to 6th level (9- 6(by default))
\newlist{myenumerate}{enumerate}{9} % deep listing
\setlist[myenumerate]{label*=\arabic*.}
\setlist[enumerate]{label*=\arabic*.} % for default level


%margin
%\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}


\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[english]{babel}



\begin{document}


%paragraph spacing
%\setlength{\parskip}{\baselineskip}%

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\begin{titlepage}

   \begin{tikzpicture}[remember picture,overlay,inner sep=0.5,outer sep=0]
     \draw[blue!70!black,line width=4pt] ([xshift=-1.5cm,yshift=-2cm]current page.north east) coordinate (A)--([xshift=1.5cm,yshift=-2cm]current page.north west) coordinate(B)--([xshift=1.5cm,yshift=2cm]current page.south west) coordinate (C)--([xshift=-1.5cm,yshift=2cm]current page.south east) coordinate(D)--cycle;

     \draw ([yshift=0.5cm,xshift=-0.5cm]A)-- ([yshift=0.5cm,xshift=0.5cm]B)--
     ([yshift=-0.5cm,xshift=0.5cm]B) --([yshift=-0.5cm,xshift=-0.5cm]B)--([yshift=0.5cm,xshift=-0.5cm]C)--([yshift=0.5cm,xshift=0.5cm]C)--([yshift=-0.5cm,xshift=0.5cm]C)-- ([yshift=-0.5cm,xshift=-0.5cm]D)--([yshift=0.5cm,xshift=-0.5cm]D)--([yshift=0.5cm,xshift=0.5cm]D)--([yshift=-0.5cm,xshift=0.5cm]A)--([yshift=-0.5cm,xshift=-0.5cm]A)--([yshift=0.5cm,xshift=-0.5cm]A);


     \draw ([yshift=-0.3cm,xshift=0.3cm]A)-- ([yshift=-0.3cm,xshift=-0.3cm]B)--
     ([yshift=0.3cm,xshift=-0.3cm]B) --([yshift=0.3cm,xshift=0.3cm]B)--([yshift=-0.3cm,xshift=0.3cm]C)--([yshift=-0.3cm,xshift=-0.3cm]C)--([yshift=0.3cm,xshift=-0.3cm]C)-- ([yshift=0.3cm,xshift=0.3cm]D)--([yshift=-0.3cm,xshift=0.3cm]D)--([yshift=-0.3cm,xshift=-0.3cm]D)--([yshift=0.3cm,xshift=-0.3cm]A)--([yshift=0.3cm,xshift=0.3cm]A)--([yshift=-0.3cm,xshift=0.3cm]A);

   \end{tikzpicture}


\begin{center}





  \vspace{.3cm}
  \textbf{\large{\uppercase{This is the title of the thesis}}}

\end{center}
\end{titlepage}
\end{document} 

enter image description here

3

The good news is that everything is drawn relative to coordinates (A) (B) (C) and (D). The bad news is that these are not the interior edges. Those (note the corners) are 0.5cm further in.

\documentclass[12pt, a4, openany, oneside]{book}
\renewcommand{\baselinestretch}{1.6}
\usepackage[left=1.5in,top=1.0in,right=1.0in,bottom=1.0in]{geometry}
%\setlrmarginsandblock{2.5cm}{2.5cm}{*} % Left and right margin
%\setulmarginsandblock{3cm}{3cm}{*}  % Upper and lower margin
%\checkandfixthelayout

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{5}{\z@}%
            {-2.5ex\@plus -1ex \@minus -.25ex}%
            {1.25ex \@plus .25ex}%
            {\normalfont\normalsize\bfseries}}

\renewcommand\subparagraph{%
 \@startsection {subparagraph}{5}{\z@ }{2.25ex \@plus 1ex
 \@minus .2ex}{-1em}{\normalfont \normalsize \bfseries }}%


\usepackage{enumitem}
\setlistdepth{9} % deep listing to 6th level (9- 6(by default))
\newlist{myenumerate}{enumerate}{9} % deep listing
\setlist[myenumerate]{label*=\arabic*.}
\setlist[enumerate]{label*=\arabic*.} % for default level


%margin
%\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}


\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[english]{babel}



\begin{document}


%paragraph spacing
%\setlength{\parskip}{\baselineskip}%

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\begin{titlepage}

   \begin{tikzpicture}[remember picture,overlay,inner sep=0.5,outer sep=0]
     \path (current page.north east) ++(-1in+0.5cm,-1in+0.5cm) coordinate (A)
           (current page.north west) ++(1.5in-0.5cm,-1in+0.5cm) coordinate (B)
           (current page.south west) ++(1.5in-0.5cm,1in-0.5cm) coordinate (C)
           (current page.south east) ++(-1in+0.5cm,1in-0.5cm) coordinate (D);
     \draw[blue!70!black,line width=4pt] (A)--(B)--(C)--(D)--cycle;

     \draw ([yshift=0.5cm,xshift=-0.5cm]A)-- ([yshift=0.5cm,xshift=0.5cm]B)--
     ([yshift=-0.5cm,xshift=0.5cm]B) --([yshift=-0.5cm,xshift=-0.5cm]B)--([yshift=0.5cm,xshift=-0.5cm]C)--([yshift=0.5cm,xshift=0.5cm]C)--([yshift=-0.5cm,xshift=0.5cm]C)-- ([yshift=-0.5cm,xshift=-0.5cm]D)--([yshift=0.5cm,xshift=-0.5cm]D)--([yshift=0.5cm,xshift=0.5cm]D)--([yshift=-0.5cm,xshift=0.5cm]A)--([yshift=-0.5cm,xshift=-0.5cm]A)--([yshift=0.5cm,xshift=-0.5cm]A);


     \draw ([yshift=-0.3cm,xshift=0.3cm]A)-- ([yshift=-0.3cm,xshift=-0.3cm]B)--
     ([yshift=0.3cm,xshift=-0.3cm]B) --([yshift=0.3cm,xshift=0.3cm]B)--([yshift=-0.3cm,xshift=0.3cm]C)--([yshift=-0.3cm,xshift=-0.3cm]C)--([yshift=0.3cm,xshift=-0.3cm]C)-- ([yshift=0.3cm,xshift=0.3cm]D)--([yshift=-0.3cm,xshift=0.3cm]D)--([yshift=-0.3cm,xshift=-0.3cm]D)--([yshift=0.3cm,xshift=-0.3cm]A)--([yshift=0.3cm,xshift=0.3cm]A)--([yshift=-0.3cm,xshift=0.3cm]A);

   \end{tikzpicture}


\begin{center}





  \vspace{.3cm}
  \textbf{\large{\uppercase{This is the title of the thesis}}}

\end{center}
\end{titlepage}
\end{document}

This solution works for any text area. Just for fun, I got rid of all the [yshift=...,xshift=...] notation and used calc notation instead.

\documentclass[12pt, a4, openany, oneside]{book}
\renewcommand{\baselinestretch}{1.6}
\usepackage[left=1.5in,top=1.0in,right=1.0in,bottom=1.0in]{geometry}
%\setlrmarginsandblock{2.5cm}{2.5cm}{*} % Left and right margin
%\setulmarginsandblock{3cm}{3cm}{*}  % Upper and lower margin
%\checkandfixthelayout

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{5}{\z@}%
            {-2.5ex\@plus -1ex \@minus -.25ex}%
            {1.25ex \@plus .25ex}%
            {\normalfont\normalsize\bfseries}}

\renewcommand\subparagraph{%
 \@startsection {subparagraph}{5}{\z@ }{2.25ex \@plus 1ex
 \@minus .2ex}{-1em}{\normalfont \normalsize \bfseries }}%


\usepackage{enumitem}
\setlistdepth{9} % deep listing to 6th level (9- 6(by default))
\newlist{myenumerate}{enumerate}{9} % deep listing
\setlist[myenumerate]{label*=\arabic*.}
\setlist[enumerate]{label*=\arabic*.} % for default level


%margin
%\usepackage[top=1in, bottom=1in, left=1.25in, right=1.25in]{geometry}


\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\usepackage[english]{babel}

\begin{document}

%paragraph spacing
%\setlength{\parskip}{\baselineskip}%

\setlength{\parindent}{0em}
\setlength{\parskip}{1em}

\begin{titlepage}

  \begin{tikzpicture}[remember picture,overlay]
    \path (current page text area.north east) ++(0.5cm,0.5cm) coordinate (A)
          (current page text area.north west) ++(-0.5cm,0.5cm) coordinate (B)
          (current page text area.south west) ++(-0.5cm,-0.5cm) coordinate (C)
          (current page text area.south east) ++(0.5cm,-0.5cm) coordinate (D);
    \draw[blue!70!black,line width=4pt] (A)--(B)--(C)--(D)--cycle;

    \draw ($(A)+(-0.5cm,0.5cm)$)--($(B)+(0.5cm,0.5cm)$)--($(B)+(0.5cm,-0.5cm)$)--($(B)+(-0.5cm,-0.5cm)$)--
          ($(C)+(-0.5cm,0.5cm)$)--($(C)+(0.5cm,0.5cm)$)--($(C)+(0.5cm,-0.5cm)$)--($(D)+(-0.5cm,-0.5cm)$)--
          ($(D)+(-0.5cm,0.5cm)$)--($(D)+(0.5cm,0.5cm)$)--($(A)+(0.5cm,-0.5cm)$)--($(A)+(-0.5cm,-0.5cm)$)--cycle;

    \draw ($(A)+(0.3cm,-0.3cm)$)--($(B)+(-0.3cm,-0.3cm)$)--($(B)+(-0.3cm,0.3cm)$)--($(B)+(0.3cm,0.3cm)$)--
          ($(C)+(0.3cm,-0.3cm)$)--($(C)+(-0.3cm,-0.3cm)$)--($(C)+(-0.3cm,0.3cm)$)--($(D)+(0.3cm,0.3cm)$)--
          ($(D)+(0.3cm,-0.3cm)$)--($(D)+(-0.3cm,-0.3cm)$)--($(A)+(-0.3cm,0.3cm)$)--($(A)+(0.3cm,0.3cm)$)--cycle;
\end{tikzpicture}


\begin{center}

  \vspace{.3cm}
  \textbf{\large{\uppercase{This is the title of the thesis}}}

\end{center}
\end{titlepage}
\end{document} 
  • You could load tikpagenodes and then you would have access to current page text area.west, say, to draw the frame. – user121799 Oct 1 '18 at 14:31
  • @marmot - Pick, pick, pick ;-) – John Kormylo Oct 1 '18 at 17:21
  • It is "Feep feep feep!" ;-) – user121799 Oct 1 '18 at 17:53
  • @marmot - I'm not familiar with that one. British? – John Kormylo Oct 1 '18 at 17:58
  • Marmot language, it means "Watch out for eagles!" – user121799 Oct 1 '18 at 17:59

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.