
나는 기하학 패키지와 함께 KOMA-script scrartcl 클래스를 사용하고 있으며 내 섹션(항상 새 페이지에서 시작함)이 헤드라인 사이에 추가 수직 간격을 갖도록 하고 싶지만 하위 섹션의 헤드셉을 변경하고 싶지 않습니다. , 하위 섹션, 단락, 부동 소수점 등
나는 읽었다이 게시물하지만 안타깝게도 댓글을 달 수 있는 담당자가 충분하지 않습니다.
나는 이 명령을 섹션에 적용하고 하위 및 하위 섹션에만 적용하면 작동할 것이라고 믿습니다.
\usepackage{xpatch}
\xpretocmd\sectionlinesformat{\vspace*{0pt}}{}{\PatchFailed}
그리고 여기 내 MWE가 있습니다:
%%% Preamble
\documentclass[12pt,
twoside=false,
letterpaper,
hidelinks,
parskip=half,
onehalfspacing,
bibliography=numbered,
numbers=noenddot]{scrartcl}
\usepackage[headsepline]{scrlayer-scrpage} % enable header line
\usepackage[
top=3cm,
headheight=2.5cm, % 17pt as per the warning by fancyhdr 17pt = about 0.6cm
headsep=1em,
%includehead, % do not includefoot so that you can strictly define the top of the footer
heightrounded, % to avoid spurious underfull messages
footskip=5mm,
bottom=1cm,
bindingoffset=0.0mm,
left=2.2cm,
right=2.2cm,
%showframe=true,
]{geometry}
\usepackage{xpatch}
\xpretocmd\sectionlinesformat{\vspace*{0pt}}{}{\PatchFailed} % adds padding to subsections also :(
\addtokomafont{section}{\clearpage}
\RedeclareSectionCommand[beforeskip=1.0em,afterskip=0.01em]{section}
\RedeclareSectionCommand[beforeskip=1.0em, afterskip=0.01em]{subsection}
\RedeclareSectionCommand[beforeskip=1.0em, afterskip=0.01em]{subsubsection}
\usepackage{blindtext}
%%% Document %%%
\begin{document}
\blindtext
\blinddocument
\blindtext
\blindtext
\blinddocument
\end{document}
답변1
면책 조항 : 클래스 scrreprt
및 \chapter
.
오용하지 마십시오 \addtkomafont
. 인수에는 글꼴 명령만 허용됩니다.
패치를 \sectionlinesformat
다음으로 변경합니다.
\usepackage{xpatch}
\xpretocmd\sectionlinesformat
{\ifstr{#1}{section}{\clearpage\vspace*{0pt}}{}}
{}{\PatchFailed}
예:
\documentclass[12pt,
twoside=false,
letterpaper,
%hidelinks,
parskip=half,
%onehalfspacing,
bibliography=numbered,
numbers=noenddot]{scrartcl}
\usepackage{blindtext}% only for dummy text
\usepackage[headsepline]{scrlayer-scrpage} % enable header line
\usepackage[
top=3cm,
headheight=2.5cm, % 17pt as per the warning by fancyhdr 17pt = about 0.6cm
headsep=1em,
%includehead, % do not includefoot so that you can strictly define the top of the footer
heightrounded, % to avoid spurious underfull messages
footskip=5mm,
bottom=1cm,
%bindingoffset=0.0mm,
left=2.2cm,
right=2.2cm,
%showframe=true,
]{geometry}
\usepackage{xpatch}
\xpretocmd\sectionlinesformat
{\ifstr{#1}{section}{\clearpage\vspace*{0pt}}{}}
{}{\PatchFailed}
\RedeclareSectionCommands
[beforeskip=1.0em,afterskip=0.01em]
{section,subsection,subsubsection}
\begin{document}
\blindtext
\blinddocument
\blindtext
\blindtext
\blinddocument
\end{document}
결과: