Yearly Archives: 2020


Git: Remove or Delete file from Git repository

To remove a file from the Git repository but not delete it from your filesystem, execute the following:

git rm --cached file_to_keep.txt;
git commit -m "Removing file_to_keep.txt from Repository";

To remove a file from the Git repository and the filesystem, use the following:

git rm file_to_delete.txt;
git commit -m "Removing and Deleting file_to_delete.txt";

Latex/Beamer: Undefined control sequence. …meroption{show notes on second screen=right}

When trying to enable the option that shows presentation notes on a different monitor using:

\setbeameroption{show notes on second screen=right}

we got the following error:

Undefined control sequence. …meroption{show notes on second screen=right}
Missing \begin{document}. …meroption{show notes on second screen=right}

To fix this issue we enabled the package pgfpages

\usepackage{pgfpages}

To present this special built PDF presentation across two screens we used dspdfviewer.

dspdfviewer is a pre-rendering and caching (read: fast) full-screen pdf viewer specifically designed for latex-beamer presentations, that were created with the show notes on second screen=right option (\setbeameroption{show notes on second screen=right}).

https://dspdfviewer.danny-edel.de/
http://manpages.ubuntu.com/manpages/focal/man1/dspdfviewer.1.html

Special note: when we were testing dspdfviewer on Ubuntu 20.04LTS we thought that the secondary screen had to be on the left of the primary (because of the build command that specifies that notes need to be on the right). That was actually wrong, as you will see in the following picture even though we built the presentation to have the notes on the “right” dspdfviewer was able to work as expected even when the secondary screen was on top of the primary.


Latex / Beamer: Change footline for Boadilla theme

Having a presentation title that was too long, we wanted to change the middle part of the footline on the Boadilla theme to replace the command for the document title (\insertshorttitle) with the command for document subtitle (\insertshortsubtitle).

To do so, we added the following right before the \begin{document} command.

\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
    \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
      \usebeamerfont{author in head/foot}\insertshortauthor\expandafter\ifblank\expandafter{\beamer@shortinstitute}{}{~(\insertshortinstitute)}
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
      \usebeamerfont{title in head/foot}\insertshortsubtitle%\insertshorttitle
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
      \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
      \usebeamertemplate{page number in head/foot}\hspace*{2ex} 
    \end{beamercolorbox}
  }%
  \vskip0pt%
}

When compiling the PDF, the result was as expected but we were getting a lot of errors for Undefined Control Sequence in various objects like the \begin{document} and \end{frame} commands. After modifying the following line (for the author name and institution) from this:

\usebeamerfont{author in head/foot}\insertshortauthor\expandafter\ifblank\expandafter{\beamer@shortinstitute}{}{~~(\insertshortinstitute)}

to this:

\usebeamerfont{author in head/foot}\insertshortauthor~~(\insertshortinstitute)

The errors were gone and the results were again the same. The final block that was properly working with no additional errors is the following:

\setbeamertemplate{footline}
{
  \leavevmode%
  \hbox{%
    \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{author in head/foot}%
      \usebeamerfont{author in head/foot}\insertshortauthor~~(\insertshortinstitute)
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,center]{title in head/foot}%
      \usebeamerfont{title in head/foot}\insertshortsubtitle
    \end{beamercolorbox}%
    \begin{beamercolorbox}[wd=.333333\paperwidth,ht=2.25ex,dp=1ex,right]{date in head/foot}%
      \usebeamerfont{date in head/foot}\insertshortdate{}\hspace*{2em}
      \usebeamertemplate{page number in head/foot}\hspace*{2ex} 
    \end{beamercolorbox}
  }%
  \vskip0pt%
}