Reducir el espacio entre el título y el margen superior en scrartcl

Reducir el espacio entre el título y el margen superior en scrartcl

¿Cómo puedo reducir el espacio entre el título y el margen superior en mi documento de ejemplo con la clase KOMA-Script scrartcla continuación?

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

ya lo intentéestesolución en la que eltitlingSe utiliza el paquete, sin embargo, \subtitleya no se muestra.

Estoy buscando una solución rápida y sucia, como usar \vspace{-10px}o algo así.

Respuesta1

Bueno, si lo quieres rápido y sencillo, simplemente agrega \vspace{-1cm}al comando del título:

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

Cambie 1cmsegún sus necesidades. En el siguiente MWe agregué un paquete showframepara visualizar el área de escritura y los márgenes.

Con el siguiente 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}

obtienes el resultado:

pdf resultante

Respuesta2

Descargo de responsabilidad:Esta respuesta es un poco complicada en el sentido de que depende en gran medida de lacódigo fuente parascrartcl.clscomoEsto es ahora, y cualquier cambio en él puede anular este truco. fue inspiradopor esta respuesta. Pero, no es necesario editar el título, lo cual es bueno.

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

da

ingrese la descripción de la imagen aquí

información relacionada