-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convenience feature: environment upper = description
etc.
#250
Comments
Thank you for this feature proposal. Currently, I am very busy, but I will look into it in some days. |
I think this is a nice new shortcut feature and I will add it to the next version. Thank you! |
Maybe it's worth mentioning in doc that That is, \documentclass{article}
\usepackage{tcolorbox}
\newtcolorbox{mybox}[1][]{#1}
\begin{document}
% ! LaTeX Error: \begin{mybox} on input line 7 ended by \end{tcolorbox}.
\begin{tcolorbox}[environment upper={mybox}]
content
\end{tcolorbox}
% ! LaTeX Error: \begin{tcolorbox} on input line 12 ended by \end{mybox}.
\begin{mybox}[environment upper={tcolorbox}]
content
\end{mybox}
\end{document} |
Many options function by setting For upper part, there are (no guarantee of completeness)
Two thoughts
|
Good idea. Perhaps even better: instead of writing this in the docs, we can also write it into the code. So that |
@mgkurtz Nice idea! Though I'm afraid not all such options should be auto ended up as. This is the case for \PassOptionsToPackage{table}{xcolor}
\documentclass{article}
\usepackage{array}
\usepackage{tcolorbox}
\tcbset{colframe=red!50!black}
\begin{document}
\def\testWrapUpperInTabular#1{%
\hspace*{-2\parindent}{\ttfamily\detokenize{#1}}
\begin{tcolorbox}[#1]
\hline
a & b \\
aa & bb \\
aaa & bbb \\ \hline
\end{tcolorbox}
}
\testWrapUpperInTabular{environment upper args = {tabular}{{|l|r|}}}
\testWrapUpperInTabular{environment upper args = {tabular*}
{{\linewidth}{|@{\extracolsep{\fill}\hspace{20mm}}l|r@{\hspace{20mm}}|}}}
\testWrapUpperInTabular{tabulars =
{|@{\extracolsep{\fill}\hspace{20mm}}l|r@{\hspace{20mm}}|}}
\end{document} |
I will add such a warning. Thank you! |
That may be useful. Such extensions are provided for |
No, I do not think so. Beginning to cross-reference everything to everything would just open dependency hell for every change. And putting all in one place is already done with 4.11 Box Content Additions for the core options. Other options are from the libraries. |
I also consider such an approach to be nice, but not applicable or too complicated. Some hacks are very special and possible more may come in future. |
For my own use, I defined keys
environment upper
andenvironment upper args
as well as theirlower
equivalents for usage such asFor me, such usage feels more natural than setting
before upper*
,after upper*
,before lower*
, andafter lower*
. Your mileage may vary.Implementation
The text was updated successfully, but these errors were encountered: