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
213 stars 15 forks source link

New environment like `valuelist` (from `ltxdockit` package) #275

Closed matteofg closed 3 months ago

matteofg commented 3 months ago

I am aware that, in the author's intentions, documentation library “is assumed to be used in conjunction with the class ltxdoc or alike“ (The tcolorbox package, p. 492). However, in the simplest cases, using the library alone is more than sufficient.

Imho a valuelist-like environment (ltxdockit package) is missing to describe the various values of a key option.

Belowe a mwe ```tex \documentclass{article} \usepackage{ltxdockit} \usepackage{lipsum} \begin{document} \begin{optionlist} \optitem[alpha]{foo}{\opt{alpha}, \opt{beta}, \opt{gamma}} \lipsum[1][1] \begin{valuelist} \item[alpha] \lipsum[2][1-4] \item[beta] \lipsum[3][1-3] \item[gamma] \lipsum[4][1-2] \end{valuelist} \end{optionlist} \end{document} ```
Screenshot 2024-03-28 at 17 20 25
T-F-S commented 3 months ago

Currently, there is no such environment. A value list is made manually, for example (from the documentation):

  Feasible values for \meta{part} are:
  \begin{itemize}
  \item\docValue{broken}: all broken box parts,
  \item\docValue{unbroken}: unbroken boxes only,
  \item\docValue{first}: first parts of a break sequence,
  \item\docValue{middle}: middle parts of a break sequence,
  \item\docValue{last}: last parts of a break sequence,
  \item\docValue{unbroken and first}: unbroken boxes and first parts of a break sequence,
  \item\docValue{middle and last}: middle and last parts of a break sequence.
  \item\docValue{first and middle}: first and middle parts of a break sequence.
  \end{itemize}

grafik

With a new environment tcbvaluelist, we could have the same output with code like

  Feasible values for \meta{part} are:
  \begin{tcbvaluelist}
  \item[broken] all broken box parts,
  \item[unbroken] unbroken boxes only,
  \item[first] first parts of a break sequence,
  \item[middle] middle parts of a break sequence,
  \item[last] last parts of a break sequence,
  \item[unbroken and first] unbroken boxes and first parts of a break sequence,
  \item[middle and last] middle and last parts of a break sequence.
  \item[first and middle] first and middle parts of a break sequence.
  \end{tcbvaluelist}

There is no problem in providing such an environment, but I fear, users would demand for customization. And I do not want to re-invent all sorts of itemize customizations just to have a value list... Therefore, I hesitate to add such an environment. Nevertheless, I keep this for further thinking.

matteofg commented 3 months ago

OK, thanks for the explanations. For me the issue may as well be closed.

T-F-S commented 3 months ago

OK, thanks for the explanations. For me the issue may as well be closed.

OK, I close it to tidy up the issue list. Anyhow, thanks for providing ideas for improvement.