0

In this example, slightly modified, the positionning of 'N' has been corrected with textheight to not be masked by the header:

\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}

enter image description here

  • Is there other metrics than textheight to manage the different areas of the frame (header, footer, between) for tikz drawing?
  • Which one in particular permits to work between from 0.0 to 1.0?
lalebarde
  • 769
  • See https://tex.stackexchange.com/questions/397523/tikz-based-beamer-frame/397557?r=SearchResults&s=2|44.9584#397557 – John Kormylo May 17 '19 at 12:20

1 Answers1

2

With tikzmark one can automatically get the position where the frametitle ends:

\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}

edit:

\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}
  • 'N' is actually at the right vertical position with your proposition, but not centered for the horizontal position. Could you improve it please? – lalebarde May 17 '19 at 21:52
  • I have added \fill (0cm,0cm) circle (5pt); which shows that your solution writes 'N' on the y axis as expected. The remaining problem is how to center the origin of the xy coordinate system – lalebarde May 18 '19 at 06:06
  • I don't find the pic coordinate system in the pgfmanual.pdf. Where could I find a description for it please? Sorry, § 14.19 – lalebarde May 18 '19 at 06:13
  • @lalebarde the pic coordinate syntax comes from the tikzmark library. This has an own manual and is not include in the pgfmanual. To find the manual, open a command line and type texdoc tikzmark –  May 18 '19 at 13:18
  • @lalebarde To get the coordinate in the center, use the calc library. This library allows to mix the x and y coordinates of different coordinated. In This case use the y coordinate from pic cs:endframetitle and the x coordinate from current page.center –  May 18 '19 at 13:19
  • @lalebarde Please see the edit in my answer for the calculations –  May 18 '19 at 13:28