我想在章节、小节和小子节的数字后面加一个点

我想在章节、小节和小子节的数字后面加一个点

我的目标如问题标题所述。还有其他问题涉及此问题,但据我所知,所选答案与我现有的其他代码不一致,总结如下。

\documentclass[11pt]{article}
\usepackage{amsmath,amsthm,titlesec}
\numberwithin{equation}{section}
\newcommand{\periodafter}[1]{#1.}
\newcommand{\presectionskip}{-1\baselineskip}
\newcommand{\postsectionskip}{0.3\baselineskip}

\makeatletter
    \renewcommand{\section}{\@startsection
        {section}{1}{0mm}%% name, level, indent
        {\presectionskip}% % beforeskip
        {\postsectionskip}% % afterskip
        {\normalfont\LARGE\bfseries}}% % style
    \renewcommand{\subsection}{\@startsection
        {subsection}{2}{0mm}
        {\presectionskip}
        {\postsectionskip}
        {\normalfont\Large\bfseries}}
    \renewcommand{\subsubsection}{\@startsection
        {subsubsection}{3}{0mm}
        {\presectionskip}
        {\postsectionskip}
        {\normalfont\normalsize\bfseries}}
\makeatother

%\usepackage[font=bf]{caption}
%\titleformat{\section}{}{\thesection.}{1ex}{\periodafter}
%\titleformat{\subsection}{}{\thesubsection.}{1ex}{\periodafter}
%\titlelabel{\thetitle.\quad}

\begin{document}
\section{Good section}\label{sec:refl}
\subsection{Superior subsection}\label{tableworks}
\subsubsection{This, the best of all subsections}
\end{document}

谢谢您就如何实现这个功能提出任何想法。

答案1

提供的解决方案这里效果很好。您是否也担心在参考文献中得到一个点?

% arara: pdflatex

\documentclass[11pt]{article}
\usepackage{titlesec}
\newcommand{\presectionskip}{-1\baselineskip}
\newcommand{\postsectionskip}{0.3\baselineskip}
\makeatletter
\renewcommand{\section}{\@startsection
    {section}{1}{0mm}%% name, level, indent
    {\presectionskip}% % beforeskip
    {\postsectionskip}% % afterskip
    {\normalfont\LARGE\bfseries}}% % style
\renewcommand{\subsection}{\@startsection
    {subsection}{2}{0mm}
    {\presectionskip}
    {\postsectionskip}
    {\normalfont\Large\bfseries}}
\renewcommand{\subsubsection}{\@startsection
    {subsubsection}{3}{0mm}
    {\presectionskip}
    {\postsectionskip}
    {\normalfont\normalsize\bfseries}}
\renewcommand{\@seccntformat}[1]{\csname the#1\endcsname.\quad}
\makeatother
\usepackage{blindtext}

\begin{document}
    \section{Good section}\label{sec:refl}
    \subsection{Superior subsection}\label{tableworks}
    \subsubsection{This, the best of all subsections}
    \blindtext
\end{document}

在此处输入图片描述

相关内容