新的子节标题后没有任何空格

新的子节标题后没有任何空格

这是我的代码的一部分:

    \setcounter{secnumdepth}{3}
    \setcounter{subsubsection}{411}
    \subsubsection{Root calculation.}
    The easiest way to..

它必须看起来与以下内容相同:

\textbf{412. Root calculation.} The easiest way..

我不能使用 \textbf,我必须使用类似 subsection 命令的东西,但 412 之前的这个符号不能出现,并且文本“最简单的方法...”必须在同一行开始。谢谢

答案1

尝试这个

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{chngcntr}
\setcounter{secnumdepth}{3}
\setcounter{subsubsection}{411}
% we don't want reset subsubsection numbers
\counterwithout{subsubsection}{subsection}

\usepackage{titlesec}
\titleformat{\subsubsection}[runin]{\bfseries\normalsize}{\thesubsubsection.}{0.333em}{}

\begin{document}
\setcounter{subsubsection}{411}

\subsubsection{Root calculation.}
The easiest way to …

\end{document} 

在此处输入图片描述

答案2

没有任何专门用于章节标题格式化的包,需要一些技巧:

\documentclass{article}

\usepackage{chngcntr}

% we don't want reset subsubsection numbers
\counterwithout{subsubsection}{subsection}

\makeatletter
% a negative value in the 5th argument to \@startsection means "run in"
\renewcommand\subsubsection{%
  \@startsection{subsubsection}{3}{\z@}%
    {-3.25ex\@plus -1ex \@minus -.2ex}%
    {-\fontdimen2\font \@plus -\fontdimen3\font \@minus -\fontdimen4\font}%
    {\normalfont\normalsize\bfseries}}

% we don't want a quad of space between number and title in subsubsections
\renewcommand{\@seccntformat}[1]{%
  % the number
  \csname the#1\endcsname
  \ifcsname #1spacing\endcsname
    % something else for chosen levels
    \csname#1spacing\endcsname
  \else
    % quad for the others
    \quad
  \fi
}
\makeatother

\newcommand{\subsubsectionspacing}{. }% period space

\begin{document}
\setcounter{subsubsection}{411}

\section{Whatever}

\subsection{Again}

\subsubsection{Root calculation.}
The easiest way to

\end{document}

在此处输入图片描述

相关内容