3

I hope this is not too localized...

I need a vertical subsection navigation where the subsection names only consists in numbers (1, 2, 3, etc.) printed in a three columns layout.

I managed to obtain what I need with the following code:

\documentclass{beamer}
\usepackage{multicol}
\usetheme[left,width=1.4cm]{Goettingen}

\makeatletter
\def\insertsubsectionnavigation#1{%
  \hbox to #1{%
    \vbox{{%
      \usebeamerfont{subsection in sidebar}
      \usebeamercolor[fg]{subsection in sidebar}
      \vskip0.5625ex%
      \beamer@currentsubsection=0%
      \def\sectionentry##1##2##3##4##5{}%
      \def\slideentry##1##2##3##4##5##6{\ifnum##6=\c@part\ifnum##1=\c@section%
        \ifnum##2>\beamer@currentsubsection%
        \beamer@currentsubsection=##2%
        \def\insertsubsectionhead{##5}%
        \def\insertsectionheadnumber{##1}%
        \def\insertsubsectionheadnumber{##2}%
        \def\insertpartheadnumber{##6}% 
        \beamer@link(##4){%
              \ifnum\c@subsection=##2%
                {\usebeamertemplate{subsection in sidebar}}%
              \else%
                {\usebeamertemplate{subsection in sidebar shaded}}%
              \fi\hfill}\par
        \fi\fi\fi}%
       \hspace{3pt}\begin{minipage}{1.1cm}\setlength{\parskip}{-3pt}%
       \begin{multicols}{3}
       \dohead
       \end{multicols}
       \end{minipage}
       \space 
   }\hfil 
}}}
\makeatother

\setbeamertemplate{sidebar left}{
\begin{beamercolorbox}[wd=1.4cm]{}
\insertsubsectionnavigation{1.4cm}
\end{beamercolorbox}
}


\begin{document}
\section{1}
 \subsection{1}
 \frame{content}
 \subsection{2}
 \frame{content}
 \subsection{3}
 \frame{content}
 \subsection{4}
 \frame{content}
 \subsection{5}
 \frame{content}
 \subsection{6}
 \frame{content}
 \subsection{7}
 \frame{content}
 \subsection{8}
 \frame{content}
 \subsection{9}
 \frame{content}  
\end{document}

enter image description here

The relevant part is the following snippet:

\hspace{3pt}
\begin{minipage}{1.1cm}
  \setlength{\parskip}{-3pt}%
  \begin{multicols}{3}
     dohead
  \end{multicols}
\end{minipage}

this produces the three columns layout to be called later inside the sidebar template, which is actually more complicated than the one showed in the MWE, but the other parts do not matter here.

The problem

Problem is that with this method I get nine overfull hboxes for each subsection. I.e., you'll get 81 overfull boxes if you compile my MWE.

The question

Is it ok in this case to add \hfuzz=27pt inside the minipage to suppress the badboxes? Or is there a better solution to achieve the same result without having to ignore badboxes?

1 Answer 1

2

I haven't checked in detail what \dohead does but it seems to format the string from each \subsection title into a a vertical box that has the width of the full margin. Thus by using multicols each line within is consisting of boxes that are fare too wide. Now while your titles are as short as in your example, those boxes overlap but do no harm, but you can see the effect if you change this, e.g. do \subsection{3333333333}.

So in summary I would say, adding \hfuzz is a workable kludge, but one has to be aware what is happening in the background and your code is effectively generating such overlaps. In short, \dohead was never meant to be used in inside a column structure that ends up being smaller than the full width.

2
  • thank you for the explanation. the greatest number for a subsection is 99 and atm I'm not skilled enough to get a better three columns vertical subsection layout or, assuming it's worth it, customize the dohead behavior.
    – d-cmst
    Commented Aug 22, 2013 at 14:19
  • @dcmst as I said I think you are fine as long as you don't forget on what basis your kludge is based upon :-) and for a one-off situaton trying to change the internals of \dohead is't advisable either. Commented Aug 22, 2013 at 14:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .