4

I'm trying some features of tcolorbox package and I'm facing some problem with the option $tikznode$. Here my code:

    \documentclass{article}
    \usepackage{tcolorbox}
    \listfiles
    \begin{document}
    \tcbset{colframe=blue!50!black, colback=white, fonttitle=\bfseries, center title}
   \begin{tcolorbox}
   Hello\newline word
   \end{tcolorbox}
   \tcbox{Hello\newline word}
   \tcbox[tikznode]{Hello\newline word}
   \end{document}

No problem with the first two boxes but the last one leads to an error:

Package pgfkeys Error: I do not know the key '/tcb/tikznode' and I am going to ignore it. Perhaps you misspelled it.

0

1 Answer 1

1

You need to add \usepackage{tikz} in the preamble.

    \documentclass{article}
    \usepackage{tikz}
    \usepackage{tcolorbox}
    \listfiles
    \begin{document}
    \tcbset{colframe=blue!50!black, colback=white, fonttitle=\bfseries, center title}
   \begin{tcolorbox}
   Hello\newline word
   \end{tcolorbox}
   \tcbox{Hello\newline word}
   \tcbox[tikznode]{Hello\\ word}
   \end{document}

On the other hand, you can load the tcolorbox library skins which loads tikz.

\documentclass{article}
%\usepackage{tikz}
\usepackage[skins]{tcolorbox}

Essence is tikznode needs tikzpicture and places the contents in a tikz node.

4
  • Thank you but the two methods did not solve the problem. Actually I’m getting really confused: after some checks, I noticed that the ‘tikz’ package is not found in my miktex package manager and when I run mpm --admin --verify=tikz on cmd prompt (win7), it told me that it didn’t succeed.
    – Radhouane
    Sep 19, 2015 at 14:05
  • But when I run the following code: '\documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw (0,0) circle (1) ; \end{tikzpicture} \end{document}' everything seems fine and I got a circle as an output. I really misunderstand such behavior. However it is all OK concerning the pgf package and tcolorbox package. I’m wondering if there is way to ensure that the required packages in the example are correctly installed (I installed a full distribution of miktex without any error in the last two days).
    – Radhouane
    Sep 19, 2015 at 14:06
  • @Radhouane: TiKZ is part of pgf package. An independent tikz package doesn't exist. TiKZ is a kind of macro language which hides pgf complexity and which is what really does the work.
    – Ignasi
    Sep 21, 2015 at 7:13
  • @Ignasi: I realized that. In fact the operating system (win 7) placed the miktex distribution in .. AppData\Roaming folder since I allowed only the administrator to be the only user. When I updated the pgf package the OS used the default installation path (C:\Program Files\MiKTeX 2.9). That is why it bugged. I fixed it and now I won my LaTeX back. Thanks to all of you.
    – Radhouane
    Sep 22, 2015 at 17:21

You must log in to answer this question.

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