Retour à tous les modèles

Thème Sombre Beamer

Voir le PDF
Catégorie:Presentations
Licence:Gratuit (MIT)
Résumé:

Présentation Beamer en mode sombre avec diapositives à fort contraste, accents cyan et numéros de diapositive

Étiquettes:PresentationsSlides
Loading preview...

What is this Beamer dark theme?

Beamer ships with dozens of layout themes but almost no dark colour themes, so most "dark mode" decks you see are either metropolis with background=dark or a hand-built palette. This template is the second kind, done carefully: a complete, pdflatex-safe 16:9 presentation built on the familiar Madrid theme with every colour overridden through \setbeamercolor. You get a near-black canvas, light body text, a cyan accent for structure and bullets, an orange secondary accent for \alert, rounded shadow-free blocks, no navigation bar and a custom footline with "frame / total" numbers. It needs no extra fonts or theme packages, so it compiles on any TeX installation.

The deck includes eight example frames: a plain title page, an outline built from \tableofcontents, a bullet slide with \pause overlays and a block, a figure placeholder, a booktabs table with highlighted cells, an equation inside an example block, a two-column comparison and a closing slide. Replace the content and keep the preamble.

How the dark palette is built

Six named colours are defined with xcolor in the HTML model:

\definecolor{bgdark}{HTML}{1E1E24}   % slide background
\definecolor{bgpanel}{HTML}{2B2B33}  % frametitle / block backgrounds
\definecolor{fglight}{HTML}{E6E6E6}  % body text
\definecolor{fgmuted}{HTML}{A0A0A8}  % footline, captions
\definecolor{accent}{HTML}{4FC3F7}   % cyan accent
\definecolor{accent2}{HTML}{FFB74D}  % orange secondary accent

Beamer colours are organised as a tree of inheritance, so two assignments do most of the work. background canvas paints the slide, and normal text sets the default foreground and background that almost every other element inherits. structure is the parent of titles, bullets, enumerations, table-of-contents entries and the default block title, so setting it to the accent colours all of them at once. alerted text and example text cover \alert and the exampleblock environment.

The remaining lines override elements that Madrid colours separately. The frametitle bar gets the panel background; palette primary through palette quaternary are the four tints Madrid uses for its head and foot bars, and title in head/foot, author in head/foot and date in head/foot set the footline text. Block colours are set in pairs, block title and block body, with alerted and example variants; the titles use dark text on the accent so they stay legible. The expression bgpanel!80!accent is an xcolor mix, 80 percent panel and 20 percent accent, which is how to derive tints without defining more colours.

Templates and the footline

\setbeamertemplate{navigation symbols}{} removes the little navigation icons in the bottom right that almost nobody uses. \setbeamertemplate{blocks}[rounded][shadow=false] gives flat rounded blocks (shadows look muddy on dark backgrounds), and [circle] bullets are easier to read than Madrid's default balls. The custom footline is three beamercolorboxes of widths 0.3, 0.5 and 0.2 of the paper width showing \insertshortauthor, \insertshorttitle and \insertframenumber / \inserttotalframenumber. The short forms come from the optional arguments to \title[...] and \author[...], so set both.

Why not just use metropolis?

metropolis is an excellent modern theme and has a built-in dark variant (\metroset{background=dark}). Its catch is typography: it is designed around Fira Sans and Fira Mono, loaded through fontspec, which means XeLaTeX or LuaLaTeX. It does compile under pdflatex, but with warnings and a fallback to the default fonts that loses much of its character, and you must install the Fira fonts on a local machine. This template deliberately uses lmodern and the stock Madrid layout so a dark deck works with the pdflatex toolchain most universities, journals and CI systems already have. If you do use XeLaTeX, you can add \usepackage{fontspec} and \setsansfont{Fira Sans} to this template without touching the palette.

Adapting any theme to dark

The palette block is independent of the layout, so the recipe generalises. Change \usetheme{Madrid} to \usetheme{Berlin}, Frankfurt, CambridgeUS or Boadilla and keep every \setbeamercolor line. Berlin and Frankfurt show section mini-frames in the headline; colour them with \setbeamercolor{section in head/foot}{fg=fglight,bg=bgpanel} and mini frame. Sidebar themes (Berkeley, Goettingen, Hannover) need sidebar, section in sidebar and subsection in sidebar. If an element still shows the theme's original blue, run your PDF through the Beamer user guide's colour list or add \setbeamercolor{structure}{fg=accent} after \usecolortheme calls, since colour themes loaded later override earlier settings.

Readable colours for projectors

  • Avoid pure black and pure white. The canvas is #1E1E24 and text is #E6E6E6; full contrast causes halation on bright projectors and looks harsh on video calls. If you want pure black for a cinema-style room, set bg=black in background canvas.
  • Keep contrast high for body text. Aim for a contrast ratio of 7:1 or more between text and canvas; the shipped pair is about 13:1. Muted text (fgmuted) is fine for footers and captions, not for content.
  • Use saturated, light accents. Light cyan, amber, mint and pink read well on dark; dark blue and dark red disappear. Avoid relying on red versus green alone.
  • Prefer bolder weights. Thin fonts on dark backgrounds smear when projected. The template sets frame titles in \bfseries for this reason.
  • Test on the actual projector. Cheap projectors crush dark greys; if bgpanel blocks vanish, lighten them to #3A3A44.

Charts and images on dark backgrounds

\includegraphics cannot invert or recolour an image, so prepare figures for dark slides at the source. Export plots with a transparent background and light axes, labels and gridlines; in matplotlib use plt.style.use('dark_background') and transparent=True, and in pgfplots set axis line style and tick label colours to fglight. Prefer PDF or SVG-derived PDF over PNG for line art. For screenshots and photos that must keep a white background, drop them in a rounded beamercolorbox like the placeholder in frame four, or add a thin light border with \fbox, so the white rectangle looks intentional. Keep diagrams' line weights a little heavier than you would for a light deck.

Handout mode and other options

  • Handouts. \documentclass[handout,11pt,aspectratio=169]{beamer} collapses every \pause. Add \usepackage{pgfpages} and \pgfpagesuselayout{4 on 1}[a4paper,landscape,border shrink=5mm] for four slides per page, and switch to a light palette inside \mode<handout>{...} to save ink.
  • Aspect ratio. aspectratio=169 matches modern projectors; use 43 for older rooms.
  • Frame numbers. Already in the footline. To hide them on the title slide, the [plain] option removes the footline entirely, as the template does.
  • Section slides. Add \AtBeginSection{\begin{frame}\sectionpage\end{frame}} for a divider before each section.

Common errors and how to fix them

  • "Package xcolor Error: Undefined color `accent'". A \definecolor line was deleted or moved below its first use. Keep all six definitions before the \setbeamercolor block.
  • Frame overflows the slide. Too much content; split the frame, or add [shrink=10] to the frame options as a last resort.
  • Overlays behave oddly in tables or columns. \pause inside tabular is unreliable; use \onslide<2-> on individual cells instead.
  • Total frame count is wrong. \inserttotalframenumber is read from the .aux file; compile twice.
  • Fonts look different after adding Fira. You compiled with pdflatex. Fira via fontspec requires XeLaTeX or LuaLaTeX; with pdflatex use \usepackage[sfdefault]{FiraSans} instead.

How to compile the dark Beamer deck

  1. In Octree: click Open as template to get a live preview of every slide; the assistant can add frames or convert your bullet notes into slides.
  2. In Overleaf: paste into a blank project and compile with pdfLaTeX. Two passes are needed for the outline and the total frame count, which Overleaf does automatically.
  3. Locally:
    pdflatex slides.tex
    pdflatex slides.tex      # second pass for TOC and frame totals
    # or: latexmk -pdf slides.tex

Beamer dark theme vs other presentation templates

TemplateBest forEngineLook
Beamer Dark ThemeTalks in dim rooms, screen recordings, lecturespdflatex, XeLaTeX or LuaLaTeXMadrid layout, dark canvas, cyan and orange accents, 16:9
Beamer PresentationStandard academic talks and seminarspdflatexMadrid theme with its default blue light palette
Research PosterConference poster sessionspdflatextikzposter A0 layout with block-based columns

The light Beamer template and this one share the Madrid layout, so you can move frames between them freely.

Frequently asked questions

Does this Beamer dark theme work with pdflatex?
Yes. The template uses only the Madrid theme, lmodern, xcolor and standard packages, so it compiles with pdflatex, XeLaTeX and LuaLaTeX without any extra fonts. That is the main difference from metropolis, which is designed around the Fira typeface and fontspec and is best compiled with XeLaTeX or LuaLaTeX.
How do I change the accent colour?
Edit the hex value in \definecolor{accent}{HTML}{4FC3F7}. Every element that uses the accent (structure, bullets, block titles, the tertiary palette) updates automatically because they all reference the named colour. The secondary accent used for \alert and alerted blocks is accent2 (orange by default).
How do I make a printable light version of the slides?
Compile a handout. Change the class line to \documentclass[handout,11pt,aspectratio=169]{beamer}, which collapses all \pause overlays, and wrap a light palette in \mode<handout>{ \setbeamercolor{background canvas}{bg=white} \setbeamercolor{normal text}{fg=black,bg=white} } so the handout prints without a dark background. Add pgfpages to put several slides on one page.
Can I apply this dark palette to Berlin, Frankfurt or another theme?
Yes. The colour block is independent of the layout theme. Change \usetheme{Madrid} to \usetheme{Berlin} or \usetheme{Frankfurt} and keep the \setbeamercolor lines; the palette primary to quaternary colours drive the head and foot bars in all of the Madrid-family themes. Themes with a sidebar (Berkeley, Goettingen) additionally need \setbeamercolor{sidebar}{bg=...} and \setbeamercolor{section in sidebar}{fg=...}.
Why do my matplotlib plots look wrong on the dark slides?
The default white figure background and black axes clash with the dark canvas. Export figures with a transparent background and light axes, for example plt.style.use('dark_background') and savefig('fig.pdf', transparent=True) in matplotlib, or set axis line and tick label colours to white in pgfplots. For photos and diagrams you cannot recolour, place them in a light rounded box so the edges are deliberate.
Math poweredÉcrivez en LaTeX avec l'IA

Le Meilleur Éditeur LaTeX IA, Alternative à Overleaf

Octree aide les chercheurs de plus de 15 universités à rédiger leurs articles de recherche plus rapidement grâce à l'IA

  • Générez de beaux diagrammes TikZ avec l'IA
  • Téléchargez une image et convertissez-la en LaTeX facilement
  • Obtenez une assistance instantanée pour rédiger et formater vos articles de recherche