4

I'm having some trouble with getting the format right on my report, which is using Tikz to put a frame around the title page.

I'd like to "remove" the blank space denoted in the following image (the red arrow!), and the one between the date and the frame, as well:

The document's title page.

Here's the code:

\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[portuguese]{babel}
\usepackage[utf8]{inputenc}
\newcommand\HRule{\rule{\textwidth}{1pt}}
\begin{document}
\begin{titlepage}

\begin{tikzpicture}[remember picture, overlay]
  \draw[line width = 2pt] ($(current page.north west) + (1in,-1in)$) rectangle ($(current page.south east) + (-1in,1in)$);
\end{tikzpicture}

\begin{center}

\textsc{Agrupamento de Escolas Domingos Sequeira}\\[0.2cm]
\textbf{\LARGE Escola Secundária Domingos Sequeira}\\[4.5cm]

% Title
\textbf{\huge Relatório}\\[1.4cm]

\begin{flushright}
\textbf{  Biologia e Geologia 11º ano\\
  Prof. Paulo Renato Parreira}
\end{flushright}\\[4cm]

\textbf{\large José Henriques, nº11376\\
  Rodrigo António Catarino Ferreira, º24\\
Turma D, 11º ano}

\vfill

% Bottom of the page
{\bf \large \today}

\end{center}

\end{titlepage}
Rodrigo
  • 153
  • Welcome to TeX.SX! Did you try with \centering instead of \begin{center} (remove \end{center}, too). – egreg Feb 24 '18 at 00:15

2 Answers2

5

You can use geometry and its \newgeometry feature.

\documentclass[a4paper]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[portuguese]{babel}

\usepackage[pass,showframe]{geometry} % for \newgeometry

\usepackage{tikz}
\usetikzlibrary{calc}

\usepackage{lipsum}

\begin{document}
\begin{titlepage}
\newgeometry{margin=2cm}
\centering
\textsc{Agrupamento de Escolas Domingos Sequeira}\\[0.2cm]
\textbf{\LARGE Escola Secundária Domingos Sequeira}\\[4.5cm]

% Title
{\huge\textbf{Relatório}\\}

\begin{flushright}\bfseries
Biologia e Geologia 11º ano\\
Prof. Paulo Renato Parreira
\end{flushright}

\vspace{4cm}

{\large\bfseries
José Henriques, nº11376\\
Rodrigo António Catarino Ferreira, º24\\
Turma D, 11º ano\\}

\vfill
\begin{tikzpicture}[remember picture, overlay]
  \draw[line width = 2pt]
    ($(current page.north west) + (2cm,-2cm)$)
    rectangle
    ($(current page.south east) + (-2cm,2cm)$);
\end{tikzpicture}
\vfill

% Bottom of the page
{\large\bfseries\today\\[1ex]}

\end{titlepage}

\restoregeometry

\lipsum

\end{document}

The lipsum package is used just to demonstrate that the layout is reestablished after the title page. Also the option showframe should be removed.

enter image description here

egreg
  • 1,121,712
3

An answer using just \vspace command (See the (2) comments added)

\documentclass{report}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage[portuguese]{babel}
\usepackage[utf8]{inputenc}
\newcommand\HRule{\rule{\textwidth}{1pt}}
\begin{document}
\begin{titlepage}

\begin{tikzpicture}[remember picture, overlay]
  \draw[line width = 2pt] ($(current page.north west) + (1in,-1in)$) rectangle ($(current page.south east) + (-1in,1in)$);
\end{tikzpicture}

\begin{center}
\vspace{-65pt}% Added this command
\textsc{Agrupamento de Escolas Domingos Sequeira}\\[0.2cm]
\textbf{\LARGE Escola Secundária Domingos Sequeira}\\[4.5cm]

% Title
\textbf{\huge Relatório}\\[1.4cm]

\begin{flushright}
\textbf{  Biologia e Geologia 11º ano\\
  Prof. Paulo Renato Parreira}
\end{flushright}%Removed a \\[4cm] from here due to error in compiling and replaced with next line's command
\vspace{4cm}

\textbf{\large José Henriques, nº11376\\
  Rodrigo António Catarino Ferreira, º24\\
Turma D, 11º ano}

\vfill

% Bottom of the page
{\bf \large \today}

\end{center}

\end{titlepage}

\end{document}

Output:

enter image description here

koleygr
  • 20,105
  • And, how would one do it to the date? I tried adding \vspace before it, didn't seem to work. – Rodrigo Feb 24 '18 at 02:24
  • @Rodrigo, you can replace \vfill command with a custom \vspace... \vfill is an "automatic" vspace untill the bottom of the page (or until the suggested maximum height of current box etc) – koleygr Feb 24 '18 at 13:56