Koma-script style section titles

koma-scriptsectioning

Currently I'm using

\newcommand{\newchapter}[1]{\rule{\linewidth}{0.25pt} \vspace*{-0.30cm} \\ \textbf{\textcolor{red}{\Large #1}} \vspace*{-0.15cm}\\\rule{\linewidth}{0.25pt}\par}

to make section like headers. But it feels wrong doing so while latex has the concept of real sections (and by using restyled sections the content is just much more portable (copy paste it to another document)).

See here a MWE:

\documentclass{scrartcl}

\usepackage{fontspec} % LuaLaTeX
\usepackage{multicol} % use \begin{multicols}{num} text \end{multicols} and the text will be automatically distributed
\usepackage{scrlayer-scrpage}                 % header and footer
\usepackage{xcolor}

% ----- Settings -----
\KOMAoptions{
    paper=a4,           % set papersize
    paper=landscape,    % set paperformat
    fontsize=6.6pt,       % set fontsize
    parskip=half,       % half a line will seperate paragraphs
    headings=normal,    % headings in normalsize
    twoside=false,      % onesided document
    twocolumn=false,    % one columned pages
    numbers=autoendperiod, % automatic punctuation in outline
}

% turn off header and footer
\pagestyle{empty}

\areaset{835pt}{585pt}

% indentation
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt plus 0.5ex}

% big red titles for chapters
\newcommand{\newchapter}[1]{\rule{\linewidth}{0.25pt} \vspace*{-0.30cm} \\ \textbf{\textcolor{red}{\Large #1}} \vspace*{-0.15cm}\\\rule{\linewidth}{0.25pt}\par}

% blue titles for single topics within a chapter
\newcommand{\topic}[1]{\textbf{\textcolor{blue}{#1}}}

% green and bold text for important concepts
\newcommand{\term}[2][]{%
    \if n#1\else\hangindent=1em\hangafter=1\fi%
    \textbf{\textcolor{green!50!black}{#2}}%
}

\renewcommand{\baselinestretch}{1.3}
\setlength{\columnseprule}{.01pt}

\begin{document}
\begin{multicols}{3}
\newchapter{NewChapter}
\topic{Topic}
\term{Term}

\newpage
force pagebreak

\end{multicols}
\end{document}

and the page output:
pdf output

(don't wonder about the maybe weird fontsize/papersize, it is supposed to be this way to fit as much as possible on the page)

So I'd like to use section instead of newchapter, subsection instead of topic and paragraph instead of term.

Is there a way to do this (and if yes how)? Note the missing linebreaks after topic and term (but I'd be ok if these linebreaks couldn't be prevented)

Sorry if this is a pretty obvious question, but I already looked into \RedeclareSectionCommand and \setkomafont (would work for the colors, but I'm not sure about the hangindent (term) and the \rule (newchapter) especially the \rule after the chapter text).

Note: I'm compiling with lualatex, but this shouldn't have a relevant effect.

Note for Bounty:
newChapter and topic are solved (see esdds answer), but I'm still struggling with the hangindent for \term. I know I can do \newcommand{\term}[1]{\paragraph{#1}\hangindent=1em\hangafter=1} but still I'd like to use \paragraph in the document-body so that its easy to change the formatting.

Best Answer

Here is a suggestion for the section and subsection headings:

\documentclass{scrartcl}
\usepackage{fontspec}
\usepackage{multicol}
%\usepackage{scrlayer-scrpage}% <- not used in the example
\usepackage{xcolor}
\usepackage{blindtext}% only for dummy text

% ----- Settings -----
\KOMAoptions{
    %paper=a4,% default
    paper=landscape,
    fontsize=6.6pt,
    %parskip=half,% <- overwritten by \setparsizes
    headings=normal,
    %twoside=false,% default with scrartcl
    %twocolumn=false,% default
    %numbers=autoendperiod,% default
}

\pagestyle{empty}
\areaset{835pt}{585pt}
\setparsizes{0pt}{0pt}{1em plus 1fil}% indentation

\setcounter{secnumdepth}{\partnumdepth}% unnumbered sections etc.

% big red titles for sections
\RedeclareSectionCommand[
  beforeskip=0pt,
  afterskip=0pt,
  afterindent=false,
  runin=false,
  font=\rmfamily\color{red}\Large
]{section}

\newcommand*{\originalsectionlinesformat}{}
\let\originalsectionlinesformat\sectionlinesformat
\renewcommand*{\sectionlinesformat}[4]{%
  \Ifstr{#1}{section}
    {\setlength\parfillskip{0pt}\textcolor{black}{\rule{\linewidth}{0.25pt}}\nopagebreak\par\vskip-.1cm#4\nopagebreak\par\vskip-.3cm  \textcolor{black}{\rule{\linewidth}{0.25pt}}}
    {\originalsectionlinesformat{#1}{#2}{#3}{#4}}%
}

% blue titles for subsections:
\RedeclareSectionCommand[
  runin=true,
  beforeskip=0pt,
  afterskip=1ex,
  font=\rmfamily\color{blue}
]{subsection}

% green and bold text for important concepts:
\newcommand{\term}[2][]{%
    \if n#1\else\hangindent=1em\hangafter=1\fi%
    \textbf{\textcolor{green!50!black}{#2}}%
}

\renewcommand{\baselinestretch}{1.3}
\setlength{\columnseprule}{.01pt}

\begin{document}
\begin{multicols}{3}
\section{NewSection}
\subsection{Topic}
\term{Term}

\newpage
force pagebreak
\end{multicols}
\end{document}

enter image description here

Related Question