![仅缩进段落](https://linux22.com/image/302280/%E4%BB%85%E7%BC%A9%E8%BF%9B%E6%AE%B5%E8%90%BD%20.png)
我是 Tex Maker 新手,我想写1. Linear
(然后文本将从 Linear 中的 L 开始向右缩进)。然后2. Partial
缩进将与之前相同(没有右缩进)。有没有简单的方法可以做到这一点?我尝试使用其他问题的答案,但它们很复杂并且没有用。
答案1
我理解您的问题是一个分段问题,因为您尝试用标题标记文档的某个部分。通常您会说:
\documentclass{article}
%\usepackage{lipsum} %to add a blindtext
\begin{document}
\paragraph{Linear}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\paragraph{Partial}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{document}
目前这不符合您的设计标准。在\usepackage{lipsum}
和之间添加以下几行\begin{document}
来修复它:
\makeatletter
\renewcommand\theparagraph{\@arabic\c@paragraph.}
\setcounter{secnumdepth}{5}
\let\ltx@paragraph\paragraph
\renewcommand{\paragraph}[2][]{%
\if\relax\detokenize{#1}\relax
\ltx@paragraph{#2\\}
\else
\ltx@paragraph[#1]{#2\\}
\fi}
\makeatother
更新
\documentclass{article}
\makeatletter
\renewcommand\theparagraph{\@arabic\c@paragraph}
\setcounter{secnumdepth}{5}
\edef\ltx@parindent{\the\parindent}
\renewcommand\paragraph{%
\begingroup
\def\@seccntformat##1{\csname the##1\endcsname.\hspace{1.3ex}}
\leftskip\ltx@parindent
\rightskip\leftskip
\@startsection{paragraph}{4}{-\ltx@parindent}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{0.3ex \@plus.2ex}%
{\normalfont\normalsize\bfseries}}%
\def\endparagraph{\par\endgroup}
\makeatother
\begin{document}
\begin{paragraph}{Linear}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{paragraph}
\begin{paragraph}{Partial}
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
\end{paragraph}
\end{document}
答案2
您想制作一个编号列表吗?如果是这样,我不确定您想要什么模式,但也许是以下两种之一:
\documentclass{article}
\usepackage{enumitem,kantlipsum}
\begin{document}
\begin{enumerate}[label=\arabic*.]
\item Linear
\kant[1]
\item Partial
\kant[2]
\end{enumerate}
\begin{enumerate}[label=\arabic*., labelindent=\parindent, itemindent=-\parindent]
\item Linear
\kant[1]
\item Partial
\kant[2]
\end{enumerate}
\end{document}