
時々、絶対座標で絵を描きたいのですbeamer
が、以下の例では円を描くときにオフセットがあるようです。絶対座標で絵を描くにはどうしたらいいでしょうか?
現在のコード:
\documentclass[t]{beamer}
\usepackage{tikz}
\setbeamertemplate{background canvas}{%
\begin{tikzpicture}
\fill[color=orange!10] (0,0) rectangle (\paperwidth,\paperheight);
\draw[step=1.0,black,thin] (0,0) grid (\paperwidth,\paperheight);
\end{tikzpicture}}
\begin{document}
\begin{frame}[t]{Title here}
\begin{tikzpicture}[very thick]
\def\r{2}
\def\x0{5}
\def\y0{5}
\draw[fill=black] (\x0,\y0) circle (5pt);
\draw (\x0,\y0) circle (\r);
\draw [->] (\x0,\y0) -- (\x0+\r,\y0);
\end{tikzpicture}
\end{frame}
\end{document}
(5,5) に円を描きたいのですが、現在の出力は次のようになります。
答え1
次にモードに切り替えてoverlay,remember picture
、ページに対して画像を移動します。その後、十分な回数コンパイルします。
\documentclass[t]{beamer}
\usepackage{tikz}
\setbeamertemplate{background canvas}{%
\begin{tikzpicture}
\fill[color=orange!10] (0,0) rectangle (\paperwidth,\paperheight);
\draw[step=1.0,black,thin] (0,0) grid (\paperwidth,\paperheight);
\end{tikzpicture}}
\begin{document}
\begin{frame}[t]{Title here}
\begin{tikzpicture}[very thick,overlay,remember picture]
\def\r{2cm}\def\x0{5cm}\def\y0{5cm}
\begin{scope}[shift={(current page.south west)}]
\draw[fill=black] (\x0,\y0) circle (5pt);
\draw (\x0,\y0) circle (\r);
\draw [->] (\x0,\y0) -- (\x0+\r,\y0);
\end{scope}
\end{tikzpicture}
\end{frame}
\end{document}