Skip to content
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

coltitle in subtitle not working. #189

Closed
Tetragramm opened this issue Aug 8, 2022 · 5 comments
Closed

coltitle in subtitle not working. #189

Tetragramm opened this issue Aug 8, 2022 · 5 comments
Assignees

Comments

@Tetragramm
Copy link

The subtitle always inherits the color of the main title, instead of being overridden by specific options.
Small example:

\begin{tcolorbox}[colback=red!20,colframe=red,size=small, boxrule=0pt,
    subtitle style={coltitle=black, boxrule=0pt, toprule=1pt, bottomrule=1pt, colback=white},
    title={First Title}]
    First Content
    \tcbsubtitle[coltitle=black]{SubTitle}
    Second Content
\end{tcolorbox}

produces
image

Similarly, setting the main coltitle to black produces
image

@muzimuzhi
Copy link
Contributor

muzimuzhi commented Aug 8, 2022

\tcbsubtitle is itself a tcolorbox in which the subtitle is actually the upper part of the box, hence you need colupper=black instead of coltitle=black both in subtitle style={<options>} and \tcbsubtitle[<options>]{<subtitle>}.

Not sure if it's too late to add redirection for title options used in <options> of \tcbsubtitle[<options>]{<subtitle>}.

@T-F-S
Copy link
Owner

T-F-S commented Aug 10, 2022

I think, @muzimuzhi has given all needed explanations. So, using colupper instead of coltitle for the subtitle does the trick.

\documentclass{article}
\usepackage{tcolorbox}

\tcbuselibrary{skins}

\begin{document}

\begin{tcolorbox}[colback=red!20,colframe=red,size=small, boxrule=0pt,
    subtitle style={boxrule=0pt, toprule=1pt, bottomrule=1pt, colback=white},
    title={First Title}]
    First Content
    \tcbsubtitle[colupper=black]{SubTitle}
    Second Content
\end{tcolorbox}

\begin{tcolorbox}[colback=red!20,colframe=red,size=small, boxrule=0pt,
    subtitle style={colupper=black, boxrule=0pt, toprule=1pt, bottomrule=1pt, colback=white},
    title={First Title}]
    First Content
    \tcbsubtitle{SubTitle}
    Second Content
\end{tcolorbox}

\end{document}

grafik

@Tetragramm
Copy link
Author

Sorry for disappearing. Perhaps add a clarification to the documentation? Page 26, where subtitle is described talks about how it's an independent tcolorbox, which implies the same settings work. One of the examples could be given a different title color, or maybe a list of settings that don't get inherited (if there's more than one).

@T-F-S
Copy link
Owner

T-F-S commented Feb 10, 2023

Sorry for disappearing. Perhaps add a clarification to the documentation? Page 26, where subtitle is described talks about how it's an independent tcolorbox, which implies the same settings work. One of the examples could be given a different title color, or maybe a list of settings that don't get inherited (if there's more than one).

The next version will have an example with redish subtitles:

grafik

@T-F-S T-F-S self-assigned this Feb 10, 2023
@T-F-S
Copy link
Owner

T-F-S commented Feb 10, 2023

@T-F-S T-F-S closed this as completed Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants