Adicionando ponto/ponto após o título da subsubseção

Adicionando ponto/ponto após o título da subsubseção

Igual aAdicionando um ponto final após a seção. Mas estou usando o KOMA, então não posso usar o titlesec.

Indo para o Guia de estilo APA, para sua informação.

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}

Responder1

Se a subsubseção estiver em cabeçalhos, você deverá redefinir \sectioncatchphraseformatpara inserir um ponto após o texto do título da subsubseção.

\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}

insira a descrição da imagem aqui

Se todos os títulos runin receberem um ponto no final, use:

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

Observações adicionais:

Não use indevidamente o elemento fonte sectionpara centralizar os títulos das seções. Em vez disso, redefina \sectionlinesformat. Não há necessidade de carregar o pacote indentfirst.

Responder2

Esta é uma solução parcial para tudo menos \subsubsection(que você redeclara, é por isso que não funciona). A macro \sectionlinesformatanexará automaticamente o ponto.

Você encontrará a documentação (scrguide/scrguien) desta macro na seção 21 (página 508 no guia alemão, página 461 no guia inglês). É uma das macros que o KOMA usa para personalizar o seccionamento (em vez dos mecanismos do titlesec).

koma

\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}

informação relacionada