2

Consider the following two documents:

(a): An article class one which does not compile (key /tcb/thick unknown)

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark,arrows,arrows.meta,shapes}
\usepackage[most]{tcolorbox}
\newtcolorbox{tcbdummy}[1]{enhanced,#1}
\begin{document}
\begin{tcbdummy}{height=4.5cm,overlay={
        \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h1)+(-3cm,-1.5cm) |- ++ (-1.75cm,-.75cm) node[anchor=west,fill=blue!25,text=black] (heading) {Kapitelüberschrift};}
        \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h3)+(-.75cm,-1.8cm) -- ++ (0cm,-1.8cm) node[anchor=west,fill=blue!25,text=black] (subheading) {Abschnittsüberschrift};}
        \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h2)+(-4cm,-2cm) -- ++ (-4.5cm,-4cm) node[anchor=north,fill=blue!25,text=black] (text) {Textkörper};
        \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h4)+(-1.75cm,-2cm) -- (text);
    }}
    {\Large\bfseries Texte zum Testen\tikzmark{ex1-h1}}\vskip.75\baselineskip
        Hier kommt normaler Text.\tikzmark{ex1-h2}\\[.3cm]
        {\large\itshape Lorem ipsum\tikzmark{ex1-h3}}\vskip.5\baselineskip
            Und noch mehr Text\tikzmark{ex1-h4}
\end{tcbdummy}
\end{document}

(b): A beamer class one which does compile

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{tikzmark,arrows,arrows.meta,shapes}
\usepackage[most]{tcolorbox}
\newtcolorbox{tcbdummy}[1]{enhanced,#1}
\begin{document}
\begin{frame}{Test}{Quack}
\begin{tcbdummy}{height=4.5cm,overlay={
    \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h1)+(-3cm,-1.5cm) |- ++ (-1.75cm,-.75cm) node[anchor=west,fill=blue!25,text=black] (heading) {Kapitelüberschrift};
    \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h3)+(-.75cm,-1.8cm) -- ++ (0cm,-1.8cm) node[anchor=west,fill=blue!25,text=black] (subheading) {Abschnittsüberschrift};
    \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h2)+(-4cm,-2cm) -- ++ (-4.5cm,-4cm) node[anchor=north,fill=blue!25,text=black] (text) {Textkörper};
    \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h4)+(-1.75cm,-2cm) -- (text);
}}
    {\Large\bfseries Texte zum Testen\tikzmark{ex1-h1}}\vskip.75\baselineskip
        Hier kommt normaler Text.\tikzmark{ex1-h2}\\[.3cm]
        {\large\itshape Lorem ipsum\tikzmark{ex1-h3}}\vskip.5\baselineskip
            Und noch mehr Text\tikzmark{ex1-h4}
\end{tcbdummy}
\end{frame}
\end{document}

I wanted to port the beamer figure to article, but it doesn't work. What's the difference in functionality there?

3

The difference is just two more closing braces. If you remove them everything works fine :)

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{tikzmark,arrows,arrows.meta,shapes}
\usepackage[most]{tcolorbox}
\newtcolorbox{tcbdummy}[1]{enhanced,#1}
\begin{document}

\begin{tcbdummy}{height=4.5cm,overlay={
    \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h1)+(-3cm,-1.5cm) |- ++ (-1.75cm,-.75cm) node[anchor=west,fill=blue!25,text=black] (heading) {Kapitelüberschrift};% no closing brace
    \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h3)+(-.75cm,-1.8cm) -- ++ (0cm,-1.8cm) node[anchor=west,fill=blue!25,text=black] (subheading) {Abschnittsüberschrift};% no closing brace
    \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h2)+(-4cm,-2cm) -- ++ (-4.5cm,-4cm) node[anchor=north,fill=blue!25,text=black] (text) {Textkörper};
    \draw[blue,thick,Stealth-,rounded corners] (pic cs:ex1-h4)+(-1.75cm,-2cm) -- (text);
}}
    {\Large\bfseries Texte zum Testen\tikzmark{ex1-h1}}\vskip.75\baselineskip
        Hier kommt normaler Text.\tikzmark{ex1-h2}\\[.3cm]
        {\large\itshape Lorem ipsum\tikzmark{ex1-h3}}\vskip.5\baselineskip
            Und noch mehr Text\tikzmark{ex1-h4}
\end{tcbdummy}
\end{document}
  • Wow, didn't notice that. Thanks. – TeXnician Oct 28 '17 at 12:25

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.