【发布时间】:2021-11-23 13:14:18
【问题描述】:
我正在处理需要两种不同边距设置的乳胶文档。
第一部分是一个标题,两边必须有 0.25 英寸。它由一张图片和两列排列的三到五行文本组成。
第二部分是正文,两边各1in。此文本可能长达数页。
页眉只显示在第一页。
在该标题之后,第二部分开始,在同一页面中。第二部分是文档的主体。
我使用几何页面设置页边距(用于页眉),但如果写页眉然后使用 \newgeometry 命令,正文从下一页开始,我需要将它们放在同一个页上。
我不想为标题使用图像,因为它会经常更改,我将创建许多具有该结构的文档。
是否有某种方法可以创建具有主要文本边距的文档并创建“异常边距”只是为了在同一页面上插入页眉?欢迎提出建议:-D
我尝试了以下方法:
\documentclass{article}
% This settings work for the header
\usepackage[margin=0.25in]{geometry}
% Dummy text generator
\usepackage{blindtext}
% Just to simulate logo
\usepackage{tikz}
\begin{document}
% Document Header, first page only
\begin{minipage}[t]{2in}
\vskip0pt
\begin{tikzpicture}
\fill [blue!30] (0,0) rectangle (1.75in, 1.5in);
\end{tikzpicture}
\end{minipage}
\hfill
\begin{minipage}[t]{2.5in}
\vskip0pt
This is the first text block with some info about the company, department another stuff. It is only text.
\end{minipage}
\hfill
\begin{minipage}[t]{3in}
\vskip0pt
This is a second text block with information about content creator, editor, etc. and it just text.
\end{minipage}
\hrulefill
% Starting from here, I need narrow margins, about 1 inch on the left and right. The text must start right after the header
% I have tried with \newgeometry{left=1in,right=1in} but the text starts on the new page.
\section{First section}
\blindtext
\section{Second section}
\blindtext
Text, text and more text... several pages of text...
\end{document}
【问题讨论】:
-
请制作一个可编译的minimal reproducible example 给我们一些开始