0

I can set the font of elements as follows:

\addtokomafont{part}{\normalfont\huge\raggedright}

How can I change the font only for unnamed parts, i.e. part*?

  • 2
    Welcome to TeX.SX! Please don't post code fragments. Instead, put your fragments into a complete compilable document that shows the problem. – BambOo Sep 12 '18 at 11:17
  • 1
    I'd be not surprised, if somebody asked for a different layout of unnumbered sections. But a different font for the part-title? – Keks Dose Sep 12 '18 at 12:34
1

Do not change the alignment of the headings in the foot settings.

With an uptodate KOMA-Script version (3.25 or newer) you could patch \partlineswithprefixformat to get a different font and a different alignment for numbered and unnumbered parts.

Example:

\documentclass{scrartcl}[2018/03/30]% needs version 3.25 or newer
\usepackage{lipsum}% only for dummy text

\renewcommand*\raggedpart{\centering}
\newcommand*\raggedunnumberedpart{\raggedright}
\newkomafont{unnumberedpart}{\normalfont\huge}

\usepackage{xpatch}
\xpretocmd\partlineswithprefixformat{%
  \ifstr{#1}{part}
    {\IfArgIsEmpty{#2}
      {\raggedunnumberedpart
       \addtokomafont{part}{\usekomafont{unnumberedpart}}%
      }{}%
    }{}%
}{}{\PatchFailed}

\begin{document}
\part{Numbered part}
\lipsum[1]
\addpart{Unnumbered part}
\lipsum[2]
\addpart*{Second unnumbered part}
\lipsum[3-4]
\part{Second numbered part}
\lipsum[5]
\end{document}

Result:

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.