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

4
  • Replace \paperwidth with 0pt in the question you cited?! Feb 18, 2018 at 16:34
  • @Dr. Manuel Kuehner your suggestion make both side bars invisible Feb 18, 2018 at 16:39
  • \color{black}\rule{10pt}{\paperheight}\hspace*{\dimexpr\paperwidth-20pt\relax}\rule{10pt}{\paperheight} might do what you want to achieve.
    – leandriis
    Feb 18, 2018 at 16:49
  • I added an altered version of the cited question/answer. I just added the left version. Feb 18, 2018 at 16:52

2 Answers 2

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

2
  • Why not use a 3 pt wide second rule as well?
    – leandriis
    Feb 18, 2018 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, 2018 at 19:14
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.