如何以倒金字塔形状结束段落文本?

如何以倒金字塔形状结束段落文本?

在许多旧书中,章节的最后段落以倒金字塔形状结尾,如下所示:

在此处输入图片描述

我觉得这很漂亮,所以我想在我的书中模仿它。我在这篇文章中找到了三角形的代码如何创建带文本的三角形

\documentclass{article}
\usepackage{microtype,shapepar}

\def\triangleupshape{%
{0}%
{0}b{0}\\%
{8.66}t{-5}{10}\\%
{17.32}t{-10}{20}\\%
{17.32}e{0}%
}    

\begin{document}
\shapepar{\triangleupshape}A ipsum dolor sit amet, consectetuer    adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. \par
\end{document}

结果是:

上三角形

但我希望它是倒置的,并且段落的第一部分需要全线宽。只有最后几行应该像上面的例子一样以倒金字塔的形式结束。

有办法吗?提前感谢您的帮助。

答案1

根据您的喜好调整尺寸:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{shapepar}
\usepackage{lipsum}
\usepackage{lmodern}
\usepackage{blindtext}
\usepackage{graphicx,stackengine}
\def\asterism{$\vcenter{\hbox{\scalebox{0.7}{\stackon[-0.5pt]{\bfseries*}{\bfseries*~*}}}}$}
\newcommand\myshape{% 
{7}             %line center at x=7
{0}  b{0}\\     % text starts at (0,0)
{0}  t{0}{14}\\ % Line at y=0 starts at x=0 with length 14
{10} t{0}{14}\\ % Line at y=10 starts at x=0 with length 14
{15} t{7}{0}\\  % Line at y=15 starts at x=7 with length 0
{15} e{7}       % text ends at (7,15)
}

\begin{document}
\shapepar{\myshape} \blindtext \blindtext \blindtext \blindtext (\asterism)
\end{document}

在此处输入图片描述

相关内容