答案1
为了在页面顶部添加空间,你必须说
\vspace*{3cm}
因为分页符处的简单字符\vspace
被删除了。
如果您想要精确定位页边距,可以使用textpos
。例如
\documentclass{book}
\usepackage{textpos}
\newcommand{\fromtop}[1]{%
\dimexpr-1in-\topskip-\topmargin-\headheight-\headsep+#1\relax
}
\newcommand{\fromleft}[1]{%
\dimexpr-1in-\oddsidemargin+#1\relax
}
\begin{document}
\begin{titlepage}
\setlength{\parindent}{0pt}
\begin{textblock*}{0pt}(\fromleft{2cm},\fromtop{3cm})
\makebox[0pt][l]{Text at the top}
\end{textblock*}
\begin{textblock*}{\textwidth}(\fromleft{5cm},\fromtop{6.5cm})
\makebox[0pt][l]{Text in the middle}
\end{textblock*}
\begin{textblock*}{\textwidth}(\fromleft{3cm},\fromtop{9.5cm})
\makebox[0pt][l]{Text at the bottom}
\end{textblock*}
\end{titlepage}
\end{document}
另一个示例,使文本相对于页面边框居中:
\documentclass{book}
\usepackage{textpos}
\newcommand{\fromtop}[1]{%
\dimexpr-1in-\topskip-\topmargin-\headheight-\headsep+#1\relax
}
\newcommand{\fromleft}[1]{%
\dimexpr-1in-\oddsidemargin+#1\relax
}
\begin{document}
\begin{titlepage}
\setlength{\parindent}{0pt}
\begin{textblock*}{\paperwidth}(\fromleft{0cm},\fromtop{3cm})
\centering
Text at the top
\end{textblock*}
\begin{textblock*}{\paperwidth}(\fromleft{0cm},\fromtop{6.5cm})
\centering
Text in the middle\\
with new line
\end{textblock*}
\begin{textblock*}{\paperwidth}(\fromleft{0cm},\fromtop{9.5cm})
\centering
Text at the bottom\\
with new line
\end{textblock*}
\end{titlepage}
\end{document}
答案2
我发现 tikzpagenodes 非常适合布局标题页。请注意,您需要运行两次。
\documentclass{article}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}
\usepackage{mwe}
\begin{document}
\thispagestyle{empty}% I assume you don't want a page number
\begin{tikzpicture}[remember picture,overlay]
\draw[red] (current page text area.south west) rectangle (current page text area.north east);
\node[below,inner sep=0pt,text width=\textwidth] at ($(current page.north)+(0,-3cm)$)
{Notice that 3 cm is actually above the text area.};
\node[below,inner sep=0pt,text width=\textwidth] at ($(current page.north)+(0,-6.5cm)$)
{This should be 6.5 cm below the top of the page.};
\node[below,inner sep=0pt,text width=\textwidth] at ($(current page.north)+(0,-9.5cm)$)
{This should be 9.5 cm below the top of the page.};
\end{tikzpicture}
\newpage
\end{document}
答案3
接受的答案过于复杂,并且可能存在一个错误。尝试将“Plus text text text”改为“Text text text”,然后思考错误消息:)。
你需要的是这样的:
\newenvironment{mytextbox}[1]
{\nointerlineskip \vbox to 0pt\bgroup\vskip#1\relax}
{\vss\egroup}
\nointerlineskip
注:无需配备专用盒子,使用时无需校正垂直位置。
答案4
\documentclass{article}
\newbox\mybox
\newenvironment{mytextbox}[1]
{\vskip-\baselineskip\setbox\mybox=\vbox\bgroup\vskip#1}
{\egroup\ht\mybox=0pt\box\mybox}
\begin{document}
\begin{titlepage}
\begin{center}
\begin{mytextbox}{0.5cm}
\textbf{asdf\\
asdf ÜNİVERSİTESİ\\
FEN BİLİMLERİ ENSTİTÜSÜ}
\end{mytextbox}
\begin{mytextbox}{4cm}
\textbf{asdgd ANABİLİM DALI}
\end{mytextbox}
\begin{mytextbox}{7cm}
\textbf{adfhdsh}
\end{mytextbox}
\begin{mytextbox}{12.5cm}
\textbf{DOKTORA TEZİ}\\
\end{mytextbox}
\begin{mytextbox}{13.5cm}
\textbf{asfsdgd}\\
\textbf{124235}
\end{mytextbox}
\begin{mytextbox}{17cm}
\textbf{Tezin Savunma Tarihi: 00.00.0000}
\end{mytextbox}
\begin{mytextbox}{20.5cm}
\textbf{Tez Danışmanı: asgsdggf}
\end{mytextbox}
\end{center}
\begin{mytextbox}{24cm}
Bu Yüksek Lisans/Doktora Tez Çalışması sagfdfhgdh Üniversitesi………………’nolu Proje ile desteklenmiştir.
\end{mytextbox}
\end{titlepage}
\end{document}
我输入了这个命令,它起作用了。我不明白 wipet 的答案。