하위 섹션 제목 뒤에 마침표/점 추가

하위 섹션 제목 뒤에 마침표/점 추가

비슷하다섹션 뒤에 마침표 추가. 그런데 KOMA를 사용하고 있어서 사용할 수 없습니다 titlesec.

APA 스타일 가이드를 참고하세요.

MWE:

\documentclass[a4paper, oneside, 12pt, parskip=half]{scrartcl}

\usepackage{lipsum}

% --- APA Style --- %

% For spacing
\usepackage{setspace}
\doublespacing

\setlength{\parindent}{0.5in}
\usepackage{indentfirst} % Indent even the 1st paragraph after each section header.

\addtokomafont{section}{\centering}
\RedeclareSectionCommand[afterskip=-1em, indent=0.5in]{subsubsection}

% --- End of APA Style --- %

\usepackage{lipsum}

\begin{document}

\tableofcontents

\clearpage

\section{This should be centered}

\lipsum[1]

\subsection{This is same as default for KOMA}

\lipsum[2]

\subsubsection[Runin, and need a dot after this title]{Runin, and need a dot after this title.}

Without resorting to using a separate `short title` without period at the end, and a `title` with the ending period, I hope to do just:

\subsubsection{Have dot at end}

\lipsum[3]

\end{document}

답변1

\sectioncatchphraseformat하위 섹션이 헤더를 실행하는 경우 하위 섹션 제목 텍스트 뒤에 점을 삽입하도록 재정의해야 합니다 .

\documentclass[a4paper, oneside, 12pt, parskip=half]{scrartcl}
% --- APA Style --- %
\usepackage{setspace}
\doublespacing
\setlength{\parindent}{0.5in}

\RedeclareSectionCommand[beforeskip=3.5ex plus 1ex minus .2ex]{section}
\RedeclareSectionCommand[beforeskip=3.25ex plus 1ex minus .2ex]{subsection}
\RedeclareSectionCommand[afterskip=-1em, indent=\the\parindent]{subsubsection}

\makeatletter
\renewcommand{\sectionlinesformat}[4]{%
  \ifstr{#1}{section}{\centering}{}% center section titles
  \@hangfrom{\hskip #2#3}{#4}%
}
\makeatother
\renewcommand{\sectioncatchphraseformat}[4]{%
  \hskip #2#3#4%
  \ifstr{#1}{subsubsection}{.}{}% dot after subsection titles
}
% --- End of APA Style --- %

\usepackage{lipsum}% only for dummy text

\begin{document}
\tableofcontents
\clearpage
\section{This should be centered}
\lipsum[1]
\subsection{This is same as default for KOMA}
\lipsum[2]
\subsubsection{Runin, and need a dot after this title}
Without resorting to using a separate `short title` without period at the end, and a `title` with the ending period, I hope to do just:
\subsubsection{Have dot at end}
\lipsum[3]
\end{document}

\documentclass{scrbook}

\renewcommand{\thechapter}{\Roman{chapter}}

\usepackage[usedvipsnames]{xcolor}
\usepackage{romanbar}
\RedeclareSectionCommand[
  tocentrynumberformat=\def\autodot{}\textcolor{red}
]{chapter}

\usepackage{xpatch}
\xpatchcmd{\addchaptertocentry}
  {\addtocentrydefault{chapter}{#1}{#2}}
  {\ifstr{#1}{}{\addtocentrydefault{chapter}{#1}{#2}}
    {\addtocentrydefault{chapter}{\protect\Romanbar{#1}}{#2}}%
  }{}{\PatchFailed}

\usepackage{lipsum}

\begin{document}
\tableofcontents

\chapter{First Chapter}
\lipsum[2]
\chapter{Second Chapter}
\lipsum[2]
\chapter{Third Chapter}
\lipsum[2]
\end{document}

여기에 이미지 설명을 입력하세요

모든 runin 제목 끝에 점이 표시되어야 하는 경우 다음을 사용하세요.

\renewcommand{\sectioncatchphraseformat}[4]{\hskip #2#3#4.}

추가 참고사항:

section섹션 제목을 중앙에 배치하기 위해 글꼴 요소를 오용하지 마십시오 . 대신 재정의하세요 \sectionlinesformat. 패키지를 로드할 필요가 없습니다 indentfirst.

답변2

\subsubsection이것은 (재선언한 것, 이것이 작동하지 않는 이유) 이외의 모든 것에 대한 부분적인 솔루션입니다 . 매크로는 \sectionlinesformat자동으로 점을 추가합니다.

섹션 21(독일어 가이드의 경우 508페이지, 영어 가이드의 경우 461페이지)에서 이 매크로에 대한 문서(scrguide/scrguien)를 찾을 수 있습니다. 이는 KOMA가 섹션화를 사용자 정의하기 위해 사용하는 매크로 중 하나입니다(titlesec의 메커니즘 대신).

코마

\documentclass[a4paper, oneside, 12pt, parskip=half]{scrartcl}

\usepackage{lipsum}

% --- APA Style --- %

% For spacing
\usepackage{setspace}
\doublespacing

\setlength{\parindent}{0.5in}
\usepackage{indentfirst} % Indent even the 1st paragraph after each section header.

\addtokomafont{section}{\centering}
\RedeclareSectionCommand[afterskip=-1em, indent=0.5in]{subsubsection}

\makeatletter
\renewcommand\sectionlinesformat[4]{%
  \@hangfrom{\hskip#2 #3}{#4.}
}
\makeatother

\begin{document}
\tableofcontents

\clearpage

\section{This should be centered}

\lipsum[1]

\subsection{This is same as default for KOMA}

\lipsum[2]

\subsubsection[Runin, and need a dot after this title]{Runin, and need a dot after this title.}

Without resorting to using a separate `short title` without period at the end, and a `title` with the ending period, I hope to do just:

\subsubsection{Have dot at end}

\lipsum[3]

\end{document}

관련 정보