T-F-S / tcolorbox

A LaTeX package to create highly customizable colored boxes.
http://www.ctan.org/pkg/tcolorbox
LaTeX Project Public License v1.3c
224 stars 16 forks source link

Enhancement request: provide tcbrasternum as a LaTeX counter #119

Closed FrankMittelbach closed 3 years ago

FrankMittelbach commented 4 years ago

Currently \thetcbrasternum is a macro while tcbrasterrow and column are LaTeX counters. This makes it rather difficult to use the value for anything other than an arabic number (e.g., in the title or the background). If \c@tcbrasternum would be used instead the something like \alph{tcbrasternum} could be used for this. \thetcbrasternum would remain available but in the code the counter would need to be used directly.

T-F-S commented 4 years ago

Currently, counters like tcbrastercolumn and tcbrasterrow are not officially documented. \thetcbrasternum is not a counter, because it depends on the other counters. Instead of \alph{tcbrasternum} one could use something like

\def\alpharasternum{%
  \@tempcnta=\thetcbrasternum\relax%
  \@alph\@tempcnta%
}

But, of course, a counter would be easier to use for cost of administration.

I put the issue for further inspection on my TODO list for some time in the future, because currently I try to find something nice for https://github.com/T-F-S/tcolorbox/issues/115 As I have feared, this already took me many hours ...

FrankMittelbach commented 4 years ago

Am 24.09.20 um 16:11 schrieb Thomas F. Sturm:

Currently, counters like |tcbrastercolumn| and |tcbrasterrow| are not officially documented. |\thetcbrasternum| is not a counter, because it depends on the other counters.

Sure but instead of the current definition with \edef and \numexpr it could do \c@... \numexpr.. \relax and achieve the same effect

Instead of |\alph{tcbrasternum}| one could use something like

\def\alpharasternum{% \@tempcnta=\thetcbrasternum\relax% \@alph\@tempcnta% }

agreed and I fully understand how to do that myself. My point is that most LaTeX users wouldn't. I'm currently looking at your package from the perspective of a not too experienced LaTeX user (i.e., how to explain the important features of the package in less than 20 pages for the LaTeX Companion). As part of this I'm just noticing things that I guess people may like to do who are not so experienced with the inner workings of LaTeX. And if they see \the... generating a number most will expect that this is a counter.

I put the issue for further inspection on my TODO list for some time in the future, because currently I try to find something nice for

115 https://github.com/T-F-S/tcolorbox/issues/115

As I have feared, this already took me many hours ...

sorry for that, but the difference in spacing above when there are no descenders in the last line is somewhat glaring

T-F-S commented 4 years ago

sorry for that, but the difference in spacing above when there are no descenders in the last line is somewhat glaring

I also think that it is worth to invest the time. The pity is that every chance gives a chain reaction of unexpected side effects - to test and remove such effects is the time consuming part...

T-F-S commented 3 years ago

For the coming next version, 'tcbrasternum' becomes a counter. \thetcbrasternum is changed to be the corresponding \the macro.

Sorry for the long time between request and implementation, aber am Ende wird alles gut ;-)

FrankMittelbach commented 3 years ago

thanks! I'll check it out and update my documentation in TLC accordingly.

T-F-S commented 3 years ago

Implemented with version 4.50 (2021/05/21)