Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
add comment

3 Answers 3

up vote 6 down vote accepted

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}
share|improve this answer
1  
...interesting! –  Werner Nov 14 '11 at 19:09
    
@Werner ...TeX's mysteries! At first I thought it was an expansion problem, but then I realized it uses the fp package... –  Yiannis Lazarides Nov 14 '11 at 19:13
add comment

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}
share|improve this answer
    
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. –  Yiannis Lazarides 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
    
Thank you Werner. –  Regis da Silva Nov 14 '11 at 18:46
    
@Werner Sure it does not but neither the answer:) I think Herbert identified the source of the error but still not the answer! –  Yiannis Lazarides Nov 14 '11 at 19:04
add comment

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}
share|improve this answer
    
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 –  Herbert Nov 14 '11 at 19:10
    
Thanks, peoples. –  Regis da Silva Nov 14 '11 at 20:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.