我该如何设法将有标题的段落和无标题的段落放在一起?

我该如何设法将有标题的段落和无标题的段落放在一起?

我知道,这个问题并没有解释太多。这就是我在这里这样做的原因。

我正在写一篇技术论文,论文分为几个部分。每个部分都有几个段落。有些段落有标题\paragraph,有些没有。问题是:当我在有标题的段落下面放一个无标题的段落时,无标题的段落看起来很奇怪。从图形上看,它似乎包含在另一个段落中,甚至使用了缩进。

我的问题是:当我使用时\paragraph,我应该在章节的每个段落中使用它吗?换句话说:无标题段落可以位于有标题的段落之间吗?对吗?无论如何,段落标题在其他类型的文档中更常见,而并非技术文档中必不可少。所以,请随时向我推荐如何更好地组织文档结构。

PS:做一个\subsection就太多了。我的意思是,每个部分的信息都不足以做到这一点。

答案1

如何做类似的事情

\newcommand*\uparagraph{%
        \par
        \nopagebreak
        \vskip3.25ex plus1ex minus.2ex
        \noindent
 }

这提供了与默认设置相同的间距\paragraph,但没有标题。它也不会缩进新段落,这就是 的原因\nopagebreak。(您不希望非缩进的段落开始新的一页,特别是如果最后一段的上一行已满。

答案2

根据托马斯对这个问题的评论:

\paragraph{Lump}是一种标记文件部门称为,而不是简单地说“这是一个段落,它的标题是这也恰好是文本的一部分。

完整的层次结构(在回忆录中实现)是:

\book
\part
\chapter
\section
\subsection
\subsubsection
\paragraph
\subparagraph

未标记段落的内容通常在逻辑上属于由最后一个分区标记项定义的文档分区,在本例中为\paragraph

因此,在此示例中:

\paragraph{Al-Si junction.} 

It refers to the high-speed (aluminum-silicon) ...

The density of mobile carriers ...

\paragraph{B-Si junction.} 

It refers to the high-speed (boron-silicon) ...

两个段落“它指”和“密度”属于名为“Al-Si”的“段落级章节”,而单个段落“它指”属于名为“B-Si”的“段落级章节”。尽管最终呈现的文本看起来如此,但这里实际上有两个章节标题和三个段落。

最终的结果是“似乎它包含在另一个中”是正确的,因为这就是它的标记方式。为了实现统一的结构,您要么需要为每个段落单独\paragraph划分,要么不划分。

答案3

由于分段单元没有结束标记,因此下一个单元应该以标题开始。将段落问题转移到章节或节中:如果您只让一些文本跟在后面而没有标题,那么它似乎属于前面的章节或节。

这就是为什么我会尝试为每个段落找到一个合适的标题。

另一种方法是格式化段落文本,使其清晰地显示段落的结束位置。例如,缩进段落正文。这可以通过描述环境来完成:

\section{Construction}
\begin{description}
\item[Al-Si junction.] It refers to the high-speed (aluminum-silicon)
    semiconductor-metal barrier diode, commonly known as a Schottky diode.
    This is included in the table because some silicon power IGFETs have a
    parasitic reverse Schottky diode formed between the source and drain as
    part of the fabrication process. This diode can be a nuisance, but
    sometimes it is used in the circuit.
\end{description}
The density of mobile carriers in the channel of a MOSFET is a function
of the electric field forming the channel and of various other phenomena
such as the impurity level in the channel. Some impurities, called dopants,
are introduced deliberately in making a MOSFET, to control the MOSFET
electrical behavior.

输出:

替代文本

答案4

article.cls定义\paragraph如下:

\renewcommand\paragraph{
  \@startsection{paragraph}           % name
  {4}                                 % sectioning level
  {\z@}                               % indent (\z@ is a synonym for 0pt)
  {3.25ex \@plus1ex \@minus.2ex}      % before skip
  {-1em}                              % after skip (the '-' has a special meaning)
  {\normalfont\normalsize\bfseries}}  % format

因此,您可以看到,基于文章类的文档在每个段落之前大约有 3.25ex 的跳过\paragraph,因此整个页面的外观和感觉“不平衡”。

你可以\renewcommand{\paragraph}(可能相当棘手)或者使用辅助包来帮你处理所有事情。最简单的方法是使用包titlesec

\usepackage{titlesec}
\titlespacing{\paragraph}{0pt}{0pt}{0pt}

编辑:

奇怪的是,\titlespacing会吞噬\quad通常附加在段落标题后面的 (或其他内容)。在这种情况下,每次使用时都需要手动添加一些空格\paragraph

\paragraph{Al-Si junction.}\quad It refers to the...

或者,

\paragraph{Al-Si junction.}\ It refers to the...

无论如何,我猜想添加四边形或空格会使此解决方案比titlesec没有此“副作用”时更不理想。在这种情况下,我猜最好\paragraph直接重新定义命令,例如,像这样:

\makeatletter
\renewcommand\paragraph{
  \@startsection{paragraph}           % name
  {4}                                 % sectioning level
  {\z@}                               % indent (\z@ is a synonym for 0pt)
  {0pt}                               % before skip
  {-1em}                              % after skip (the '-' has a special meaning)
  {\normalfont\normalsize\bfseries}}  % format
\makeatother

相关内容