
가끔 절대좌표로 그림을 그리고 싶을 때가 있습니다 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}