为什么独立类会反转 \parshape 缩进(使得它出现在每行的末尾,而不是开头)以及如何改变它?

为什么独立类会反转 \parshape 缩进(使得它出现在每行的末尾,而不是开头)以及如何改变它?

您可以用 替换\documentclass[varwidth]{standalone}\documentclass{article}查看差异。如何\parshape在使用 时按预期工作standalone

\documentclass[varwidth]{standalone}
\begin{document}
  \setlength{\parindent}{0pt}
  \parshape 3 0mm 40mm 5mm 35mm 10mm 30mm
  This is sentence 1. This is sentence 2.
  This is sentence 3. This is sentence 4.
  This is sentence 5. This is sentence 6.
  \par
\end{document}

答案1

由于您已经知道宽度,因此只需将其包裹在\parbox该宽度中即可。在这种情况下,varwidth可以省略该选项。

\documentclass[varwidth]{standalone}
\begin{document}
\parbox{40mm}{%
  \setlength{\parindent}{0pt}
  \parshape 3 0mm 40mm 5mm 35mm 10mm 30mm
  This is sentence 1. This is sentence 2.
  This is sentence 3. This is sentence 4.
  This is sentence 5. This is sentence 6.
  \par}
\end{document}

在此处输入图片描述

相关内容