Schriftgrößen & Abstände für Überschriften in KOMA-scrip

Layout von Seiten, Rändern, Fusszeilen, usw, modifizieren


Seccerony
Forum-Anfänger
Forum-Anfänger
Beiträge: 33
Registriert: Mo 4. Sep 2017, 22:29

Schriftgrößen & Abstände für Überschriften in KOMA-scrip

Beitrag von Seccerony »

Hey TeXniker,

angehängt ist ein Bild der gewünschten Schriftgrößen und Abstände für nummerierte und nichtnummerierte Überschriften (chapter, sections etc.).
Ich habe Schwierigkeiten bei der Umsetzung in KOMA-script. :-x

Gewünscht:
Chapternumber: 18 pt
Chaptername: 20 pt
Sectionname: 14 pt
Subsectionname: 14 pt kursiv

Abstand von Chapternumber zu Text/Sectionname: 160 pt


Bisheriger Stand:
\documentclass[paper=a4,fontsize=12pt,numbers=noenddot]{scrbook}
\usepackage[margin=2.5cm]{geometry}

\renewcommand\normalsize{\@setfontsize\normalsize{12}{14.4}}
\renewcommand\large{\@setfontsize\large{14}{16.8}}
\renewcommand\LARGE{\@setfontsize\LARGE{18}{21.6}}
\renewcommand\huge{\@setfontsize\huge{20}{24}}

\newcommand{\chapnumsize}{\LARGE}
\newcommand{\chapnumstyle}{\normalfont\mdseries}
\newcommand{\chapsize}{\huge}
\newcommand{\chapstyle}{\mdseries}
\newcommand{\secsize}{\large}
\newcommand{\secstyle}{\mdseries}

\addtokomafont{part}{\mdseries}
\addtokomafont{partnumber}{\mdseries}
\addtokomafont{chapter}{\mdseries}
\addtokomafont{section}{\mdseries}

\setkomafont{disposition}{\normalcolor\bfseries}

\ifnumbered{chapter}{then...}{else...}
\ifunnumbered{chapter}{then...}{else...}

\begin{document}

\section*{Acknowledgements}
This project consumed huge amount of work, research and dedication. Still, implementation would not have been possible if we did not have a support of many individuals and organizations.


\chapter{Chapter Heading}
\section{Section Heading}
This is the same text as before, as this project consumed huge amount of work, research and dedication. Still, implementation would not have been possible if we did not have a support of many individuals and organizations.

This is the same text as before, as this project consumed huge amount of work, research and dedication. Still, implementation would not have been possible if we did not have a support of many individuals and organizations.

\end{document}
Dateianhänge
Vorlage.jpg
Vorlage.jpg (903.36 KiB) 3290 mal betrachtet

nixversteh
Forum-Meister
Forum-Meister
Beiträge: 530
Registriert: Di 10. Aug 2010, 09:47
Wohnort: Wrestedt

...

Beitrag von nixversteh »

Moin Seccerony,

ich habe nichts im Detail überprüft, nur einen Hinweis kann ich dir geben:
\@ and @ in macro names
sind nicht erlaubt.
Deshalb teste mal diesen Code:
\documentclass[paper=a4,fontsize=12pt,numbers=noenddot]{scrbook}
\usepackage[margin=2.5cm]{geometry}

\makeatletter
\renewcommand\normalsize{\@setfontsize\normalsize{12}{14.4}}
\renewcommand\large{\@setfontsize\large{14}{16.8}}
\renewcommand\LARGE{\@setfontsize\LARGE{18}{21.6}}
\renewcommand\huge{\@setfontsize\huge{20}{24}}
\makeatother

\newcommand{\chapnumsize}{\LARGE}
\newcommand{\chapnumstyle}{\normalfont\mdseries}
\newcommand{\chapsize}{\huge}
\newcommand{\chapstyle}{\mdseries}
\newcommand{\secsize}{\large}
\newcommand{\secstyle}{\mdseries}

\addtokomafont{part}{\mdseries}
\addtokomafont{partnumber}{\mdseries}
\addtokomafont{chapter}{\mdseries}
\addtokomafont{section}{\mdseries}

\setkomafont{disposition}{\normalcolor\bfseries}

%%\ifnumbered{chapter}{then...}{else...}
%%\ifunnumbered{chapter}{then...}{else...}

\begin{document}

\section*{Acknowledgements}
This project consumed huge amount of work, research and dedication. Still, implementation would not have been possible if we did not have a support of many individuals and organizations.


\chapter{Chapter Heading}
\section{Section Heading}
This is the same text as before, as this project consumed huge amount of work, research and dedication. Still, implementation would not have been possible if we did not have a support of many individuals and organizations.

This is the same text as before, as this project consumed huge amount of work, research and dedication. Still, implementation would not have been possible if we did not have a support of many individuals and organizations.

\end{document}
Absence of evidence is not evidence of absence

Gast

Beitrag von Gast »

Ist zwar im Ergebnis ziemlich hässlich, aber was das Problem bei der Umsetzung sein soll, verstehe ich nicht ganz:
\documentclass[paper=a4,fontsize=12pt,numbers=noenddot,chapterprefix]{scrbook}
\usepackage[margin=2.5cm]{geometry}

% Keine Ahnung, was die Umdefinierung soll, aber damit sie funktioniert,
% muss man sie korrekt mit \makeatletter…\makeatother klammern.
\makeatletter
\renewcommand\normalsize{\@setfontsize\normalsize{12}{14.4}}
\renewcommand\large{\@setfontsize\large{14}{16.8}}
\renewcommand\LARGE{\@setfontsize\LARGE{18}{21.6}}
\renewcommand\huge{\@setfontsize\huge{20}{24}}
\makeatother

% Das wird nirgendwo verwendet und kann deshalb weg:
%\newcommand{\chapnumsize}{\LARGE}
%\newcommand{\chapnumstyle}{\normalfont\mdseries}
%\newcommand{\chapsize}{\huge}
%\newcommand{\chapstyle}{\mdseries}
%\newcommand{\secsize}{\large}
%\newcommand{\secstyle}{\mdseries}

% Überall \mdseries hinzuzufügen ist Unfug. Laut Abbildung sollen die
% Überschriften fett bleiben. Also wäre \mdseries ohnehin falsch. Ansonsten
% würde man einfach bei disposition das \bfseries weg lassen und gut.
%\addtokomafont{part}{\mdseries}
%\addtokomafont{partnumber}{\mdseries}
%\addtokomafont{chapter}{\mdseries}
%\addtokomafont{section}{\mdseries}

\setkomafont{disposition}{\normalcolor\bfseries}
% Dann setzen wir die Größe der Überschriften:
\setkomafont{chapter}{\huge}% entsprechend der obigen Umdefiniererei 20pt
\setkomafont{chapterprefix}{\LARGE}% entsprechend der obigen Umdefiniererei 18pt
\setkomafont{section}{\large}% entsprechend der obigen Umdefiniererei 14pt
\setkomafont{subsection}{\itshape}% nur kursiv
% Jetzt noch der riesige Abstand nach der Kapitelüberschrift
\RedeclareSectionCommand[afterskip=160pt]{chapter}

% Nachfolgendes ist kompletter Unfug, da die entsprechenden Anweisungen nur
% innerhalb bestimmter anderer Befehle definiert sind. Also streichen wird
% das:
% \ifnumbered{chapter}{then...}{else...}
% \ifunnumbered{chapter}{then...}{else...}

\usepackage{mwe}% siehe Minimalbeispiel-Anleitung

\begin{document}

\chapter*{Acknowledgements}
\lipsum[1]
\chapter{Chapter Heading}
\lipsum[2]
\section{Section Heading}
\lipsum[3]
\subsection{Subsection Heading}
\lipsum[4]

\end{document}
\setkomafont, die verwendeten Elemente und \RedeclareSectionCommand mit Option afterskip sind in der KOMA-Script-Anleitung, [d]scrguide[/d] dokumentiert. Das ist nicht so wahnsinnig schwer anzuwenden …

Antworten