我想创建一个三角形,里面有文字,我可以写文字,但是我该如何创建三角形呢?我的文字代码是
\documentclass{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenx}
\usepackage{tkz-euclide}
\usetkzobj{all}
\begin{document}
Text1 $RT_{1,1}$ $RT_{1,2}$ $RT_{1,3}$ $RT_{1,4}$ $RT_{1,5}$................ $RT_{1,m}${\tiny \textcolor{red}{the most famous text}.\\}
Text2 $RT_{2,1}$ $RT_{2,2}$ $RT_{2,3}$ $RT_{2,4}$ ................ $RT_{2,m-1}$\\
Text3 $RT_{3,1}$ $RT_{3,2}$ $RT_{3,3}$ ................ $RT_{3,m-2}$\\
Text4 $RT_{4,1}$ $RT_{4,2}$ ................ $RT_{4,m-3}$\\
Text5 $RT_{5,1}$ ................ $RT_{5,m-4}$\\
...\\
Textj $RT_{j,1}$ {\tiny \textcolor{red}{the less famous text}.}
\end{document}
答案1
我希望这是你所需要的...
\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}
基于这个答案,我正在使用形状零件包,它有一些内置的形状,但您可以创建自定义的形状。
可能有更简单的方法就是将默认的三角定义文件复制到某个目录,但我只是复制/粘贴代码。
答案2
你想要这样的东西吗?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows,backgrounds}
\begin{document}
\begin{tikzpicture}
\node (t) [align=left] {
Text1 $RT_{1,1} RT_{1,2} RT_{1,3} RT_{1,4} RT_{1,5}$................ $RT_{1,m}$\\
Text2 $RT_{2,1} RT_{2,2} RT_{2,3} RT_{2,4}$ ................ $RT_{2,m-1}$\\
Text3 $RT_{3,1} RT_{3,2} RT_{3,3}$ ................ $RT_{3,m-2}$\\
Text4 $RT_{4,1} RT_{4,2}$ ................ $RT_{4,m-3}$\\
Text5 $RT_{5,1}$ ................ $RT_{5,m-4}$\\
...\\
Textj $RT_{j,1}$
};
\scoped[on background layer]{\draw [ultra thick, rounded corners=2.5mm, drop shadow, fill=white] (t.north west) -- ([xshift=10mm]t.north east) -- ([yshift=-30mm]t.south west) -- cycle ;}
\end{tikzpicture}
\end{document}
编辑
我不确定这是否是您想要的那种位置,但它至少显示了如何在三角形的右侧画一个箭头。
我将其设为蓝色以增加多样性:
\documentclass[tikz,border=10pt]{standalone}
\usetikzlibrary{shadows,backgrounds,positioning,arrows.meta}
\begin{document}
\tikzset{
my blue/.style={
text=black,
ultra thick,
draw=blue!50!cyan,
}
}
\begin{tikzpicture}[my blue]
\node (t) [align=left] {
Text1 $RT_{1,1} RT_{1,2} RT_{1,3} RT_{1,4} RT_{1,5}$................ $RT_{1,m}$\\
Text2 $RT_{2,1} RT_{2,2} RT_{2,3} RT_{2,4}$ ................ $RT_{2,m-1}$\\
Text3 $RT_{3,1} RT_{3,2} RT_{3,3}$ ................ $RT_{3,m-2}$\\
Text4 $RT_{4,1} RT_{4,2}$ ................ $RT_{4,m-3}$\\
Text5 $RT_{5,1}$ ................ $RT_{5,m-4}$
};
\node (r) [below=25pt of t.south west, anchor=north west] {\dots};
\node (s) [below=25pt of r.south west, anchor=north west] {Textj $RT_{j,1}$};
\scoped[on background layer]{\draw [rounded corners=7.5pt, drop shadow, inner color=blue!50!cyan!10, outer color=blue!50!cyan!20, my blue] (t.north west) -- ([xshift=25pt]t.north east) coordinate (p) -- ([yshift=-40pt]s.south west) coordinate (q) -- cycle ;}
\draw [my blue, -{Stealth[]}] ([xshift=10pt] q -| p) -- ([xshift=10pt]p);
\end{tikzpicture}
\end{document}
为了回答您关于添加文本的后续问题,最简单的方法是在绘制箭头的路径上添加节点。例如,而不是
\draw [my blue, -{Stealth[]}] ([xshift=10pt] q -| p) -- ([xshift=10pt]p);
你可以说
\draw [my blue, -{Stealth[]}] ([xshift=10pt] q -| p) -- ([xshift=10pt]p) node [right, midway, align=left] {Testo allineato\\a destra} node [above left, at end, align=right] {top\\node} node [at start, below, align=center] {bottom\\node} node [pos=.25, right, align=left] {yet\\another\\node} node [above right, align=left] {another\\node};
生产
我不太确定您想要多少个节点或确切的位置,因此我提供了一个选择来展示各种可能性,您可以根据需要进行修改。