![如何格式化具有悬挂缩进的后续段落,以便标题编号下方没有文本?](https://linux22.com/image/432517/%E5%A6%82%E4%BD%95%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%85%B7%E6%9C%89%E6%82%AC%E6%8C%82%E7%BC%A9%E8%BF%9B%E7%9A%84%E5%90%8E%E7%BB%AD%E6%AE%B5%E8%90%BD%EF%BC%8C%E4%BB%A5%E4%BE%BF%E6%A0%87%E9%A2%98%E7%BC%96%E5%8F%B7%E4%B8%8B%E6%96%B9%E6%B2%A1%E6%9C%89%E6%96%87%E6%9C%AC%EF%BC%9F.png)
我正在使用 Latex 编写需要特定格式的文档,如下所示:
我正在使用documentclass
:article
,和pagestyle
:(fancy
来自 fancyhd 包},并且通过对 section、subsection 使用以下内容使其几乎完美地工作。段落部分从未起作用,所以我最终使用了一个有序列表,但存在没有子段落悬挂缩进的问题。
\newcommand{\subSubSectionStart}{\begin{enumerate}[label(\arabic*),leftmargin=2.5\parindent]}
\newcommand{\subSubSection}[1]{\item #1}
\newcommand{\subSubSectionEnd}{\end{enumerate}}
\documentclass[10pt,letterpaper]{article}
\renewcommand{\thesubsection}{\Alph{subsection}}
\titleformat{\subsection}{\normalfont}{\thesubsection.}{.5em}{}[]
\renewcommand{\theparagraph}{\arabic{paragraph}}
\titleformat{\paragraph}{\normalfont}{\theparagraph}{.5em}{}[]
\titlespacing*{\paragraph}{\parindent}{1em}{1ex}
\pagestyle{fancy}
\begin{document}
然而,在以这种方式编写了大部分文档并且一切看起来都很好之后,我意识到我犯了一个根本性的错误,即误用了章节标题。我的内联代码如下所示:
\section{SECTION TITLE}
\subsection{\myBoldUnderLineMacro{SUBSECTION TITLE:} blah blah blah blah .... an entire paragraph, often quite long went here, often with many macros to generate dynamic content.}
% BELOW PARAGRAPH SECTION NEVER WORKED QUITE RIGHT
\paragraph{\myBoldUnderLineMacro{SUBSUBSECTION TITLE:} blah blah blah blah .... an entire paragraph, often quite long went here, often with many macros to generate dynamic content.}
% BELOW WORKED, EXCEPT NO HANGING INDENT, AND NOT GREAT WHEN THERE
% IS A LONG BIT OF TEXT IN IT, WOULD PREFER AN INLINE SOLUTION
% IF POSSIBLE
\subSubSectionStart
\subSubSection{Text goes here, text goes here, text goes here...}
\subSubSection{Text goes here, text goes here, text goes here...}
\subSubSectionEnd
这看起来很棒,直到我开始获得更长的子章节和包含许多子章节的章节,此时 LaTeX 试图将标题名称保持在一起的尝试似乎已开始导致页面超限。
现在我知道我需要将标题的用法更改为:
\section{SECTION TITLE}
\subsection{\SUBSECTION TITLE:}
blah blah blah blah .... an entire paragraph, often quite long went here, often with many macros to generate dynamic content.
% BELOW NEVER WORKED CORRECTLY, BUT WOULD PREFER
% TO FIX PARAGRAPH THAN USE MY HOME-MADE COMMAND IF POSSIBLE.
\paragraph{SUBSUBSECTION TITLE:} % OR SUBSUBSECTION IF AVAILABLE
blah blah blah blah .... an entire paragraph, often quite long went here, often with many macros to generate dynamic content.
我正在努力弄清楚如何将格式恢复到我想要的样子。通过再次检查并分离节/子节名称,我修复了页面超限问题(花了很长时间才弄清楚!),但现在我需要弄清楚如何将格式恢复到上面指示的样子。
我尝试修复它的出发点是:
\documentclass[10pt,letterpaper]{article}
\renewcommand{\thesubsection}{\Alph{subsection}}
\titleformat{\subsection}[runin]{\normalfont}{\thesubsection.}{.5em}{}[]
\renewcommand{\theparagraph}{\arabic{paragraph}}
\titleformat{\paragraph}{\normalfont}{\theparagraph}{.5em}{}[]
\titlespacing*{\paragraph}{\parindent}{1em}{1ex}
\pagestyle{fancy}
\begin{document}
这成功地删除了小节后的换行符,但我不知道如何让悬挂缩进起作用,以及如何修改节/小节之间的后续文本(如果可能的话......很高兴有,因为文档中没有太多无序的项目)。