我希望能够将一段文本(可以是任何内容,可以有\includegraphics
,也可以是多行)水平放置在页面的中心。但是,我希望能够自定义其垂直位置,例如距顶部 4 英寸。
此块应独立于文档的正常内容。因此它应影响页面上的任何其他内容。
这可能吗?
答案1
这就是你要找的东西吗?
\documentclass{article}
\usepackage[absolute]{textpos}
\setlength{\TPHorizModule}{1in} % sets our horizontal unit of measuring
\setlength{\TPVertModule}{1in} % sets our vertical unit of measuring
\textblockorigin{0mm}{0mm} % and we start measuring in the top left corner
\usepackage[letterpaper]{geometry} % I'm assuming you're using letter paper if you use inches
\usepackage{lipsum} % just for filler text
\begin{document}
\begin{textblock}{8.5}(0,4)\centering
% 8.5 = width of the block
% 0 = zero horizontal units away from our origin
% 4 = four vertical units away from our origin
\fbox{\Huge\textsc{Hello World}}
% the \fbox isn't necessary -- you can put here whatever you want.
\end{textblock}
\lipsum[1-4] % to provoke the clash
\end{document}