Scrartcl のタイトルと上余白の間のスペースを減らす

Scrartcl のタイトルと上余白の間のスペースを減らす

以下のKOMA-Script クラスを使用して、サンプル ドキュメントのタイトルと上部の余白の間のスペースを減らすにはどうすればよいですかscrartcl?

\documentclass[a4paper,11pt]{scrartcl}
\usepackage{blindtext}
\title{This is a nice title!}
\subtitle{This is an even nicer subtitle!}
\author{John Doe}
\begin{document}
\maketitle
\section{Introduction}
\blindtext
\blindtext
\end{document}

すでに試してみましたこれ解決策としては、titlingパッケージが使用されている場合、 は\subtitle表示されなくなります。

\vspace{-10px}を使用するなど、手っ取り早い解決策を探しています。

答え1

まあ、手っ取り早くやりたいなら、\vspace{-1cm}タイトルコマンドに以下を追加するだけです:

\title{\vspace{-1cm}This is a nice title!}

1cmニーズに合わせて変更してください。次の MWe ではshowframe、入力領域と余白を視覚化するパッケージを追加しました。

以下のMWEで

\documentclass[a4paper,11pt]{scrartcl}

\usepackage{blindtext}
\usepackage{showframe}

\title{\vspace{-1cm}This is a nice title!}
%\title{This is a nice title!}
\subtitle{This is an even nicer subtitle!}
\author{John Doe}


\begin{document}

\maketitle
\section{Introduction}
\blindtext
\blindtext
\end{document}

結果は次のようになります:

結果のPDF

答え2

免責事項:この答えは、ソースコードscrartcl.clsとしてそれは今、そしてそれを変更すると、このハックは無効になる可能性があります。この答えによってしかしタイトルを編集する必要がないので便利です。

\documentclass{scrartcl}
\usepackage{blindtext} % Just for the demo.
\title{This is a nice title!}
\subtitle{This is an even nicer subtitle!}
\author{John Doe}

\usepackage{xpatch}
\makeatletter
\xpatchcmd{\@maketitle}{\vskip2em}{% Insert here the space you want between the top margin and the title.
    \vspace{-10em} % Example of smaller margin. 
}{}{}
\xpatchcmd{\@maketitle}{\vskip.5em}{% Insert here the space you want between the title and the subtitle
    \vskip5em % Example of bigger margin.
}{}{}
\makeatother

\begin{document}
\maketitle
\section{Introduction}
\blindtext
\blindtext
\end{document}

与える

ここに画像の説明を入力してください

関連情報