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

Protect/Brace arguments delimited by square brackets #234

Closed muzimuzhi closed 1 year ago

muzimuzhi commented 1 year ago

This PR is just for showing the long diff more conveniently. It can be safely closed without merging.

I checked every occurrence of [ in files in ./tex subdirectory, and apart from tikz-level use cases, theses are the ones I think/assume need to be protected. For all the braces added, I admit they are not equally necessary. The two most helpful cases are for \tcblistof and \tcbsubtitle.

Part of #229

\documentclass{article}
\usepackage{tcolorbox}

\begin{document}
\tableofcontents
\tcblistof[\section]{exam}[{LoE, Short title[]}]{List of Exercises}

\begin{tcolorbox}[title=Title, after title={[]}]
  content
  \tcbsubtitle[{after upper=[]}]{Subtitle}
  content
\end{tcolorbox}
\end{document}
Before After
image image
T-F-S commented 1 year ago

Some of the missing spots I left out deliberately (where the content came from a square bracket argument), but \tcboxfit I left out by mistake. Since the braces are not hurting at all the places, I will add them everywhere you proposed.

Thank you!

muzimuzhi commented 1 year ago

lucky ^_^