Skip to content

Instantly share code, notes, and snippets.

@zr-tex8r
Created February 23, 2013 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zr-tex8r/5019217 to your computer and use it in GitHub Desktop.
Save zr-tex8r/5019217 to your computer and use it in GitHub Desktop.
LaTeX: TikZ で絶対位置指定で配置を行う
% 2回コンパイルが必要
\documentclass[9pt]{beamer}
\usepackage{tikz}
\begin{document}
% 画像の定義
\pgfdeclareimage[width=1cm,height=1cm]{tiger}{tiger}
% 背景グリッドの背亭
\setbeamertemplate{background}[grid][step=1cm]
% "just here" スタイルの定義
\tikzset{just here/.style = {above right,inner sep=0mm}}
\begin{frame}[t]{PGF drawing}
\begin{itemize}
\item Blah blah.
% 'current page' を使うため 'remember picture' を有効化
\begin{tikzpicture}[remember picture]
% 外見のサイズをゼロにしてしまう
\useasboundingbox (0,0);
% 'current page' は現在ページの長方形を示すノード
% その左下が原点となるように平行移動を行う
\begin{scope}[shift={(current page.south west)}]
% この中で原点はページ左下
\node[just here] at (1,1) {\pgfuseimage{tiger}};
\node[just here] at (11,1) {\pgfuseimage{tiger}};
\node[just here] at (11,8) {\pgfuseimage{tiger}};
% 確認のため左下に黒丸を描く
\node[fill,circle] at (0,0) {};
\end{scope}
\end{tikzpicture}
\item More blah blah.
\end{itemize}
\end{frame}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment