在此例子,稍作修改,“N”的位置已被更正,textheight
不会被标题掩盖:
\documentclass[beamer]{beamerswitch}
\usetheme{metropolis}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{frame}\frametitle{My title}
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\node[anchor=north] at ($(current page.north)+(0,-0.1\textheight)$) {N};
\node[anchor=west] at (current page.west) {W};
\node[anchor=east] at (current page.east) {E};
\node[anchor=south] at (current page.south) {S};
\node at (current page.center) {C};
\end{tikzpicture}
\end{frame}
\end{document}
textheight
除了管理 tikz 绘图的框架的不同区域(页眉、页脚、之间)之外,还有其他指标吗?- 哪一个特别允许工作之间从 0.0 到 1.0?
答案1
可以tikzmark
自动获取frametitle结束的位置:
\documentclass[beamer]{beamerswitch}
\usetheme{metropolis}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{tikzmark}
\addtobeamertemplate{frametitle}{}{\tikzmark{endframetitle}}
\begin{document}
\begin{frame}\frametitle{My title}
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\node at (pic cs:endframetitle) {N};
\node[anchor=west] at (current page.west) {W};
\node[anchor=east] at (current page.east) {E};
\node[anchor=south] at (current page.south) {S};
\node at (current page.center) {C};
\end{tikzpicture}
\end{frame}
\end{document}
编辑:
\documentclass[beamer]{beamerswitch}
\usetheme{metropolis}
\usepackage{tikz}
\usetikzlibrary{calc}
\usetikzlibrary{tikzmark}
\addtobeamertemplate{frametitle}{}{\tikzmark{endframetitle}}
\begin{document}
\begin{frame}\frametitle{My title}
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\node at (pic cs:endframetitle) {N};
\node[anchor=west] at (current page.west) {W};
\node[anchor=east] at (current page.east) {E};
\node[anchor=south] at (current page.south) {S};
\node at (current page.center) {C};
\fill[red] let \p1 = (pic cs:endframetitle),
\p2 = (current page.center) in
(\x2,\y1) circle (0.1);
\end{tikzpicture}
\end{frame}
\end{document}