0

I came across this answer, which shows how to edit the beamerbaseboxes.sty file to increase the "rounded-ness" of the corners of boxes, when using the "rounded" boxes innertheme. In this answer, the author changed number values like \pgfpathqcurveto, \pgflineto, and \pgfpoint.

I would like to know what number values to use to obtain completely square corners (no rounded-ness). I want to do this without using the "rectangle" innertheme, so that I can keep the shadows provided by the rounded theme.

4
  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – user31729
    Sep 19, 2014 at 14:52
  • Yes, pgf is correct. Thanks. As for your first comment, an MWE is difficult in this case since it is a question about editing base files in the beamer package. Sep 19, 2014 at 15:13
  • rectangle can be used with shadows option no?
    – percusse
    Sep 19, 2014 at 15:34
  • @percusse: Evidently not. There is this answer: tex.stackexchange.com/questions/176337/…, which creates rectangular boxes with shadows. But it is a little more involved than what I am looking for, and, most importantly, did not preserve the other aspects of the Boadilla theme (which I like). So I believe the minimal solution should just be to change these number values in the indicated style file so that the rounded theme applies zero roundness. Sep 19, 2014 at 15:41

1 Answer 1

1

Based on https://tex.stackexchange.com/a/176356/36296

You can easily use the answer you linked in your comment together with the Boadilla theme:

\documentclass{beamer}
\usepackage[many]{tcolorbox}

\usetheme{Boadilla}

\tikzset{beamer@color/.style={fill=none,top color=tcbcol@back,bottom color=tcbcol@back}}

\tcbset{beamer/.style={skin=beamer,boxrule=0mm,titlerule=1mm,toptitle=0.5mm,arc=2mm,fonttitle=\bfseries,drop fuzzy shadow=black}}

\tcbset{
tcbeamer/.style={
  beamer,
  width=\textwidth+3pt,
  enlarge left by=-3pt,
  bottom=0pt,
  top=0pt,
  left=1pt,
  right=1pt,
  arc=0pt,
  outer arc=0pt,
  toptitle=0pt,
  bottomtitle=-1pt,
  }
}

\newenvironment<>{tcexampleblock}[1]
  {\begin{actionenv}#2\begin{tcolorbox}[
    adjusted title=#1,
    tcbeamer,
    colback=block body example.bg,
    colframe=block title example.bg,
    fonttitle=\large\color{block title example.fg}
    ]
  }
  {\end{tcolorbox}\end{actionenv}}

\newenvironment<>{tcalertblock}[1]
  {\begin{actionenv}#2\begin{tcolorbox}[
    adjusted title=#1,
    tcbeamer,
    colback=block body alerted.bg,
    colframe=block title alerted.bg,
    fonttitle=\large\color{block title alerted.fg},
    adjusted title=#1,
    ]
  }
  {\end{tcolorbox}\end{actionenv}}

\begin{document}

\begin{frame}

\begin{exampleblock}{Test exampleblock}
This is a block provided by the \texttt{beamer} class.
\end{exampleblock}

\begin{tcexampleblock}{Test tcexampleblock}
This is a block provided by the \texttt{tcolorbox} package.
\end{tcexampleblock}

\begin{alertblock}{Test alertblock}
This is a block provided by the \texttt{beamer} class.
\end{alertblock}

\begin{tcalertblock}{Test tcalertblock}
This is a block provided by the \texttt{tcolorbox} package.
\end{tcalertblock}

\end{frame}

\end{document}

enter image description here

The code can be further simplified with the new tcolorbox inner theme (https://www.ctan.org/pkg/beamertheme-tcolorbox )

This theme allows you to have square boxes with shadows:

\documentclass{beamer}
\usepackage[many]{tcolorbox}

\usetheme{Boadilla}

\useinnertheme[rounded=false]{tcolorbox}

\begin{document}

\begin{frame}

\begin{exampleblock}{Test exampleblock}
This is a block provided by the \texttt{beamer} class.
\end{exampleblock}

\begin{alertblock}{Test alertblock}
This is a block provided by the \texttt{beamer} class.
\end{alertblock}

\end{frame}

\end{document}

enter image description here

Or if you also like to keep the colour gradient between the title and body, you can change the corner radius like this:

\documentclass{beamer}
\usepackage[many]{tcolorbox}

\usetheme{Boadilla}

\useinnertheme{tcolorbox}

\tcbset{
  arc=0mm
}

\begin{document}

\begin{frame}

\begin{exampleblock}{Test exampleblock}
This is a block provided by the \texttt{beamer} class.
\end{exampleblock}

\begin{alertblock}{Test alertblock}
This is a block provided by the \texttt{beamer} class.
\end{alertblock}

\end{frame}

\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .