Fonts & Character Setsset indetion of subparagraph heading

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

set indetion of subparagraph heading

Post by Christoph »

After setting up my chapter and section headings:

1.: https://latex.org/forum/viewtopic.php?f=48&t=34799
2.: https://latex.org/forum/viewtopic.php?f=48&t=34802

I still had a problem with the indention of the subparagraph:

Code: Select all

\documentclass[
%	paper=a4,
fontsize=12pt,%
]{scrreprt}

\usepackage{lipsum}

\addtokomafont{paragraph}{\mdseries\underline}
\addtokomafont{subparagraph}{\mdseries}

\RedeclareSectionCommands[%
	afterindent=false,%
	runin=false,% Überschrift wird frei stehend gesetzt
	afterskip=1.5ex plus .2ex% subsubsection default %vertikaler Abstand nach der Überschrift
%	indent=0pt% is not working probably because it´s already the default value at the paragraph SectionCommand
]{paragraph,subparagraph}

\begin{document}
	
	\lipsum[2]
	\paragraph{Paragraph}
	\lipsum[1]
	\subparagraph{Subparagraph}
	\lipsum[8]
	
\end{document}
Last edited by Christoph on Thu Mar 31, 2022 10:32 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

set indetion of subparagraph heading

Post by Christoph »

Code: Select all

\RedeclareSectionCommands[%
	indent=0pt%	
]{subparagraph}
After some trial error I´ve found out the solution to put the "indent=0pt" in a new command.
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

set indetion of subparagraph heading

Post by Christoph »

This one was also helpful to avoid spaces (Thank´s to Bartman):
https://sourceforge.net/p/koma-script/w ... oidSpaces/

I just added some extra "%"s at the end of some lines to avoid a space looking like what is doing the indent command
https://latex.org/forum/viewtopic.php?f ... 15#p117315
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

set indetion of subparagraph heading

Post by Christoph »

CODE BEFORE ADDING "%"s

Code: Select all

\renewcommand{\sectionlinesformat}[4]{%
	\Ifstr{#1}{section}{%
		\parbox[t]{\linewidth}{%
			\raggedsection\@hangfrom{\hskip #2#3}{#4}\par%
			\vspace*{-1\ht\strutbox}\rule{\linewidth}{0.8pt}%
		}%
	}{
	\Ifstr{#1}{subsection}{%
		\parbox[t]{\linewidth}{%
			\raggedsection\@hangfrom{\hskip #2#3}{#4}\par%
			\vspace*{-1\ht\strutbox}\rule{\linewidth}{.8pt}%
		}%
	}{
	\Ifstr{#1}{subsubsection}{%
	\parbox[t]{\linewidth}{%
		\raggedsection\@hangfrom{\hskip #2#3}{#4}\par%
		\vspace*{-1\ht\strutbox}\rule{\linewidth}{.8pt}%
		}%
	}{
		\@hangfrom{\hskip #2#3}{#4}}% 
}}}
CODE AFTER ADDING "%"s

Code: Select all

\renewcommand{\sectionlinesformat}[4]{%
	\Ifstr{#1}{section}{%
		\parbox[t]{\linewidth}{%
			\raggedsection\@hangfrom{\hskip #2#3}{#4}\par%
			\vspace*{-1\ht\strutbox}\rule{\linewidth}{0.8pt}%
		}%
	}{%
	\Ifstr{#1}{subsection}{%
		\parbox[t]{\linewidth}{%
			\raggedsection\@hangfrom{\hskip #2#3}{#4}\par%
			\vspace*{-1\ht\strutbox}\rule{\linewidth}{.8pt}%
		}%
	}{%
	\Ifstr{#1}{subsubsection}{%
	\parbox[t]{\linewidth}{%
		\raggedsection\@hangfrom{\hskip #2#3}{#4}\par%
		\vspace*{-1\ht\strutbox}\rule{\linewidth}{.8pt}%
		}%
	}{%
		\@hangfrom{\hskip #2#3}{#4}}% 
}}}
User avatar
MjK
Posts: 89
Joined: Fri Jan 28, 2022 6:09 pm

set indetion of subparagraph heading

Post by MjK »

Christoph wrote:

Code: Select all

\RedeclareSectionCommands[%
	indent=0pt%	
]{subparagraph}
After some trial error I´ve found out the solution to put the "indent=0pt" in a new command.
A new command is not needed but a comma between all options. ;)
My main topics are KOMA-Script and other questions related to my packages. If I reply to any other topic or if you've not yet added a minimal working example, please do not expect any further response. And please don't forget to tag examples as code.
Christoph
Posts: 29
Joined: Tue Mar 22, 2022 5:22 pm

set indetion of subparagraph heading

Post by Christoph »

xD
Thanks...
Post Reply