我正在使用 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}
这成功地删除了小节后的换行符,但我不知道如何让悬挂缩进起作用,以及如何修改节/小节之间的后续文本(如果可能的话......很高兴有,因为文档中没有太多无序的项目)。