使用 Tikz 格式化标题页

使用 Tikz 格式化标题页

我在报告格式方面遇到了一些麻烦,即使用 Tikz 在标题页周围放置一个框架。

我想“删除”下图中标出的空白处(红色箭头!),以及日期和框架之间的空白处:

文档的标题页。

代码如下:

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

答案1

仅使用 \vspace 命令的答案(参见添加的(2)条评论)

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

输出:

在此处输入图片描述

答案2

您可以使用geometry它的\newgeometry功能。

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

lipsum包仅用于演示在标题页之后重新建立布局。还应showframe删除该选项。

在此处输入图片描述

相关内容