HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

LaTeX code for presentation slides

Submitted by: @import:stackexchange-codereview··
0
Viewed 0 times
presentationslideslatexforcode

Problem

I'm giving a presentation in a few days. I'm preparing my material in LaTeX; however, I am relatively new to it. How can I make my LaTeX code more concise and less repetitive?

Here is a reduced version of my presentation, which contains the following features that I'm seeking to improve and tighten up:

  • Code samples using minted, with lots of embedded escapes for use of tikzmark (and later on for hyperlinks to Web-based documentation).



  • Some diagrams using tikz.



  • Callouts with arrows and nodes, using tikz and tikzmark



  • Note that said arrows point to the middle of the character, not the baseline. That's what all the shifts are for.



  • Some callouts have multiple arrows emanating from them.



  • Most callouts have an anchor of west, although in this sample very few of them do.



  • Occasionally, there's also text on the arrow itself.



  • Callouts may have text that extends to more than one line.



  • Columns, a little bit.



The code (with representative slides) follows, as does the output. The vast majority of the slides (which are available on GitHub if you're so inclined) most closely resemble the third example here.

I also wouldn't mind any suggestions for LaTeX packages or the actual content of the presentation, even though they're not the purpose of this question.

`\documentclass[glossy]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{minted}
\usepackage{tikz}
\usepackage{lmodern}
\usepackage[T1]{fontenc}

\useoutertheme{wuerzburg}
\useinnertheme[realshadow,corners=2pt,padding=2pt]{chamfered}
\usecolortheme{shark}

\setbeamertemplate{navigation symbols}{}

\usetikzlibrary{tikzmark, arrows, decorations, decorations.pathreplacing}
\newminted{cpp}{autogobble, fontsize=\tiny, escapeinside=@@}
\newmintinline{cpp}{}
\usemintedstyle{vs}

\tikzset{every picture/.style={font issue=\scriptsize},
font issue/.style={execute at begin picture={#1\selectfont}}
}

\title{C++ Boot Camp 1/2}
\author{Jesse Talavera-Gree

Solution

In my opinion, the code is reasonably clear. I would recomment couple changes to make it better:

-
Externalize the C++ code; make it a separate file and load it from file using \inputminted. See the package documentation for details.

-
Mark the ends of frames, it easies the navigation in the source code. I use this in my code:

...
\end{frame}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
...


-
You are inconsistent with indentation: Sometimes it's 4 spaces or a tab, sometimes 2 spaces; sometimes you indent the corresponding \end differently and sometimes you do not.

-
You are repeating [fill=#1, ultra thick, rounded corners] several times; it could use a TikZ style.

-
I would avoid \today; put the date of the talk/seminar in \date.

-
Do you ever use your \cppref? If not, do you need it?

-
Add comments to everything that deserves them, especially in the preamble. Group related parts of preamble. Do not load hyperref (beamer does that for you). I would change the preamble to this:

\documentclass[glossy]{beamer}

% FONTS ETC.
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}

% BEAMER APPEARANCE
\useoutertheme{wuerzburg}
\useinnertheme[realshadow,corners=2pt,padding=2pt]{chamfered}
\usecolortheme{shark}

\setbeamertemplate{navigation symbols}{}

% TIKZ
\usepackage{tikz}
\usetikzlibrary{tikzmark, arrows, decorations, decorations.pathreplacing}
\tikzset{every picture/.style={font issue=\scriptsize},
font issue/.style={execute at begin picture={#1\selectfont}}
}

% MINTED
\usepackage{minted}
\newminted{cpp}{autogobble, fontsize=\tiny, escapeinside=@@}
\newmintinline{cpp}{}
\usemintedstyle{vs}

% METADATA
\title{C++ Boot Camp 1/2}
\author{Jesse Talavera-Greenberg}
\date{5th February 2016}

% USER MACROS
\newcommand{\cppref}[2]{\href{http://en.cppreference.com/w/cpp/#1}{\underline{#2}}}

% BEGIN DOCUMENT
\begin{document}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{frame}
....

Context

StackExchange Code Review Q#118175, answer score: 6

Revisions (0)

No revisions yet.