DEV Community

Deuslirio Junior
Deuslirio Junior

Posted on • Edited on

A custom LaTeX Presentation Template

In my university, we frequently need to present our studies. One option is to build our presentation using LaTeX/Beamer presentation templates.

Beamer is very powerful and practical to build presentations, but we needed a template with different style, with many slides layout, which usually is not provided by the default templates.

For example, the following image is a default template of beamer, in this template, the slides have this same layout (except for the title page).
Default template of beamer

So, with the help of some friends we built a custom LaTeX presentation template to help students, professors, or researchers to prepare their presentation slides in the format 16:9. Besides presenting a modern design concept, the template provides different slides’ layouts and color schemas to personalize the presentation.
custom color schema

How to use

After downloading or cloning this repository, you must edit the file presentation.tex to fill the content of the presentation. Firstly, take a look at the "Primary Definitions" part, at the begin of such a .tex, and modify its parties, whether is needed. if you compile the code without changing, it will look like this.

To set the default color of the presentation, you can use the command \setPrimaryColor{color}. This command supports one of the colors defined by the template or any color defined by the user.



\setPrimaryColor{UFGBlue} 


Enter fullscreen mode Exit fullscreen mode

To set the logo of the department or institute, from the authors take part, you must use the command \setLogos{path/horizontal_logo}{path/squared_logo} to inform the paths of two files. The first one is the logo in title slide - we recommend using a horizontal image - and the second one is the logo used in the remaining slides - we recommend using a square image.



\setLogos{lib/logos/infw.png}{lib/logos/infw2.png} 


Enter fullscreen mode Exit fullscreen mode

To define a layout for a slide, you must use the command \setLayout{layoutname}, just informing the name of the layout you would like to use. This command must be placed before the command \begin{frame} of the slide you would like to change.



\setLayout{horizontal} 
\begin{frame}
  \frametitle{Table of Contents}
  \tableofcontents
\end{frame}


Enter fullscreen mode Exit fullscreen mode

To define a color for the background of a slide, you must use the command \setBGColor{color} informing a color. This command must be placed before the command \begin{frame} of the slide you would like to change. The color may be one of the template’s colors or a personalized color defined by the user.



\setBGColor{DarkOrange}
\begin{frame}
\frametitle{Pause Example}

<span class="nt">\begin{itemize}</span>
    <span class="k">\item</span> In this slide <span class="k">\pause</span>
    <span class="k">\item</span> the text will be partially visible <span class="k">\pause</span>
    <span class="k">\item</span> And finally everything will be there
<span class="nt">\end{itemize}</span>
Enter fullscreen mode Exit fullscreen mode

\end{frame}

Enter fullscreen mode Exit fullscreen mode


\definecolor{MyColor}{RGB}{10, 115, 110}
\setBGColor{MyColor}
\begin{frame}
% ...
\end{frame}

Enter fullscreen mode Exit fullscreen mode




Template's Layouts

At this momment, UFGTeXPresentation has five option for slides' layout: titlepage, vertical, horizontal, mainpoint, and blank. You can see each layout appearance at the following figure:

Template example

Summary of the Template's commands

Template Commands Number of Params Type of Params Example
setLayout 1 Layout \setLayout{vertical}
setBGColor 1 Color \setBGColor{DarkPurple}
setPrimaryColor 1 Color \setPrimaryColor{UFGBlue}
setLogos 2 Image URL \setLogos{lib/logos/infw.png}{lib/logos/infw2.png}

Overleaf

Overleaf is a platform to share and coedit LaTeX projects.
This template can be easily used and modified directly in the Overleaf

Top comments (6)

Collapse
 
sirneij profile image
John Owolabi Idogun

\textbf doesn't work in the template. How do I bold some texts?

Collapse
 
deuslirio profile image
Deuslirio Junior

Hi, I have not faced this problem. Can you detail your case?
I suppose that in your case the style is overwritten in beamerthemeUfg.sty
but I can not simulate this behavior yet.

Collapse
 
sirneij profile image
John Owolabi Idogun

I want to have some bold fonts for some normal texts on my slides but couldn't achieve that. What I tried doing was wrapping the texts in \textbf{} command since this boldens texts in normal LaTeX but nothing happened. The texts remained unbold.

Thread Thread
 
deuslirio profile image
Deuslirio Junior • Edited

This is intriguing, I can't reproduce it.
Are you using pdfLaTeX as compiler?
If you keep this problem a suggest you to use Overleaf overleaf.com/latex/templates/ufgte...

Check this, I'm using it directly in Overleaf and it is working nicely:


\setLayout{horizontal}
\begin{frame}
    \frametitle{Sample frame title}
    This is a text in second frame. For the sake of showing an example.

    \begin{itemize}
        \item<1-> \textbf{Text }visible on slide 1
        \item<2-> Text visible on slide 2
        \begin{itemize}
            \item text sub\textbf{item}
        \end{itemize}
    \end{itemize}
\end{frame}
Enter fullscreen mode Exit fullscreen mode

bold_text_ufg_tex

Thread Thread
 
sirneij profile image
John Owolabi Idogun

I'm compiling it with XeLaTeX on my ubuntu-based system, Pop!_OS, because it is required I use the Times New Roman font. I will certainly test it out on Overleaf.

Thread Thread
 
deuslirio profile image
Deuslirio Junior • Edited

Ah, ok.
Using pdfLatex, try to use \usepackage{newtxtext,newtxmath} below \usetheme in tex file

\usetheme{Ufg}
\usepackage{newtxtext,newtxmath}
Enter fullscreen mode Exit fullscreen mode

To change the font of titles, comment line 11 in sty file

\mode<presentation>
% \usefonttheme[onlymath]{serif}
Enter fullscreen mode Exit fullscreen mode

result:
times bold text