使用 itemize list 时,我想包含不属于项目要点的文本。是否可以不按项目缩进的方式缩进它?
\begin{itemize}
\item One
Subsequently, we only want to count the cases...
\item Two
The subsequent order of the other neighbors...
\item Three
\end{itemize}
答案1
借助于,\vbox
你可以“摆脱”列表中的缩进:
\documentclass{article}
\usepackage{lipsum}
\newcommand\NoIndent[1]{%
\par\vbox{\parbox[t]{\linewidth}{#1}}%
}
\begin{document}
\begin{itemize}
\item One
\NoIndent{\lipsum[4]}
\item Two
\NoIndent{\lipsum[2]}
\item Three
\NoIndent{\lipsum[1]}
\end{itemize}
\end{document}
作为芭芭拉·比顿在她的评论中注意到,上述解决方案不允许在里面分页\NoIndent
;这里有一个允许分页的解决方案,用来\vsplit
打破\vbox
(这种技术是由埃格尔在his answer
到可破坏的垂直盒子):
\documentclass{article}
\usepackage[a6paper]{geometry}% just for the example
\usepackage{lipsum}
\newbox\totalbox
\newbox\partialbox
\newdimen\partialboxdim
\newenvironment{nibox}
{\par\vskip-6pt\setbox\totalbox=\vbox\bgroup}
{\egroup\splitnibox}
\def\splitnibox{%
\ifvoid\totalbox\par
\else\continuesplitting\fi}
\def\continuesplitting{\null% In case this starts a new page
\dimen255=\dimexpr\pagegoal-\pagetotal-\pageshrink-6pt\relax
\ifdim\ht\totalbox<\dimen255
\setbox\partialbox=\box\totalbox
\unvbox\partialbox
\else
\setbox\partialbox=\vsplit\totalbox to\dimen255
\unvbox\partialbox\eject
\fi
\splitnibox}
\newcommand\NoIndent[1]{\begin{nibox}#1\end{nibox}}
\begin{document}
\begin{itemize}
\item One
\NoIndent{\lipsum[4]}
\item Two
\NoIndent{\lipsum[2-3]}
\item Three
\end{itemize}
\end{document}
答案2
您可以恢复到\parshape0
组内,因此组结束后将恢复以前的设置:
\documentclass{article}
\usepackage{lipsum}
\newcommand\NoIndent[1]{%
\begingroup
\par
\parshape0
#1\par
\endgroup
}
\begin{document}
\begin{itemize}
\item One
\NoIndent{\lipsum[4]}
\item Two
\NoIndent{\lipsum[2]}
\item Three
\NoIndent{\lipsum[1]}
\end{itemize}
\end{document}
这与分页符无关。