I have for a long time been using a code to place beamer buttons on a slide that is very inefficient as it requires me to specify exactly the position of each button. Below a MWE of the code I am using.
Is there anyway that I can avoid specifying the position of the button? I.e. they would just line up automatically from the bottom right hand corner to the left ...
\documentclass[10pt]{beamer}%
\usepackage{appendixnumberbeamer}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{booktabs}
\usepackage{bbm}
\usepackage{amsmath}
\usepackage{arydshln}
\usepackage{graphicx}
\usepackage{ mathrsfs }
\usepackage{multirow}
\usepackage{textpos}
\definecolor{darkblue}{RGB}{140,140,172}
\definecolor{bluegreen}{RGB}{173,173,224}
\definecolor{lightbluegreen}{RGB}{204,0,51}
\definecolor{cyan}{RGB}{30,24,83}
\usepackage[beamer,customcolors]{hf-tikz}
\usepackage{tikz}
\tikzset{hl/.style={
set fill color=black!00,
set border color=red!80!black,
},
}
\usetikzlibrary{patterns,arrows,decorations.pathreplacing}
\usetikzlibrary{shapes.callouts}
\usepackage[english]{babel}
\begin{document}
\begin{frame}{Button Positions}
\begin{tikzpicture}[remember picture, overlay]
\node[shift={(-0.9cm,0.5cm)}]() at (current page.south east){%
\hyperlink{Link6}{\beamerbutton{First link}}};
\end{tikzpicture}
\begin{tikzpicture}[remember picture, overlay]
\node[shift={(-2.7cm,0.5cm)}]() at (current page.south east){%
\hyperlink{Link5}{\beamerbutton{Second link}}};
\end{tikzpicture}
\begin{tikzpicture}[remember picture, overlay]
\node[shift={(-4.8cm,0.5cm)}]() at (current page.south east){%
\hyperlink{Link4}{\beamerbutton{Third link longer name}}};
\end{tikzpicture}
\begin{tikzpicture}[remember picture, overlay]
\node[shift={(-6.4cm,0.5cm)}]() at (current page.south east){%
\hyperlink{Link3}{\beamerbutton{Fourth link}}};
\end{tikzpicture}
\begin{tikzpicture}[remember picture, overlay]
\node[shift={(-7.5cm,0.5cm)}]() at (current page.south east){%
\hyperlink{Link2}{\beamerbutton{Fifth link}}};
\end{tikzpicture}
\begin{tikzpicture}[remember picture, overlay]
\node[shift={(-9.00cm,0.5cm)}]() at (current page.south east){%
\hyperlink{Link1}{\beamerbutton{Sixth link}}};
\end{tikzpicture}
\begin{tikzpicture}[remember picture, overlay]
\node[shift={(-1.35cm,0.95cm)}]() at (current page.south east){%
\hyperlink{Link7}{\beamerbutton{Seventh Link}}};
\end{tikzpicture}
\end{frame}
\end{document}


Link<number>so you add them with\AddButton{<label>}{<number>}If this is not the case, you can use\newcommand{\AddButton}[3][]{% \begin{tikzpicture}[remember picture, overlay] \ifFrameHasButton \node[left=1em of tmpbutton] (tmpbutton) {\hyperlink{#3}{\beamerbutton{#2~link}}}; \else \path ([yshift=1em]current page.south east) node[anchor=south east] (tmpbutton) {\hyperlink{#3}{\beamerbutton{#2~link}}}; \global\FrameHasButtontrue \fi \end{tikzpicture}}. – Mar 04 '20 at 14:55