diff options
author | Minijackson <minijackson@riseup.net> | 2021-11-04 09:31:40 +0100 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2021-11-04 09:31:40 +0100 |
commit | 77a3ffb7c02b6f21473ab7dd99a0ce7e66bb6645 (patch) | |
tree | b1204300ba732aecd68bc4b8679a9cc64b814287 /beamer/template.latex | |
parent | 7784b511e0d40964f9867dcbb209841d8de20815 (diff) | |
download | pandoc-nix-templates-77a3ffb7c02b6f21473ab7dd99a0ce7e66bb6645.tar.gz pandoc-nix-templates-77a3ffb7c02b6f21473ab7dd99a0ce7e66bb6645.zip |
beamer: code listings improvements
Diffstat (limited to 'beamer/template.latex')
-rw-r--r-- | beamer/template.latex | 62 |
1 files changed, 53 insertions, 9 deletions
diff --git a/beamer/template.latex b/beamer/template.latex index 09960e9..2b8db35 100644 --- a/beamer/template.latex +++ b/beamer/template.latex | |||
@@ -326,6 +326,8 @@ $if(pagestyle)$ | |||
326 | \pagestyle{$pagestyle$} | 326 | \pagestyle{$pagestyle$} |
327 | $endif$ | 327 | $endif$ |
328 | 328 | ||
329 | $if(beamer)$ | ||
330 | % Make toc brighter | ||
329 | \setbeamercolor{section in toc}{ | 331 | \setbeamercolor{section in toc}{ |
330 | use=normal text, | 332 | use=normal text, |
331 | fg=normal text.fg | 333 | fg=normal text.fg |
@@ -334,12 +336,40 @@ $endif$ | |||
334 | use=normal text, | 336 | use=normal text, |
335 | fg=normal text.fg | 337 | fg=normal text.fg |
336 | } | 338 | } |
339 | % Add background to blocks | ||
340 | \setbeamercolor*{block title}{ | ||
341 | bg=normal text.bg!80!normal text.fg, | ||
342 | } | ||
343 | \setbeamercolor*{block body}{ | ||
344 | bg=normal text.bg!90!normal text.fg, | ||
345 | } | ||
346 | $else$ | ||
347 | \definecolor{normal text.fg}{named}{black} | ||
348 | \definecolor{normal text.bg}{named}{white} | ||
349 | % From Owl | ||
350 | \definecolor{OwlRed}{RGB}{ 255, 92, 168} | ||
351 | \definecolor{OwlGreen}{RGB}{ 90, 168, 0} | ||
352 | \definecolor{OwlBlue}{RGB}{ 0, 152, 233} | ||
353 | \definecolor{OwlYellow}{RGB}{ 242, 147, 24} | ||
354 | \colorlet{OwlViolet}{OwlRed!50!OwlBlue} | ||
355 | \colorlet{OwlBrown}{OwlRed!50!OwlGreen} | ||
356 | \colorlet{OwlOrange}{OwlRed!50!OwlYellow} | ||
357 | \colorlet{OwlCyan}{OwlGreen!50!OwlBlue} | ||
358 | \colorlet{red}{OwlRed} | ||
359 | \colorlet{green}{OwlGreen} | ||
360 | \colorlet{blue}{OwlBlue} | ||
361 | \colorlet{yellow}{OwlYellow} | ||
362 | \colorlet{violet}{OwlViolet} | ||
363 | \colorlet{brown}{OwlBrown} | ||
364 | \colorlet{orange}{OwlOrange} | ||
365 | \colorlet{cyan}{OwlCyan} | ||
366 | $endif$ | ||
337 | 367 | ||
338 | \usepackage{fvextra} | 368 | \usepackage{fvextra} |
339 | 369 | ||
340 | \usepackage[outputdir=build]{minted} | 370 | \usepackage[outputdir=build]{minted} |
341 | \usemintedstyle{$if(mintedstyle)$$mintedstyle$$else$inkpot$endif$} | 371 | \usemintedstyle{$if(minted.style)$$minted.style$$else$$if(beamer)$inkpot$else$perldoc$endif$$endif$} |
342 | \setminted{bgcolor=normal text.bg!90!normal text.fg,tabsize=4,breaklines} | 372 | \setminted{tabsize=4,breaklines,numbersep=3mm,linenos,highlightcolor=violet!40!normal text.bg} |
343 | 373 | ||
344 | \setmonofont{Fira Code}[ | 374 | \setmonofont{Fira Code}[ |
345 | Scale=0.87096774193548387, % 459/527 | 375 | Scale=0.87096774193548387, % 459/527 |
@@ -348,14 +378,28 @@ $endif$ | |||
348 | StylisticSet={6,8}, | 378 | StylisticSet={6,8}, |
349 | ] | 379 | ] |
350 | 380 | ||
351 | % Add background to blocks | 381 | \usepackage{tcolorbox} |
352 | \setbeamercolor*{block title}{ | 382 | \tcbuselibrary{skins,breakable} |
353 | bg=normal text.bg!80!normal text.fg, | ||
354 | } | ||
355 | 383 | ||
356 | \setbeamercolor*{block body}{ | 384 | \renewcommand{\theFancyVerbLine}{\ttfamily\scriptsize\textcolor{normal text.fg!60!normal text.bg}{\arabic{FancyVerbLine}}} |
357 | bg=normal text.bg!90!normal text.fg, | 385 | |
358 | } | 386 | \BeforeBeginEnvironment{minted}{\begin{tcolorbox}[ |
387 | breakable, | ||
388 | tile, | ||
389 | enhanced, | ||
390 | left=6mm, | ||
391 | colbacktitle=normal text.bg!80!normal text.fg, | ||
392 | coltitle=normal text.fg, | ||
393 | coltext=normal text.fg, | ||
394 | fonttitle=\ttfamily\bfseries, | ||
395 | colback=normal text.bg!90!normal text.fg, | ||
396 | overlay={ | ||
397 | \begin{tcbclipinterior} | ||
398 | \fill[normal text.bg!85!normal text.fg] (frame.south west) rectangle ([xshift=5mm]frame.north west); | ||
399 | \end{tcbclipinterior} | ||
400 | } | ||
401 | ]} | ||
402 | \AfterEndEnvironment{minted}{\end{tcolorbox}} | ||
359 | 403 | ||
360 | \makeatletter | 404 | \makeatletter |
361 | \def\verbatim@nolig@list{} | 405 | \def\verbatim@nolig@list{} |