我一直在使用 Beamer 上的 tikz 提供的这个非常简单的标注包。但是我在控制标注内的文字时遇到了一些问题。我希望能够在文本内创建段落并更改文本的字体大小。该怎么做?
\documentclass[10pt]{beamer}%
\usepackage[beamer,customcolors]{hf-tikz}
\usepackage{tikz}
\usetikzlibrary{shapes.callouts}
\usepackage{tikz}
\usepackage{pgf,tikz}
\usetikzlibrary{patterns,arrows,decorations.pathreplacing}
\usepackage[english]{babel}
\begin{document}
\begin{frame}{Dummy slide}
\begin{itemize}
\item{\textbf{Dummy:} Dummy, \tikz[remember picture] \node (a) {\vphantom{X}}; Dummy, dummy, dummy }
\item{\textbf{Dummy:} Dummy }
\item{\textbf{Dummy:} Dummy }
\end{itemize}
\begin{tikzpicture}[remember picture,overlay]
\path<2> (a.east) ++(-5,1) node[anchor=west,rectangle callout,fill=red!50,opacity=.5, callout absolute pointer={(a.mid)}] {Some dummy text here. Paragraph. Some more dummy text};
\end{tikzpicture}
\end{frame}
\end{document}
答案1
通过 改变节点的宽度text width
。
通过 更改字体样式font
。
不要多次加载一个包。
我更喜欢只使用一个\usetikzlibrary
,或者对每个库使用该命令(如\usepackage
)
示例代码:
\documentclass[10pt]{beamer}
\usepackage[beamer,customcolors]{hf-tikz}
\usepackage{tikz}
\usetikzlibrary{patterns,arrows,decorations.pathreplacing,shapes.callouts}
\usepackage[english]{babel}
\begin{document}
\begin{frame}{Dummy slide}
\begin{itemize}
\item{\textbf{Dummy:} Dummy, \tikz[remember picture] \node (a) {\vphantom{X}}; Dummy, dummy, dummy }
\item{\textbf{Dummy:} Dummy }
\item{\textbf{Dummy:} Dummy }
\end{itemize}
\begin{tikzpicture}[remember picture,overlay]
\path<2> (a.east) ++(-4,1) node[anchor=west,rectangle callout,fill=red!50,opacity=.5, callout absolute pointer={(a.mid)},text width=5cm,font=\bfseries\footnotesize] {Some dummy text here. Paragraph. Some more dummy text};
\end{tikzpicture}
\end{frame}
\end{document}