定制 Koma scrartcl maketitle 环境

定制 Koma scrartcl maketitle 环境

下面是一份文档的 MWE scrartcl。我想自定义 的输出\maketitle,特别是将标题元素左对齐而不是居中,并更改字体和大小。如果可能的话,我还想将摘要放在类似的形式中 - 左对齐,并使用“摘要。”作为初始插入标题,并可以选择更改该插入文本的字体和大小。

\PassOptionsToPackage{svgnames,table,dvipsnames,rgb}{xcolor}
\documentclass[a4paper,10pt,oneside,DIV=9]{scrartcl}

% Packages
\usepackage{scrlayer-scrpage}

% demo only
\usepackage{lipsum}
\usepackage{mwe}


\begin{document}
\title{Test document}
\author{Lyndon Drake}
%\institution{University of Oxford}
\date{24 December 2018}
\maketitle

\begin{abstract}
  \lipsum[5]
\end{abstract}

\section{Lipsum}
\lipsum[1]\footnote{\lipsum[2][1-3]}\footnote{\lipsum[3][1-7]

\lipsum[4][1-7]}

\end{document}

答案1

使用以下改变的定义将 maketitle 左对齐:

 \PassOptionsToPackage{svgnames,table,dvipsnames,rgb}{xcolor}
\documentclass[a4paper,10pt,oneside,DIV=9,abstract=true]{scrartcl}

% Packages
\usepackage{scrlayer-scrpage}

% demo only
\usepackage{lipsum}
\usepackage{mwe}


\makeatletter
\renewcommand*{\@maketitle}{%
  \global\@topnum=\z@
  \setparsizes{\z@}{\z@}{\z@\@plus 1fil}\par@updaterelative
  \ifx\@titlehead\@empty \else
    \begin{minipage}[t]{\textwidth}
      \usekomafont{titlehead}{\@titlehead\par}%
    \end{minipage}\par
  \fi
  \null
  \vskip 2em%
%  \begin{center}%
    \ifx\@subject\@empty \else
      {\usekomafont{subject}{\@subject \par}}%
      \vskip 1.5em
    \fi
    {\usekomafont{title}{\huge \@title \par}}%
    \vskip .5em
    {\ifx\@subtitle\@empty\else\usekomafont{subtitle}\@subtitle\par\fi}%
    \vskip 1em
    {%
      \usekomafont{author}{%
        \lineskip .5em%
        \begin{tabular}[t]{@{}l}
          \@author
        \end{tabular}\par
      }%
    }%
    \vskip 1em%
    {\usekomafont{date}{\@date \par}}%
    \vskip \z@ \@plus 1em
    {\usekomafont{publishers}{\@publishers \par}}%
    \ifx\@dedication\@empty \else
      \vskip 2em
      {\usekomafont{dedication}{\@dedication \par}}%
    \fi
%  \end{center}%
  \par
  \vskip 2em
}%

\renewenvironment{abstract}{%
  \if@titlepage
    \titlepage
    \null\vfil
    \@beginparpenalty\@lowpenalty
    \if@abstrt
      \begin{center}
        \normalfont\sectfont\nobreak\abstractname
        \@endparpenalty\@M
      \end{center}
    \fi
  \else
    \if@twocolumn\if@abstrt
        \addsec*{\abstractname}
      \fi
    \else
      \if@abstrt
        \small
        \begin{flushleft}
          {\normalfont\sectfont\nobreak\abstractname
            \vspace{-.5em}\vspace{\z@}}%
        \end{flushleft}
      \fi
%      \quotation
    \fi
  \fi
}{%
  \if@titlepage
    \par\vfil\null\endtitlepage
  \else
    \if@twocolumn\else
%       \endquotation
            \par
    \fi
  \fi
}
\makeatother

\begin{document}
\title{Test document}
\author{Lyndon Drake}
%\institution{University of Oxford}
\date{24 December 2018}
\maketitle

\begin{abstract}
  \lipsum[5]
\end{abstract}

\section{Lipsum}
\lipsum[1]\footnote{\lipsum[2][1-3]}\footnote{\lipsum[3][1-7]

\lipsum[4][1-7]}

\end{document}

相关内容