TransWikia.com

Automatically enlarging slides for easier readability

TeX - LaTeX Asked by S. Olafsson on December 1, 2020

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 letraggedrightjustifying 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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

letraggedrightjustifying

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%        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}
letbigskipsmallskip
letmedskipsmallskip
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}{itemsep3p@}{itemsep-2cm}{}{}
patchcmd{@listi}{topsep3p@}{topsep-3mm}{}{}
patchcmd{@listii}{itemsepparsep}{itemsep-1mm}{}{}
patchcmd{@listii}{topsep2p@}{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}
    ifnumvalue{numframes}>1
        ifnumvalue{cont}>1
            addtocounter{framenumber}{-1}
        fi
        ifnumvalue{cont}=value{numframes}
            setcounter{cont}{0}
        fi
    else
        setcounter{cont}{0}
    fi
    hfillnormalsizeinsertframenumberhspace{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.5textwidth}
centering
includegraphics[scale=0.3]{yellow-arrow}
end{minipage}%
begin{minipage}{0.5textwidth}
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.

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP