梅威瑟:
\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\geometry{includeheadfoot,verbose,tmargin=1cm,bmargin=0.7cm,lmargin=2cm,rmargin=2cm}
\usepackage{fancyhdr}
\usepackage{lipsum}
\fancypagestyle{firstpage}{
\renewcommand\footrule{}
\renewcommand\headrule{
\begin{minipage}{1\textwidth}
\hrule width \hsize \kern 1mm
\centering{address address address address\\
Phone: +7 (000) 000-00-00}
\end{minipage}
}
\lhead{\centering \large{Limited liablity company}\\\huge{``Our superb company''}}
\rhead{}
\lfoot{}
\rfoot{}
}
\pagestyle{plain}
\pagenumbering{gobble}
\AtBeginDocument{\vspace*{2\baselineskip}}
\begin{document}
\thispagestyle{firstpage}
\begin{center}
\huge{\textbf{Letter of attourney}}
\end{center}
\bigskip
Moscow, Russia\hfill 08 of October 2018
\bigskip
\bigskip
\lipsum[1-9]
\end{document}
我需要创建一个仅在第一页上带有特殊页眉的文档。不幸的是,页眉的空白空间保留在第二页上。
如何制作以下内容:
删除第二页的空白处。
在第二页上,将顶部边距设为 1.5cm,而不是几何图中所示的 1cm。同时为第一页保留 1cm 的边距。
答案1
以下是一些建议:
- 由于只有 1 页与其他页面不同(第一页),因此请使用以下方式设置该页面的页眉,
\smash
以删除由以下方式自动引入的任何调整:fancyhdr
。
\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\geometry{
includeheadfoot,
tmargin = 1cm,
bmargin = 0.7cm,
hmargin = 2cm,
headheight = 19pt
}
\usepackage{fancyhdr,array}
\usepackage{lipsum}
\fancypagestyle{firstpage}{
\fancyhf{}% Clear header/footer
\fancyhead[C]{%
\smash{\begin{tabular}[t]{ >{\centering\arraybackslash}p{\dimexpr\linewidth-2\tabcolsep} }
\large Limited liability company \\
\huge ``Our superb company'' \\[0.5\normalbaselineskip]
\hline \\[-0.5\normalbaselineskip]
address address address address \\
Phone: +7 (000) 000-00-00
\end{tabular}}
}
\renewcommand\footrulewidth{0pt}% Remove footer rule
\renewcommand\headrulewidth{0pt}% Remove header rule
}
\pagestyle{plain}% Default page style
\AtBeginDocument{\vspace*{\baselineskip}}% For first page only
\begin{document}
\thispagestyle{firstpage}
\begin{center}
\huge\bfseries Letter of attourney
\end{center}
\bigskip
Moscow, Russia \hfill 08 of October 2018
\bigskip \bigskip
\lipsum[1-10]
\end{document}
- 根本不要将标题设置为标题;而是在需要时将其移动到位。
\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\geometry{
tmargin = 1.5cm,
bmargin = 1.5cm,
hmargin = 2cm
}
\pagenumbering{gobble}
\usepackage{array}
\usepackage{lipsum}
\AtBeginDocument{\vspace*{-1.5\baselineskip}}% For first page only
\begin{document}
\noindent
\begin{tabular}{ >{\centering\arraybackslash}p{\dimexpr\linewidth-2\tabcolsep} }
\large Limited liability company \\
\huge ``Our superb company'' \\[0.2\normalbaselineskip]
\hline \\[-0.5\normalbaselineskip]
address address address address \\
Phone: +7 (000) 000-00-00
\end{tabular}
\begin{center}
\huge\bfseries Letter of attourney
\end{center}
\bigskip
Moscow, Russia \hfill 08 of October 2018
\bigskip \bigskip
\lipsum[1-10]
\end{document}