# How to access package internal values? [duplicate]

Please feel free to change the title of this question since I'm not sure if it's fitting.

For example, I'd like to draw a rule with the same height as the thickness of a frame line of a standard tcolorbox.

I had a look at the tcolorbox package code, and I assume that the line leftrule/.store in=\kvtcb@left@rule is somehow essential for what I want. But if I try

\documentclass{article}

\usepackage{tcolorbox}

\begin{document}

\noindent\rule{\textwidth}{\kvtcb@left@rule}

\end{document}


it doesn't work and LaTeX returns the error ! Undefined control sequence..

So my more general question is: How can I access package internal values like this to use them in my document?

-

## marked as duplicate by Johannes_B, Stefan Pinnow, Kurt, Martin Schröder, PapiroMay 15 at 18:29

Please further specify what you mean by "it doesn't work". – Jubobs Jun 29 '14 at 16:37
You need \makeatletter before \rule and \makeatother after the closing brace. There is no general answer, I'm afraid: it much depends on what internal value you need access to. – egreg Jun 29 '14 at 16:38
@Jubobs I edited my question. – MaxD Jun 29 '14 at 16:42
– MaxD Jun 29 '14 at 16:48
Do note that using internal values means that you should expect code to break when things are updated. Generally, authors try to maintain a backwards-compatible user interface. (Not always, as the recent tikzsymbols author has amply demonstrated, but the more considerate ones.) But they don't do the same for internal values in general. The implementation may change in ways which break your code. – cfr May 15 at 19:53

One could use a wrapper, at least for some of the key values, in order to prevent the \makeatletter...\makeatother pair each time:

\documentclass{article}

\usepackage{tcolorbox}

\makeatletter
\newcommand{\accesstcb}[1]{%
\csname kvtcb@#1\endcsname%
}
\makeatother

\begin{document}

\noindent\rule{\textwidth}{\accesstcb{left@rule}}

\end{document}


The problem is, that tcolorbox has some different naming schemes for the internal values.

-