如何用文字填充形状,例如圆形?

如何用文字填充形状,例如圆形?

如何将文本限制在圆形或三角形等形状内?我不希望文本沿着周边排列,我希望它在所有内边缘处适当断开。

答案1

看着shapepar (手动的)如何做到这一点。

答案2

正如@Yossi之前提到的,shapepar是你的朋友。完整文档位于常去的地方在 CTAN 中。下面是如何使用它的一个例子:

\documentclass{article}
\usepackage{shapepar}
\begin{document}

\def\triangledownshape{%
{0}%
{0}b{0}\\%
{0}t{-10}{20}\\%
{8.66}t{-5}{10}\\%
{17.32}e{0}%
}
\def\triangledownpar#1{\Shapepar\triangledownshape #1\unskip\ $\bigtriangledown$\par}

\triangledownpar{This is an example of a shape created with 
   \texttt{shapepar}. Other predefined possibilities include \textbf{circle},     
   \textbf{donut}, \textbf{heart}, \textbf{star}, \textbf{star}, \textbf{nut}, 
   \textbf{rectangle}. Also, there are other definitions currently not included 
   by default, which you'd find in the \texttt{*shapes.def} files in the
   \texttt{shapepar} directory~--- \textbf{drops}, \textbf{triangles} (facing all 
   directions), \textbf{\TeX logo}, \textbf{candle}, \textbf{Canadian flag}. 
   Your result may or may not look weird, depending on the size of the shape
   and the word distribution.}

\end{document}

结果如下图所示(示例使用\documentclass{standalone}, 来节省空间):

三角形示例

一个简单的圆形示例:

\documentclass[preview]{standalone}
\usepackage{shapepar}
\begin{document}
\Shapepar{\circleshape} I see now the many ways of creating beautiful forms. As you use shapepar, text may be made to appear in geometric shapes and arrangements. Very nice are the things you can do.\par
\end{document}

圆形示例

也可以使用自定义形状的切口,但在这个特定的例子中我还没有尝试过。

就我个人而言,我发现定义新形状并不是很简单,但 YMMV。另外,如果您感兴趣xfig(我不喜欢),您可以尝试该shapepatch软件包,它基本上修补了该软件包(duh!),xfig以便您可以使用您的杰作作为边界shapepar。不过,我无法评论它的效果如何——我从未使用过它。

相关内容