3

See my code: With \diamondshape it works but with \circleshape it does not. What is wrong?

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{shapepar}
\usepackage{lipsum}
\pagestyle{empty}

\begin{document}

\shapepar{\circleshape}
{\lipsum*[1]}

\end{document}
Stephen
  • 14,890
Regis Santos
  • 14,463

4 Answers4

6

Use English rather than Latin or use hyphenation for Latin via the babel package and the overflow problem would go away!

\documentclass[a4paper]{article}
\usepackage[latin]{babel}
\usepackage{lipsum}
\usepackage{shapepar}
\begin{document}
\lipsum[1]

\shapepar[8.5cm]{\circleshape}
\lipsum*[1]
\end{document}

This will also work, that points certainly that there is some sort of overflow due to hyphenation not being achieved.

\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage{shapepar}
\begin{document}
\shapepar[8.5cm]{\circleshape}
a an ann anne lo res ar t t \lipsum*[1]
\end{document}
yannisl
  • 117,160
3

Not exactly sure why, but LaTeX complains about a dimension being too large. My guess is this has to do with the top and bottom end of the circle. Using a similar approach to that specified in Text wrap with shapepar (insert image between text), here is a new versions of \circleshape called \mycircleshape. I've written it into a macro so you can use \mycircle{\lipsum*[1]}:

enter image description here

\documentclass{article}
\usepackage{shapepar}% http://ctan.org/pkg/shapepar
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\pagestyle{empty}
\newcommand{\mycircle}[1]{\shapepar{\mycircleshape}#1\par}
\def\mycircleshape{%
{25.1393}%
{0.0696379}b{25.1393}\\%
{0.278552}t{21.727}{6.82451}\\%
{0.97493}t{18.3844}{13.5097}\\%
{2.15877}t{15.1811}{19.9164}\\%
{3.69081}t{12.117}{26.0446}\\%
{5.71031}t{9.33148}{31.6156}\\%
{8.00836}t{6.82451}{36.6295}\\%
{10.6546}t{4.66574}{40.9471}\\%
{13.5794}t{2.85515}{44.5682}\\%
{16.7131}t{1.53203}{47.2145}\\%
{20.0557}t{0.626741}{49.0251}\\%
{23.3983}t{0.139276}{50}\\%
{26.8802}t{0.139276}{50}\\%
{30.2228}t{0.626741}{49.0251}\\%
{33.5655}t{1.53203}{47.2145}\\%
{36.6992}t{2.85515}{44.5682}\\%
{39.624}t{4.66574}{40.9471}\\%
{42.2702}t{6.82451}{36.6295}\\%
{44.5682}t{9.33148}{31.6156}\\%
{46.5877}t{12.117}{26.0446}\\%
{48.1198}t{15.1811}{19.9164}\\%
{49.3036}t{18.3844}{13.5097}\\%
{50}t{21.727}{6.82451}\\%
{50.2089}e{25.1393}%
}

\begin{document}
\mycircle{\lipsum*[1]}
\end{document}
Werner
  • 603,163
  • You don't need to redefine, you need to expand the text. Try this \shapepar{\circleshape} this must have a reasonable a reasonable number of words to achieve a circle. – yannisl Nov 14 '11 at 18:39
  • This still does not explain why \lipsum*[1] works for \diamondshape but not \circleshape. – Werner Nov 14 '11 at 18:44
  • @Werner Sure it does not but neither the answer:) I think Herbert identified the source of the error but still not the answer! – yannisl Nov 14 '11 at 19:04
2

there is a problem with the \lipsum macro. It redefines \par which isn't allow inside shapepar

\documentclass[a4paper]{article}
\usepackage[nopar]{lipsum}
\usepackage{shapepar}
\pagestyle{empty}
\makeatletter
\let\lips@par\endgraf
\makeatother   
\begin{document}

\shapepar[8.5cm]{\circleshape}
\lipsum[1]    

\shapepar[8.5cm]{\circleshape}
\lipsum*[1]

\end{document}
  • Regis is using \lipsum* which doesn't emit \par commands. – egreg Nov 14 '11 at 19:03
  • According to the definition of \lipsum*, it should do exactly as you suggest: \let\lips@par\relax by executing \ChangeLipsumPar before typesetting the actual \lipsum. So why does it not work as expected? – Werner Nov 14 '11 at 19:07
  • Now I also use the star version –  Nov 14 '11 at 19:10
0

If the error was "dimension too large" or "arithmetic overflow", that was a sporadic random occurrence. It was fixed in shapepar version 2.3 (Sep 2019).