常规行为是新文本块在第一行缩进。这很好。
但我希望某些文本块(不是整个文档的默认设置)具有完全相反的行为。这意味着第一行不应缩进,但下面的所有行都应缩进。
就像这里显示的一样:
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea
commodo consequat.
这可能吗?我正在使用,\documentclass{scrbook}
看它是否重要。
更新:请注意我的第一行包含\paragraph
标题。
例如:
\documentclass{scrbook}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\paragraph{my paragraph} \lipsum[2]
\lipsum[3]
\end{document}
答案1
可以使用以下原语更改段落形状\parshape
:
\documentclass{scrbook}
\usepackage[nopar]{lipsum}
\begin{document}
\lipsum[1]
\paragraph{Some paragraph heading}
\parshape % Change the shape of the following paragraph
2 % Identify the shape by specying 2 lines
0pt \linewidth % First line has a left indent of 0pt and a width of \linewidth
\parindent \dimexpr\linewidth-\parindent % Second (and subsequent lines) have an indent of \parindent
% and a width of \linewidth-\parindent
\lipsum[2] % Set paragraph with new paragraph shape
\lipsum[3]
\end{document}
我们改变\parshape
后开始\paragraph
标题。
答案2
\documentclass{scrbook}
\usepackage{lipsum}
\parskip=1em
\begin{document}
\lipsum[1]
{\leftskip=\parindent
\parindent=-\leftskip
\lipsum[2]}
\lipsum[3]
\end{document}
跟进
首先:在之前保存默认设置后,\paragraph
将该行添加\expandafter\def\csname scr@paragraph@sectionindent\endcsname{-\dimexpr\svparindent\relax}
到组合中。\parindent
\svparindent
\documentclass{scrbook}
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\edef\svparindent{\the\parindent}
\begin{document}
\lipsum[1]
{\leftskip=\parindent
\parindent=-\leftskip
\expandafter\def\csname scr@paragraph@sectionindent\endcsname{-\svparindent}%
\paragraph{my paragraph} \lipsum[2]
}
\lipsum[3]
\end{document}
答案3
悬挂包装非常好 - 而且方便
\documentclass{article}
\usepackage{hanging}
\begin{document}
\hangpara{3em}{-3}You can also use the hanging macro directly from the package if don't want my autowidth eg several hangs of the same width
hangpara is called as width and then a positive value indents the left a negative intends at the right of the text
The second parameter is nthe number of lines toi indent . If positive, then the lines after N will be indented. If negative the first N lines will be indented.
NB Must be no linebreak between hangpara command and the text (or use a percent sign)
\bigskip
\hangpara{3em}{3}You can also use the hanging macro directly from the package if don't want my autowidth eg several hangs of the same width
hangpara is called as width and then a positive value indents the left a negative intends at the right of the text
The second parameter is nthe number of lines toi indent . If positive, then the lines after N will be indented. If negative the first N lines will be indented.
NB Must be no linebreak between hangpara command and the text (or use a percent sign)
\bigskip
\hangpara{8em}{-1}You can also use the hanging macro directly from the package if don't want my autowidth eg several hangs of the same width
hangpara is called as width and then a positive value indents the left a negative intends at the right of the text
\bigskip
\hangpara{8em}{1}You can also use the hanging macro directly from the package if don't want my autowidth eg several hangs of the same width
hangpara is called as width and then a positive value indents the left a negative intends at the right of the text
The second parameter is nthe number of lines toi indent .
\end{document}