TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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?

share|improve this question

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Please further specify what you mean by "it doesn't work". – Jubobs Jun 29 '14 at 16:37
9  
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
5  
Related: tex.stackexchange.com/q/8351/45734 – 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.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.