我正在用类写一些东西article
,并试图减少文章标题和内容之间的空间,如下所示。我知道我可以在命令\vspace{-2\baselineskip}
后插入或类似的东西\maketitle
,但是\maketitle
有没有办法通过重新定义命令并在前言中插入这样的重新定义来处理间距?
平均能量损失
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{space}{xeCJK}
%
\documentclass[
a4paper]{article}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\setmonofont[Scale = MatchLowercase]{zcoN}
\setmathfont[]{Libertinus Math}
\ifXeTeX
\usepackage{xeCJK}
\setCJKmainfont[Scale = 1,BoldFont = SourceHanSansJP-Bold.otf]{SourceHanSerifJP-Light.otf}
\fi
\ifLuaTeX
\usepackage[]{luatexja-fontspec}
\setmainjfont[Scale = 1,BoldFont = SourceHanSansJP-Bold.otf]{SourceHanSerifJP-Light.otf}
\fi
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
pdfauthor={Hoge Fuga1,},
hidelinks,
pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage[left = 20truemm,right = 20truemm,top = 20truemm,headsep = 5truemm,bottom = 30truemm,footskip = 15truemm]{geometry}
\usepackage{longtable,booktabs,array}
\usepackage{calc} % for calculating minipage widths
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{5}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{array}
\usepackage{multirow}
\usepackage{wrapfig}
\usepackage{float}
\usepackage{colortbl}
\usepackage{pdflscape}
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{threeparttablex}
\usepackage[normalem]{ulem}
\usepackage{makecell}
\usepackage{xcolor}
\ifLuaTeX
\usepackage{selnolig} % disable illegal ligatures
\fi
\usepackage[style=apa6,sortcites = true,sorting = nyt,backend = biber,maxcitenames = 2,style = authoryear-comp,language = auto]{biblatex}
\addbibresource{doc-creation/bibs/English.bib}
\title{Research Plan of the Doctoral Dissertation}
\author{Hoge Fuga\textsuperscript{1,*}}
\date{}
\begin{document}
\maketitle
\textsuperscript{1} The University of FooBar
\textsuperscript{*} Correspondence: \href{mailto:}{Hoge Fuga \textless{}\texttt{[email protected]} (ID)\textgreater{}}
\section{Lorem ipsum}
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{document}
答案1
在article
文档类中,该\maketitle
命令最终调用\@maketitle
宏,该宏定义如下article.cls
\def\@maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\LARGE \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1em%
{\large \@date}%
\end{center}%
\par
\vskip 1.5em}
我假设你最困扰的是这两个\vskip 1.5em
指令。如果是这样,你可以通过\@maketitle
从头开始重新定义(通过合适的\renewcommand
指令)或通过加载etoolbox
包并修补现存的命令如下:
\usepackage{etoolbox}
\makeatletter
\patchcmd{\@maketitle}{\vskip 1.5em}{\vskip 1em}{}{} % modify 1st instance of '\vskip 1.5em'
\patchcmd{\@maketitle}{\vskip 1.5em}{}{}{} % get rid of 2nd instance of '\vskip 1.5em'
\makeatother