我遵循了此处的先前示例,但无法消除子部分后的换行符(我希望它像段落一样运行)
\documentclass[oneside,openany,openbib,11pt]{memoir}
\usepackage{titlesec}
\titleformat{\subsubsection}[runin]{\bfseries}{}{}{}[]
\titleformat{\paragraph}[runin]{\normalsize\itshape}{}{}{}[]
\begin{document}
\subsection{testing}
blah blah blah
\subsubsection{subtesting}\paragraph{further testing}blah blah blah
\end{document}
答案1
您可以定义自己的命令,\paragraph
仅在非立即时调用\subsubsection
。
\documentclass[oneside,openany,openbib,11pt]{memoir}
\usepackage{titlesec}
\titleformat{\subsubsection}[runin]{\bfseries}{}{}{}[]
\titleformat{\paragraph}[runin]{\normalsize\itshape}{}{}{}[]
\makeatletter
\newcommand{\prg}[1]{%
\if@noskipsec\textit{#1}\quad\else\paragraph{#1}\fi
}
\makeatother
\begin{document}
\subsection{testing}
blah blah blah
\subsubsection{subtesting}
blah blah
\prg{further testing}blah blah blah
\subsubsection{subtesting}\prg{further testing}blah blah blah
\end{document}