3

How can I reduce the space between the title and the top margin in my example document with KOMA-Script class scrartcl below?

\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}

I already tried this solution in which the titling package is used, however then the \subtitle is not displayed anymore.

I am looking for a quick and dirty solution, like using \vspace{-10px} or something like that.

2 Answers 2

3

Well, if you want it quick and dirty simply add \vspace{-1cm} into the title command:

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

Change 1cm for your needs. In the following MWe I added package showframe to visualize the typing area and margins.

With the following 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}

you get the result:

resulting pdf

1
  • I've actually tried this solution before, but it didn't work in my real document. I probably forgot to delete an earlier troubleshooting attempt that kept the problem going. Anyway, thanks for your help!
    – John Doe
    Mar 8, 2019 at 23:53
0

Disclaimer: This answer is a bit hacky in the sense that it heavily rely on the source code for scrartcl.cls as it is now, and as any change in it can render this hack void. It was inspired by this answer. But, it does not require to edit the title, which is nice.

\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}

gives

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.