将文本环绕在三角形中

将文本环绕在三角形中

是否可以像下图一样将文字包裹在三角形内?

在此处输入图片描述

答案1

如果您能展示一些可编译的代码来表明您为寻找解决方案付出的努力,我们总是会很感激。如果您什么都没有,也许至少可以放一点这样的代码:

\documentclass{article}
\begin{document}
\end{document}

以下内容可能会给你一些关于如何解决问题的想法:

shapepar解决方案:

正如评论中指出的shapepar那样,这可能就是您所需要的。不过,剩下的问题是,您认为三角形的文本和三角形内的文本有什么不同。

可行的方法是:

\documentclass[12pt]{article}
\usepackage{shapepar}
\usepackage[default]{frcursive}
\usepackage{color}
\def\sailshape{%
{0}%
{0}b{0}\\%
{8.66}t{-5}{10}\\%
{17.32}t{-10}{20}\\%
{17.32}e{0}%
}   
\def\sailpar#1{\centering\Shapepar\sailshape#1\unskip}
\begin{document}
\sailpar{\large\bfseries\textcolor{blue}{\\Join Graham as he Sets Sail For the ``7'' Seas} \textcolor{red}{Saturday, September 15th, 2:00 - 3:30 pm, Lake Oconee Reynolds Pantation ~ (012) 345 678}  \textcolor{blue}{Let us know if you can sail-a-brate with us! Reply to Lydia (098) 765 432 1}}
\end{document}

得出的结果是:

在此处输入图片描述

正如你所见,线条自动断掉。

手动换行:

如果您开始手动执行此操作 - 因为您希望它们在特定点中断 - 您应该遵循David的评论并在环境内手动中断它们center

\documentclass[12pt]{article}
\usepackage[default]{frcursive}
\usepackage{color}
\begin{document}
\begin{center}
\large\bfseries\textcolor{blue}{Join\\Graham\\as he\\Sets Sail\\For the ``7'' Seas}\\\textcolor{red}{Saturday, September 15th,\\2:00 - 3:30 p.m.\\Lake Oconee\\Reynolds Pantation ~ (012) 345 678}\\\textcolor{blue}{Let us know if you can sail-a-brate with us!\\Reply to Lydia (098) 765 432 1}
\end{center}
\end{document}

这让你

在此处输入图片描述

编辑:带有背景图像的解决方案

你可以将它与你可能拥有的任意三角形图片结合起来,或者用 tikz 自己绘制一个:

\documentclass[12pt]{article}
\usepackage{shapepar}
\usepackage{tikz}
\usepackage[default]{frcursive}
\usepackage{color}
\def\sailshape{{0}{0}b{0}\\{8.66}t{-5}{10}\\{17.32}t{-10}{20}\\{17.32}e{0}}   
\def\sailpar#1{\centering\Shapepar\sailshape#1\par}
\begin{document}
\begin{tikzpicture}
\node[inner sep=0,anchor=south west] at (0,0) {\includegraphics[width=\textwidth]{Unbenannt.png}};
\node[draw=none,align=center,text width=4cm,anchor=south] at (40mm, 58mm) {\sailpar{\small\bfseries\textcolor{blue}{\\Join Graham as he sets sail For the ``7'' seas} \textcolor{red}{Saturday, September 15th, 2:00 - 3:30 pm, Lake Oconee Reynolds Pantation  (012) 345 678}  \textcolor{blue}{Let us know if you can sail-a-brate with us! Reply to Lydia (098) 765 432 1}}};
\end{tikzpicture}
\end{document}

这让你在此处输入图片描述

答案2

使用 TikZ 快速演示:

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\node[
  draw,
  align=center,
  regular polygon,
  regular polygon sides=3,
  inner sep=-10pt] {
Join \\
Graham \\
as he sets sail\\
\ldots};
\end{tikzpicture}
\end{document}

答案3

一个简单的tabular3 pstricks nodes。先写文字,然后在其周围添加一个三角形:

\documentclass[x11names]{standalone}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{ebgaramond}
\usepackage{array}
\usepackage{pstricks-add}
\usepackage{auto-pst-pdf}
\psset{unit = 2,dotsize = 2.5pt}

\begin{document}

\begin{postscript}
\rlap{\begin{tabular}{@{}>{\color{RoyalBlue4}}c@{}}
 \pnode[0,6ex]{A}\\  Join \\ \large Graham \\ as he \\ Sets Sail \\  For the "7" Seas \\\\
\begin{tabular}{@{}>{\color{IndianRed2}}c@{}}
Saturday,  September  15 th  \\ 2:00-3:30 p.m. \\ Lake Oconee \\ Reynolds Plantation
\end{tabular}\\[6ex]%
\small%
\pnode[-3.5em,-5ex]{B} Let us know if you can sail a-brate with us\pnode[3.5em, -5ex]{C} \\
\small Reply to Lydia
\end{tabular}%}
\pspolygon[linecolor=white, fillstyle = solid, fillcolor=AntiqueWhite2,opacity =0.2](A)(B)(C)}%
\end{postscript}

\end{document} 

在此处输入图片描述

相关内容