Package tcolorbox
has defined a style called "tikz lower". The package manual introduces it as follows:
/tcb/tikz lower=options
This style adds a centered tikzpicture environment to the start and end of the lower part. The options may be given as TikZ picture options.
However, I quite don't understand what it means by saying "TikZ picture options". Here's my attempt to change the scale of two axes (normally I would do \begin{tikzpicture}[x=10pt,y=20pt]
):
\documentclass{article}
\usepackage{tcolorbox}
\tcbuselibrary{listings,skins}
\usepackage{tikz}
\newtcblisting{displaytikz}{
tikz lower,
% tikz lower={x=10pt,y=20pt},
listing side text,
bicolor,colback=blue!30!white,colbacklower=white,
colframe=black,righthand width=3cm
}
\begin{document}
\begin{displaytikz}
\draw (0,0) -- (1,1);
\draw (0,0.5) -- (2,0);
\end{displaytikz}
\end{document}
I replace the first line in my \newtcblisting
definition by the commented second line, then I get an error:
Package pgfkeys Error: I do not know the key '/tcb/y', to which you passed '20pt]', and I am going to ignore it. Perhaps you misspelled it. \begin{displaytikz}
FYI, I also check the tcolorbox.sty
, the relevant line is:
...
tikz lower/.style={
before lower=\centering\tcb@shield@externalize\begin{tikzpicture}[#1],
after lower=\end{tikzpicture}
}, ...
I think I must have mistaken something. If tikz lower
is not for this, then how can I convey arguments to the TikZ environment? Any ideas?