我已经写下了代码。但问题是,我该如何输入这个句子現在正在在圖片內。
我的代码是
\begin{frame}{Frame Title}
\begin{figure}
\centering
\begin{tikzpicture}
\draw[thick][->](0,0) to (4,0);
\draw[thick][->](2,1.5) to (4,0.5);
\draw[thick][loosely dotted](4,0) to (5,0);
\end{tikzpicture}
\caption{Timeline}
\label{fig:my_label1}
\end{figure}
\end{frame}
答案1
to
如果将语法替换为--
:,则可以将节点放置在适当的位置:
笔记:
- 您不需要
[]
对每个选项都使用。
代码:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[thick, ->] (0,0) to (4,0);
\draw[thick, ->] (2,1.5) -- (4,0.5) node [pos=0, anchor=east] {Happening Now};
\draw[thick, loosely dotted] (4,0) to (5,0);
\end{tikzpicture}
\end{document}
答案2
答案3
正如@nidhin所建议的:
\documentclass[tikz,border=0.5cm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw[thick][->](0,0) to (4,0);
\draw[thick][->](2,1.5)node[left]{Happing now} to (4,0.5);
\draw[thick][loosely dotted](4,0) to (5,0);
\end{tikzpicture}
\end{document}
答案4
根据你之前的回答 问题:
\documentclass[12pt,a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{figure}
\centering
\begin{tikzpicture}[thick]
\draw[->] (0,0) edge (4,0)
(2,3) node[left] {Happing Now} -- (4,1);
\draw[thick][loosely dotted] (4,0) -- (5,0);
\end{tikzpicture}
\caption{Timeline}
\label{fig:my_label1}
\end{figure}
\end{document}