1

I have a student with poor eyesight who needs enlarged lecture slides in order to read them. Previously, the student had done this manually but I figured that it may be possible to get satisfactory results for latex-generated slides by changing only the preamble. I got most of the text to be adjust okay, but there are four points where I could use help:

  1. I was not able to reduce \topsep and \itemsep of itemize and enumerate environment. I tried this method, but it did not seam to work; see below.
  2. Sometimes the text just extends into the margin. I am aware that this is a consequence of me requiring the itemization to be justified, but I believe it should be possible to have justified text as well as text that does not extend into margin, perhaps using penalties? I perused this list of penalties, but could not find one that seemed relevant.
  3. Formulas often extend past the frame width. If formulas are particularly short, I often combine them horizontally as below to save space. The breqn package does not appear to help.
  4. Is it possible to scale all tikzpictures and all includegraphics automatically by a set factor? Note that they may already be scaled for the regular version of the slides.

I am using the beautiful metropolis theme for my regular slides if that is relevant. I am aware that the \let\raggedright\justifying is an extremely hacky way to get everything justified in beamer. But with the 10pt beamer options it works great and it just looks better.

\documentclass[14pt, handout]{beamer}
\usepackage{ragged2e, tikz, graphicx, breqn}
\usetheme[outer/progressbar=foot]{metropolis}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  Relevant line in regular preamble
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\let\raggedright\justifying

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%        Changes for Visibility
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Maximize contrast
\setbeamercolor{normal text}{fg=black, bg=white}
\setbeamercolor{structure}{fg=black, bg=white}
\setbeamercolor{frametitle}{fg=black, bg=white}

% Reducing white space
\setbeamersize{text margin left=4mm,text margin right=4mm}
\let\bigskip\smallskip
\let\medskip\smallskip
\setbeamerfont{frametitle}{size=\normalsize}
\setbeamerfont{footnote}{size=\normalsize}
\setbeamertemplate{frametitle}
{
    \vspace{0.4mm}
    \begin{beamercolorbox}{frametitle}
        \insertframetitle
    \end{beamercolorbox}
    \vspace{-3.2mm}
    \hrulefill
    \vspace{-1mm}
}

% Change spacing of itemize environment
\setlength{\leftmargini}{1.2em}
\setlength{\leftmarginii}{1.2em}
\setlength{\labelsep}{0.2em}
\setbeamertemplate{itemize items}{\hspace{-2pt}$\bullet$\hspace{2pt}}
\makeatletter
\patchcmd{\@listi}{\itemsep3\p@}{\itemsep-2cm}{}{}
\patchcmd{\@listi}{\topsep3\p@}{\topsep-3mm}{}{}
\patchcmd{\@listii}{\itemsep\parsep}{\itemsep-1mm}{}{}
\patchcmd{\@listii}{\topsep2\p@}{\topsep-3mm}{}{}
\makeatother

% Breaking slides
\setbeamertemplate{frametitle continuation}[from second][]
\newcounter{cont}
\newcounter{numframes}
\setcounter{cont}{0}
\makeatletter
\setbeamertemplate{footline}{%
    \addtocounter{cont}{1}
    \setcounter{numframes}{\beamer@endpageofframe}
    \addtocounter{numframes}{1}
    \addtocounter{numframes}{-\beamer@startpageofframe}
    \ifnum\value{numframes}>1
        \ifnum\value{cont}>1
            \addtocounter{framenumber}{-1}
        \fi
        \ifnum\value{cont}=\value{numframes}
            \setcounter{cont}{0}
        \fi
    \else
        \setcounter{cont}{0}
    \fi
    \hfill\normalsize\insertframenumber\hspace{3.5mm}\vspace{4mm}%
}
\makeatother

\begin{document}
\maketitle
\setcounter{beamerpauses}{1}\setcounter{framenumber}{0}

\begin{frame}[allowframebreaks=1]
\frametitle{Lorem Ipsum}

\textbf{Lorem ipsum:}
\begin{itemize}
\item Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do.
\item Eiusmod tempor incididunt ut labore et dolore magna aliqua.
\end{itemize}
\bigskip

\textbf{Dolor sit amet:}
\begin{itemize}
\item Ut enim ad minim veniam, quis nostrud exercitation?
\item Ullamco laboris nisi ut aliquip ex ea commodo consequat?
\item Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.\footnote{Technically, we should say ``Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.''}
\end{itemize}
\end{frame}


\begin{frame}
\frametitle{Dolor Sit Amet}

\begin{minipage}{0.5\textwidth}
\centering
\includegraphics[scale=0.3]{yellow-arrow}
\end{minipage}%
\begin{minipage}{0.5\textwidth}
\centering
\begin{tikzpicture}[scale=0.6]
\fill (0, 0) rectangle (6, 5);
\end{tikzpicture}
\end{minipage}%

\textbf{Some long formula:}
\[ x_1 + x_2 + x_3 + x_4 = y_1 + y_2 + y_3 + y_4, \qquad 2x_1 + x_2 - x_3 + x_4 = y_3 - 3y_1 - 2y_2. \]

\textbf{Some reference:}
\begin{itemize}
\item \emph{Title of really important paper} by X.~Author and Y.~Samuelson, 2019
\end{itemize}
\end{frame}

\end{document} 

PS: I was not sure where to attach an image for the MWE. Any image will do, but it would be desirable if auto-scaling works for images as well as tikzpictures.

3
  • Justification mean more spacing, hyphens a Overfull \hbox. When neither one thing nor the other is possible, as ending with Y.~Samuelson, is the third. As you suspect, play with \hyphenpenalty or microtype could help with som overfull \hbox, but at the end of day, working with large fonts, soon or later you will face \hbox too wide where the solution is the manual fixing (like Y.~Sa\-muelsonor \linebreak Y.~Samuelson) o desist of the justification (not at all a bad idea for short items with big fonts, IMHO).
    – Fran
    Nov 11, 2020 at 9:40
  • Thank you. The microtype package helps to some extent with the Overfull \hbox errors so that the text at least remains on the slide. Is there a way to tell pdfTex (or TexMaker, which I use) globally that it is okay to break Sa\-muelson in this fashion? I would much rather have the main body of the two versions be completely identical and insert the words in question to some additional "linebreaking list". Nov 12, 2020 at 5:40
  • Note that ``\-` is a soft hyphen, i.e., Sa\-mu\-el\-son will print only one hyphen and only if LaTeX break the word., so it will work well in any version. But a global fix have sense to maintain the source more readable and fix the problem faster when the word appears several times. Then is just faster use \hyphenation{Sa-muel-son, su-per-cali-fragi-listicus} (now with hard hyphens) in the preamble.
    – Fran
    Nov 12, 2020 at 8:00

0

You must log in to answer this question.

Browse other questions tagged .