3

I want to show a thick line on the left and right borders, i found the similar quetion here Right border but just for right border, here is my MWE:

\documentclass{beamer}
\usetheme[secheader]{Madrid}
\author{diabonas}
\title{Frame border}
\setbeamertemplate{background canvas}{%
{\color{black}\hspace*{\dimexpr\paperwidth-3pt\relax}\rule{10pt}{\paperheight}}%    
}
\begin{document}
\begin{frame}
content
\end{frame}
\frame{Content}
\begin{frame}
content
\end{frame}
\end{document}

I want slides to look like this enter image description here

2 Answers2

5
\documentclass{beamer}
% Based on: https://tex.stackexchange.com/questions/48800
\author{diabonas}
\title{Frame border}
\usepackage{tikz}
\begin{document}
{ % only on titlepage
\setbeamertemplate{background canvas}{%
\begin{tikzpicture}
    \clip (0,0) rectangle (\paperwidth,\paperheight);
    \fill[color=orange] (\paperwidth-10pt,0) rectangle (\paperwidth,\paperheight);
    % Added
    \fill[color=orange] (0,0) rectangle (10pt,\paperheight);
\end{tikzpicture}}
\maketitle
} % only on titlepage
\frame{Content}
\end{document}

enter image description here

Remove { % only on titlepage and } % only on titlepage and it's on every page.

2

TYou set the background to be first a space of length \paperwidth-3pt and then a bar of 10pt (of which only 3pt is visible). If you start with a bar of 3pt, then a space of length \paperwidth-6pt and the ending bar, it should be what you want.

\documentclass{beamer}
\usetheme[secheader]{Madrid}
\author{diabonas}
\title{Frame border}
\setbeamertemplate{background canvas}{%
{\color{black}\rule{3pt}{\paperheight}\hspace*{\dimexpr\paperwidth-6pt\relax}\rule{10pt}{\paperheight}}%    
}
\begin{document}
\begin{frame}
content
\end{frame}
\frame{Content}
\begin{frame}
content
\end{frame}
\end{document}

enter image description here

StefanH
  • 13,823
  • Why not use a 3 pt wide second rule as well? – leandriis Feb 18 '18 at 16:56
  • @leandriis, good question. The easy answer is that it was like this in the question. Another view is that often filled areas at the border of the page can be made a bit bigger to guarantee no white small line at its end. In this case 7pt goes outside the page. – StefanH Feb 18 '18 at 19:14