or
Seb123 imported from SE
beamer
I am inserting the list of section names in the footer using:

```
\vskip2pt\insertnavigation{\paperwidth}\vskip-2pt
```
The complete code for the footer (using the metropolis theme) is
```
\makeatletter
\setbeamertemplate{footline}{%
  \begin{beamercolorbox}[wd=\textwidth, sep=3ex]{footline}%
    \usebeamerfont{page number in head/foot}%
    \usebeamertemplate*{frame footer}
    \hfill%
    \usebeamertemplate*{frame numbering}
  \end{beamercolorbox}%

  \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
  \end{beamercolorbox}
  \begin{beamercolorbox}{section in head/foot}
    \vskip2pt\insertnavigation{\paperwidth}\vskip-2pt
  \end{beamercolorbox}%
  \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
  \end{beamercolorbox}
}
\makeatother
```

However I have too many sections and it escapes the end of the footer. See picture of slide:

[![enter image description here][1]][1]

To fix this I would like to move the navigation to the left as the current section increases. Something like:

```
\vskip-{\sectionnumber}pt\insertnavigation{\paperwidth}\vskip-2pt
```
where `\sectionnumber` is the number of the current section (made up the command).

  [1]: https://i.stack.imgur.com/yvKTR.png
Top Answer
samcarter
The problem with moving the content by a fixed amount of space for each section is that this does not take into acocunt different lenghts of section names.

However using a similar approach as in https://topanswers.xyz/tex?q=415#a418 you can show only a fixed number of sections in the navigation bar, e.g. the current section +-2 other sections.


```
\documentclass{beamer}

\usetheme{metropolis}

\setbeamercolor{section in head/foot}{bg=structure.fg,fg=white}

\makeatletter
\setbeamertemplate{footline}{%
  \begin{beamercolorbox}[wd=\textwidth, sep=3ex]{footline}%
    \usebeamerfont{page number in head/foot}%
    \usebeamertemplate*{frame footer}
    \hfill%
    \usebeamertemplate*{frame numbering}
  \end{beamercolorbox}%

  \begin{beamercolorbox}[colsep=1.5pt]{upper separation line head}
  \end{beamercolorbox}
  \begin{beamercolorbox}{section in head/foot}
    \vskip2pt\insertnavigation{\paperwidth}\vskip2pt
  \end{beamercolorbox}%
  \begin{beamercolorbox}[colsep=1.5pt]{lower separation line head}
  \end{beamercolorbox}
}

% based on the original definitions in beamerbasenavigation.sty
\def\sectionentry#1#2#3#4#5{% section number, section title, page
%
\newcount\mymin%
\mymin=3
\ifnum\c@section=1%
    \mymin=5
\fi%
\ifnum\c@section=2%
    \mymin=4
\fi%
%
\newcount\mymax%
\mymax=3
\ifnum\c@section=\beamer@sectionmax%
    \mymax=5
\fi%
\ifnum\c@section=\numexpr\beamer@sectionmax-1%
    \mymax=4
\fi%
%
    \ifnum\numexpr\c@section-#1<\mymax%
        \ifnum\numexpr#1-\c@section<\mymin%
            \ifnum#5=\c@part%
                \beamer@section@set@min@width
                \box\beamer@sectionbox\hskip1.875ex plus 1fill%
                \beamer@xpos=0\relax%
                \beamer@ypos=1\relax%
                \setbox\beamer@sectionbox=
                \hbox{
                    \def\insertsectionhead{#2}%
                    \def\insertsectionheadnumber{#1}%
                    \def\insertpartheadnumber{#5}%

                    {%
                        \usebeamerfont{section in head/foot}\usebeamercolor[fg]{section in head/foot}%
                        \ifnum\c@section=#1%
                            \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot}}}%
                        \else%
                            \hyperlink{Navigation#3}{{\usebeamertemplate{section in head/foot shaded}}}%
                        \fi%    
                    }%
                }%
                \ht\beamer@sectionbox=1.875ex%
                \dp\beamer@sectionbox=0.75ex%
            \fi%
        \fi%
    \fi%
    \ignorespaces%
}

\def\slideentry#1#2#3#4#5#6{%
    %section number, subsection number, slide number, first/last frame, page number, part number
    %
    \newcount\mymin%
    \mymin=3
    \ifnum\c@section=1%
        \mymin=5
    \fi%
    \ifnum\c@section=2%
        \mymin=4
    \fi%
        %
    \newcount\mymax%
    \mymax=3
    \ifnum\c@section=\beamer@sectionmax%
        \mymax=5
    \fi%
    \ifnum\c@section=\numexpr\beamer@sectionmax-1%
        \mymax=4
    \fi%
    %
    \ifnum\numexpr\c@section-#1<\mymax%
        \ifnum\numexpr#1-\c@section<\mymin%
          \ifnum#6=\c@part\ifnum#2>0\ifnum#3>0%
            \ifbeamer@compress%
              \advance\beamer@xpos by1\relax%
            \else%
              \beamer@xpos=#3\relax%
              \beamer@ypos=#2\relax%
            \fi%
          \hbox to 0pt{%
            \beamer@tempdim=-\beamer@vboxoffset%
            \advance\beamer@tempdim by-\beamer@boxsize%
            \multiply\beamer@tempdim by\beamer@ypos%
            \advance\beamer@tempdim by -.05cm%
            \raise\beamer@tempdim\hbox{%
              \beamer@tempdim=\beamer@boxsize%
              \multiply\beamer@tempdim by\beamer@xpos%
              \advance\beamer@tempdim by -\beamer@boxsize%
              \advance\beamer@tempdim by 1pt%
              \kern\beamer@tempdim
              \global\beamer@section@min@dim\beamer@tempdim
              \hbox{\beamer@link(#4){%
                  \usebeamerfont{mini frame}%
                  \ifnum\c@section=#1%
                    \ifnum\c@subsection=#2%
                      \usebeamercolor[fg]{mini frame}%
                      \ifnum\c@subsectionslide=#3%
                        \usebeamertemplate{mini frame}%\beamer@minislidehilight%
                      \else%
                        \usebeamertemplate{mini frame in current subsection}%\beamer@minisliderowhilight%
                      \fi%
                    \else%
                      \usebeamercolor{mini frame}%
                      %\color{fg!50!bg}%
                      \usebeamertemplate{mini frame in other subsection}%\beamer@minislide%
                    \fi%
                  \else%
                    \usebeamercolor{mini frame}%
                    %\color{fg!50!bg}%
                    \usebeamertemplate{mini frame in other subsection}%\beamer@minislide%
                  \fi%
                }}}\hskip-10cm plus 1fil%
          }\fi\fi%
          \else%
          \fakeslideentry{#1}{#2}{#3}{#4}{#5}{#6}%
         \fi%
        \fi%
    \fi%
    \ignorespaces%
}
\makeatother

\begin{document}
	
\section{section 1}
\begin{frame}
	abc
\end{frame}	
	
\section{section 2}
\begin{frame}
	abc
\end{frame}	

\section{section 3}
\begin{frame}
	abc
\end{frame}	

\section{section 4}
\begin{frame}
	abc
\end{frame}	

\section{section 5}
\begin{frame}
	abc
\end{frame}	

\section{section 6}
\begin{frame}
	abc
\end{frame}	

\section{section 7}
\begin{frame}
	abc
\end{frame}	

\section{section 8}
\begin{frame}
	abc
\end{frame}	

\section{section 9}
\begin{frame}
	abc
\end{frame}	
	
	
\end{document}
```

![Screen Shot 2019-12-11 at 17.08.07.png](/image?hash=b37ac84da4b508661b67ee0cbbbc3d233d2a50a3fdede184b7b3ffcc8c42e4d6)

(I would prefer if this answer would **not** be copied to tex.se)
Move \insertnavigation to the left in later sections in beamer footer
Jack Douglas
https://topanswers.xyz/meta?q=24
Jack Douglas replying to Skillmon
yes it is a complex issue and hard to label concisely and precisely. The '+' means 'in addition to' (i.e. dual licensed) rather than 'as an exception' but I can't think of a way of saying that that doesn't take up more space. I think the actual meta post that the "LPPL for original code" link takes you to makes it more clear…
Skillmon replying to Jack Douglas
ok, thanks for clarifying my misconception. I thought it was meant that code is licensed under LPPL and the rest is licensed under CC BY-SA (the heading above the answer suggests this by stating "CC BY-SA 4.0 + LPPL for original code").
Jack Douglas replying to samcarter
If you really just mean your code, the LPPL already covers commercial reuse for just that — CC BY-SA-NC would only affect sites like SE that want to republish your entire answer. You are probably right anyway though it will work work either way…
samcarter replying to Jack Douglas
Thanks for the suggestion about the other license! I don't mind commercial companies in general reusing my code, e.g. Typesetting services should definitly be able to use my code.  The addendum to my answer was a reaction to https://topanswers.xyz/tex?q=393#question and while I know that the license I choose allows others to repost it, I think can polity ask them not to do this on tex.se
Jack Douglas replying to Skillmon
CC BY-SA applies to the entire post — SE can republish under that license. LPPL is an *additional* license covering just original code which is more about how other people can use it in real life, rather than about who can publish it.
Jack Douglas
@samcarter re "I would prefer if this answer would not be copied to tex.se" have you considered licensing your content under CC BY-SA-NC instead? Stack Exchange is a commercial company and would not be able to republish your content under that license.
Skillmon replying to samcarter
but I'm no legal expert and especially license stuff is hard to understand for me, so this assumption might be false.
samcarter replying to Skillmon
Good :)
Skillmon
I'm not sure if it were legal to copy it to tex.se, as I don't know whether the CC BY-SA is compatible with LPPL (which applies to your code).