15

In many old books, the final paragraphs of chapters end in an inverted pyramid shape, like this:

enter image description here

I think this is beautiful, so I would like to imitate this for my book. I've found the code for a triangle in this post how to create a triangle with text

\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}

Which results in this:

up triangle

But I'd like it to be inverted and the first part of the paragraph need to be full line width. Only the last few lines should end in an inverted pyramid like in the example above.

Is there a way to do this? Thanks in advance for your help.

L.A. Rabida
  • 467
  • 2
  • 8

1 Answers1

17

Adjust dimensions to your taste:

\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}

enter image description here

Ignasi
  • 136,588
  • Sholdn't your x=8 comment be x=7? – Steven B. Segletes Nov 08 '17 at 12:39
  • 2
    Add this to your preamble, \usepackage{stackengine} \def\asterism{$\vcenter{\hbox{\scalebox{0.7}{\stackon[-0.5pt]{\bfseries*}{\bfseries*~*}}}}$} and specify your text as \shapepar{\myshape} \blindtext \blindtext \blindtext \blindtext (\asterism) and I guarantee you will get more upvotes. – Steven B. Segletes Nov 08 '17 at 12:47
  • @StevenB.Segletes Please, feel free to edit my code. The code in your comment shows an error that I don't understand. I'm sure you will do it faster than me. – Ignasi Nov 08 '17 at 16:27
  • Done! Copy/paste from comments frequently injects junk tokens...plus I forgot to mention graphicx. – Steven B. Segletes Nov 08 '17 at 17:07
  • Your solution looks fantastic, thanks! The only thing is, the entire text sample appears on a new page. So

    \blindtext\blindtext\blindtext\blindtext\blindtext\blindtext [newline][newline] \shapepar{\myshape}\blindtext\blindtext\blindtext\blindtext\blindtext\blindtext

    is not a continuous text consisting of two paragraphs, but one paragraph, new page and then the paragraph containing the inverted pyramid. I'd like it to be without a new page, so the last paragraph of an entire chapter could be in this shape. Is that possible too? Thanks in advance for an answer.

    – L.A. Rabida Nov 08 '17 at 19:29
  • In addition the total width of a paragraph depends on the length of the paragraph (just remove one \blindtext and compare the results). – Skillmon Nov 08 '17 at 19:38
  • @L.A.Rabida \shapepar defines an unbreakable paragrapah, if the paragraph doesn't fit in this page will jump to a new one. Therefore, you'll have to decide what text conform your last paragraph, where it lays and adapt the shape to these conditions. Take a look at shapepar documentation, it's easy to understand the examples and build the paragraph design that you need. – Ignasi Nov 09 '17 at 08:23