仅更改第二页的顶部边距? \vspace 插入额外的空格

仅更改第二页的顶部边距? \vspace 插入额外的空格

我正在尝试将 Pandoc 输出的 LaTex 模板从 .md 格式化为 pdf。该文档适用于需要非常具体布局的长篇大学论文。论文的大部分内容四周都有 1 英寸的边距,标题页和主要标题除外(需要 2 英寸的顶部边距)。

\newgeometry适用于标题页,因为它是一个独立的页面,但与之一起使用时会创建一个新页面,这\begingroup \newgeometry \section{Primary Heading} \endgroup是不可接受的。

我以为我可以使用 \vspace*{} 来解决这个问题,但它似乎会插入额外的空白,从而导致顶部边距过大(见图片)。如何在\section{Primary Heading}非文档首页的页面顶部出现之前创建恰好两英寸的顶部边距?

编辑 1/17 我成功地让章节而不是部分按预期工作。使用 titlesec 和 titlespacing,我能够在章节标题上方添加 1in(应与 1in 边距相结合 = 2 in),但输出大于 1in。我可以使用 \vspace 之类的东西来减去添加的额外空格吗?我如何计算添加了多少额外空格?

默认行为 \vspace*{0in} 添加额外的空格 \vspace*{1in} 增加了太多边距

以下是我的 MWE:

\documentclass[12pt, oneside]{book}

% Package Imports
    \usepackage{titlesec}
    \usepackage{setspace} 
    \usepackage[showframe]{geometry}
    \usepackage{lipsum}

%% Section Formatting (Requires titlesec)
    %%% Primary Heading (H1)
        \titleformat{\chapter}
        {\center\normalfont\MakeUppercase}{}{0pt}{}
        \titlespacing*{\chapter}{0pt}{1in}{0pt}
    %%% First-Level Sub (H2)
        \titleformat{\section}
        {\center\normalfont\MakeUppercase}{}{0pt}{}
        \titlespacing*{\section}{0pt}{2em}{0pt}
    %%% Second-Level Sub (H3)
        \titleformat{\subsection}
        {\center\normalfont\bfseries}{}{0pt}{}
        \titlespacing*{\subsection}{0pt}{2em}{0pt}

% Page Formatting & Layout
    \raggedright %% Left Justify
    \doublespacing %% Line Spacing (Requires setspace)
    \geometry{margin=1in} %% Margins (Requires geometry)
    \setlength{\parindent}{0.5in} %% Fixes Paragraph Indentation
    %\setcounter{secnumdepth}{0} %% No counters for section headings

\begin{document}

% Title Page
    \begin{titlepage} 
    \centering
    \newgeometry{left=1in,right=1in,top=2in,bottom=1in}
    \begin{singlespace}
    \uppercase{
    [Institution]\par
    \vspace{2in}
    [Paper Title]\par
    \vspace{2in}
    Submitted to [Professor]\par
    In partial fulfillment of\par
    [Course]\par
    \vspace{2in}
    by\par
    [Name]\par
    [Date]\par}
    \end{singlespace}
    \restoregeometry
    \end{titlepage}

% Body
    \chapter*{Primary Heading}\label{primary-heading}
    \lipsum[1]
    \section*{First-Level Sub}\label{first-level-sub}
    \lipsum[2]
    \subsection*{Second-Level Sub}\label{second-level-sub}
    \lipsum[3]
    \chapter*{References}\label{references}
    \addcontentsline{toc}{chapter}{References}

\end{document}

相关内容