
我想垂直對齊標題頁中的文件標題和名稱。我目前的 LaTeX 看起來像這樣:
\documentclass[a4paper]{article}
\title{ ... }}
\author{ ... }
\date{{ ... }}
\begin{document}
\begin{titlepage}
\maketitle
\end{titlepage}
\end{document}
但這顯示了文件上半部的內容。我想將其垂直居中。這個帖子要求使用\vplace
.但我無法弄清楚如何\vplace
在標題頁中使用。
我試過
\begin{vplace}[1]
\begin{titlepage}
\maketitle
\end{titlepage}
\end{vplace}
並且
\begin{vplace}[1]
\title{ ... }}
\author{ ... }
\date{{ ... }}
\end{vplace}
但它給了類似的錯誤Environment vplace undefined
。看來需要memoir
上課了。但背面無法辨識memoir
文件類別。我如何在文檔類別中實現相同的目標?
答案1
該titling
軟體包包含用於自訂maketitle
命令的工具。這是一個例子:
\documentclass[a4paper]{article}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.3pt}
\usepackage{titling}
\setlength{\droptitle}{-9.5ex}
\renewcommand{\maketitlehooka}{\vfill\bfseries}
\renewcommand{\maketitlehookb}{\normalfont}
\renewcommand{\maketitlehookd}{\vfill\clearpage}
\title{The Quangle-Wangle’s Hat}
\author{Edward Lear}
\date{(1876)}
\begin{document}
\begin{titlingpage}
\maketitle
\end{titlingpage}
\end{document}
答案2
就我個人而言,我會TiKz
因為可以更好地控制對齊(我的觀點)並且計算程式碼對我來說更容易理解 - 對於該TiKz
選項,請參閱編輯
\documentclass[]{article}
\title{Project Title}
\date{2016-31-01}
\author{Author Name}
%\usepackage[showframe]{geometry}
\usepackage{titling}
\renewcommand\maketitlehooka{\null\mbox{}\vfill}
\renewcommand\maketitlehookd{\vfill\null}
\begin{document}
\begin{titlingpage}
\maketitle
\end{titlingpage}
\end{document}
編輯 ---帶有 tikz 的標題頁
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\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)$);
\draw[line width = 1pt, blue] ($(current page.center) + (-1in,0in)$) --
($(current page.center) + (1in,0in)$)node[pos=0.5,above](){%
\textbf{\LARGE Escola Secundária Domingos Sequeira}\\[4.5cm]
};
\end{tikzpicture}
\vfill
% Bottom of the page
\centering{\bf \large \today}
\end{titlepage}
\end{document}