1

Let's assume we have a tcolorbox in the following environment:

\documentclass[17pt]{beamer}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pgfkeys}
%
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{multirow}
%
\usepackage{tikz}
\usepackage{tcolorbox}
%
\usepackage{listings}
%
%
\begin{document}
\begin{frame}[fragile]
\begin{tcolorbox}[title=boxtitle,width=250pt, move downward= 10pt]
\begin{lstlisting}[language=TeX]
    code...
\end{lstlisting}    
    Some text
\begin{lstlisting}[language=Java]

more code...
\end{lstlisting}
\end{tcolorbox}
\end{frame}
\end{document}

How can I move the tcolorbox I buildt, to the position I desire (in the frame)? I have tired to move it via [move downwards*= 9pt]but that gives me the exception :

Package pgfkeys Error: I do not know the key '/tcb/enhanced' and I am going to ignore it. Perhaps you misspelled it. ...h=280pt, boxrule= 2pt, move downward= 10pt]

Also, I saw a post about embeeding the tcolorbox inside a ´node´ or ´tlrbox´ but I didn't really understand how that is done.

  • 1
    Please make a minimal working example (MWE) – samcarter_is_at_topanswers.xyz Jul 18 '18 at 20:23
  • before fcolorbox try to add \vspace{10pt} or if you like to have it vertical centered \vfill. in case that you like to have also horizontal centered than trx \vfill\centering \begin{tcolorbox}... – Zarko Jul 18 '18 at 22:13
  • \tcbuselibrary{skins} to use the enhanced key. Is 17pt actually supported by Beamer? That is enormous relative to the size of the slides. The default is 11pt. – cfr Jul 19 '18 at 3:32
2

you can always include the tcolorbox inside a TikZ node and place it over certain position of current page (you need two compilations to get the box on desired position).

move downward is not defined as option in tcolorbox, therefore the error is normal.

\documentclass[17pt]{beamer}

\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{pgfkeys}
%
\usepackage{multicol}
\usepackage{graphicx}
\usepackage{multirow}
%
\usepackage{tikz}
\usepackage{tcolorbox}
%
\usepackage{listings}
%
%
\begin{document}
\begin{frame}[fragile]{test}
\tikz[remember picture, overlay]%
\node[inner sep=0pt] at (current page.center) {%
\begin{tcolorbox}[title=boxtitle,width=250pt]%, move downward= 10pt]
\begin{lstlisting}[language=TeX]
    code...
\end{lstlisting}    
    Some text
\begin{lstlisting}[language=Java]

more code...
\end{lstlisting}
\end{tcolorbox}};
\end{frame}

\begin{frame}[fragile]{test}
\tikz[remember picture, overlay]%
\node[inner sep=0pt, anchor=south east] at (current page.south east) {%
\begin{tcolorbox}[title=boxtitle,width=250pt]%, move downward= 10pt]
\begin{lstlisting}[language=TeX]
    code...
\end{lstlisting}    
    Some text
\begin{lstlisting}[language=Java]

more code...
\end{lstlisting}
\end{tcolorbox}};
\end{frame}
\end{document}

enter image description here

| improve this answer | |

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.