How to add double frame in tcolorbox?
Is it possible to add double frame in a tcolorbox? Actually I am trying to design a chapter using titlesec and tcolorbox which has two borders. Inner border colour will be white ( same as the page colour ) and the outer border colour will be cyan ( same as the box background colour) something like this.
This is the code which I was trying :
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
enhanced,
colback = myCyan,
fontupper=color{white},
boxrule=0pt,
colframe=black!70!white,
arc=0pt,
outer arc=0pt,
top=20pt,
bottom=20pt,
left=20pt,
right=20pt,
]
begin{center}
#1
end{center}
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
chapters tcolorbox titlesec
add a comment |
Is it possible to add double frame in a tcolorbox? Actually I am trying to design a chapter using titlesec and tcolorbox which has two borders. Inner border colour will be white ( same as the page colour ) and the outer border colour will be cyan ( same as the box background colour) something like this.
This is the code which I was trying :
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
enhanced,
colback = myCyan,
fontupper=color{white},
boxrule=0pt,
colframe=black!70!white,
arc=0pt,
outer arc=0pt,
top=20pt,
bottom=20pt,
left=20pt,
right=20pt,
]
begin{center}
#1
end{center}
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
chapters tcolorbox titlesec
So all of your chapters are not numbered?
– JouleV
Apr 6 at 13:39
Yes, numbered. the image which i have provide is just for the demo purpose. Number will be at the begging of the chapter like this : 1. Android Tutorial
– Ravi
Apr 6 at 13:43
add a comment |
Is it possible to add double frame in a tcolorbox? Actually I am trying to design a chapter using titlesec and tcolorbox which has two borders. Inner border colour will be white ( same as the page colour ) and the outer border colour will be cyan ( same as the box background colour) something like this.
This is the code which I was trying :
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
enhanced,
colback = myCyan,
fontupper=color{white},
boxrule=0pt,
colframe=black!70!white,
arc=0pt,
outer arc=0pt,
top=20pt,
bottom=20pt,
left=20pt,
right=20pt,
]
begin{center}
#1
end{center}
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
chapters tcolorbox titlesec
Is it possible to add double frame in a tcolorbox? Actually I am trying to design a chapter using titlesec and tcolorbox which has two borders. Inner border colour will be white ( same as the page colour ) and the outer border colour will be cyan ( same as the box background colour) something like this.
This is the code which I was trying :
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
enhanced,
colback = myCyan,
fontupper=color{white},
boxrule=0pt,
colframe=black!70!white,
arc=0pt,
outer arc=0pt,
top=20pt,
bottom=20pt,
left=20pt,
right=20pt,
]
begin{center}
#1
end{center}
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
chapters tcolorbox titlesec
chapters tcolorbox titlesec
edited Apr 6 at 13:35
Ravi
asked Apr 6 at 13:29
RaviRavi
33619
33619
So all of your chapters are not numbered?
– JouleV
Apr 6 at 13:39
Yes, numbered. the image which i have provide is just for the demo purpose. Number will be at the begging of the chapter like this : 1. Android Tutorial
– Ravi
Apr 6 at 13:43
add a comment |
So all of your chapters are not numbered?
– JouleV
Apr 6 at 13:39
Yes, numbered. the image which i have provide is just for the demo purpose. Number will be at the begging of the chapter like this : 1. Android Tutorial
– Ravi
Apr 6 at 13:43
So all of your chapters are not numbered?
– JouleV
Apr 6 at 13:39
So all of your chapters are not numbered?
– JouleV
Apr 6 at 13:39
Yes, numbered. the image which i have provide is just for the demo purpose. Number will be at the begging of the chapter like this : 1. Android Tutorial
– Ravi
Apr 6 at 13:43
Yes, numbered. the image which i have provide is just for the demo purpose. Number will be at the begging of the chapter like this : 1. Android Tutorial
– Ravi
Apr 6 at 13:43
add a comment |
2 Answers
2
active
oldest
votes
This may be a start. The idea is to nest tcolorbox
es.
documentclass{article}
usepackage{tcolorbox}
begin{document}
begin{tcolorbox}[
colback=green!50!blue,
colframe=green!50!blue,
left=1.5pt,right=1.5pt,top=1.5pt,bottom=-1.5pt,
sharp corners,
boxsep=0pt
]
begin{tcolorbox}[
colback=green!50!blue,
colframe=white,
leftrule=1.5pt,rightrule=1.5pt,toprule=1.5pt,bottomrule=1.5pt,
sharp corners,
fontupper=color{white}sffamilybfseriesLargecentering
]
Android tutorial
end{tcolorbox}%
end{tcolorbox}
end{document}
Now let's customize our chapter with it.
documentclass{book}
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
colback=myCyan,
colframe=myCyan,
left=1.5pt,right=1.5pt,top=1.5pt,bottom=-1.5pt,
sharp corners,
boxsep=0pt
]
begin{tcolorbox}[
colback=myCyan,
colframe=white,
leftrule=1.5pt,rightrule=1.5pt,toprule=1.5pt,bottomrule=1.5pt,
sharp corners,
fontupper=color{white}sffamilybfseriesHugecentering
]
thechapter. #1
end{tcolorbox}%
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
usepackage{lipsum}
begin{document}
chapter{Lorem lipsum}
lipsum[1]
end{document}
add a comment |
There's no need for nested tcolorboxes
, you could use an enhanced
box with an additional borderline
:
documentclass{book}
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
enhanced,
colback=myCyan,
colframe=myCyan,
boxsep=5pt,
sharp corners,
borderline={1.5pt}{3pt}{white},
colupper=white,
fontupper=sffamilybfseriesHuge,
halign upper=center
]
thechapter. #1
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
usepackage{lipsum}
begin{document}
chapter{Lorem lipsum}
lipsum[1]
end{document}
Thanks sir, I really appreciate it.
– Ravi
Apr 8 at 7:53
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483519%2fhow-to-add-double-frame-in-tcolorbox%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
This may be a start. The idea is to nest tcolorbox
es.
documentclass{article}
usepackage{tcolorbox}
begin{document}
begin{tcolorbox}[
colback=green!50!blue,
colframe=green!50!blue,
left=1.5pt,right=1.5pt,top=1.5pt,bottom=-1.5pt,
sharp corners,
boxsep=0pt
]
begin{tcolorbox}[
colback=green!50!blue,
colframe=white,
leftrule=1.5pt,rightrule=1.5pt,toprule=1.5pt,bottomrule=1.5pt,
sharp corners,
fontupper=color{white}sffamilybfseriesLargecentering
]
Android tutorial
end{tcolorbox}%
end{tcolorbox}
end{document}
Now let's customize our chapter with it.
documentclass{book}
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
colback=myCyan,
colframe=myCyan,
left=1.5pt,right=1.5pt,top=1.5pt,bottom=-1.5pt,
sharp corners,
boxsep=0pt
]
begin{tcolorbox}[
colback=myCyan,
colframe=white,
leftrule=1.5pt,rightrule=1.5pt,toprule=1.5pt,bottomrule=1.5pt,
sharp corners,
fontupper=color{white}sffamilybfseriesHugecentering
]
thechapter. #1
end{tcolorbox}%
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
usepackage{lipsum}
begin{document}
chapter{Lorem lipsum}
lipsum[1]
end{document}
add a comment |
This may be a start. The idea is to nest tcolorbox
es.
documentclass{article}
usepackage{tcolorbox}
begin{document}
begin{tcolorbox}[
colback=green!50!blue,
colframe=green!50!blue,
left=1.5pt,right=1.5pt,top=1.5pt,bottom=-1.5pt,
sharp corners,
boxsep=0pt
]
begin{tcolorbox}[
colback=green!50!blue,
colframe=white,
leftrule=1.5pt,rightrule=1.5pt,toprule=1.5pt,bottomrule=1.5pt,
sharp corners,
fontupper=color{white}sffamilybfseriesLargecentering
]
Android tutorial
end{tcolorbox}%
end{tcolorbox}
end{document}
Now let's customize our chapter with it.
documentclass{book}
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
colback=myCyan,
colframe=myCyan,
left=1.5pt,right=1.5pt,top=1.5pt,bottom=-1.5pt,
sharp corners,
boxsep=0pt
]
begin{tcolorbox}[
colback=myCyan,
colframe=white,
leftrule=1.5pt,rightrule=1.5pt,toprule=1.5pt,bottomrule=1.5pt,
sharp corners,
fontupper=color{white}sffamilybfseriesHugecentering
]
thechapter. #1
end{tcolorbox}%
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
usepackage{lipsum}
begin{document}
chapter{Lorem lipsum}
lipsum[1]
end{document}
add a comment |
This may be a start. The idea is to nest tcolorbox
es.
documentclass{article}
usepackage{tcolorbox}
begin{document}
begin{tcolorbox}[
colback=green!50!blue,
colframe=green!50!blue,
left=1.5pt,right=1.5pt,top=1.5pt,bottom=-1.5pt,
sharp corners,
boxsep=0pt
]
begin{tcolorbox}[
colback=green!50!blue,
colframe=white,
leftrule=1.5pt,rightrule=1.5pt,toprule=1.5pt,bottomrule=1.5pt,
sharp corners,
fontupper=color{white}sffamilybfseriesLargecentering
]
Android tutorial
end{tcolorbox}%
end{tcolorbox}
end{document}
Now let's customize our chapter with it.
documentclass{book}
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
colback=myCyan,
colframe=myCyan,
left=1.5pt,right=1.5pt,top=1.5pt,bottom=-1.5pt,
sharp corners,
boxsep=0pt
]
begin{tcolorbox}[
colback=myCyan,
colframe=white,
leftrule=1.5pt,rightrule=1.5pt,toprule=1.5pt,bottomrule=1.5pt,
sharp corners,
fontupper=color{white}sffamilybfseriesHugecentering
]
thechapter. #1
end{tcolorbox}%
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
usepackage{lipsum}
begin{document}
chapter{Lorem lipsum}
lipsum[1]
end{document}
This may be a start. The idea is to nest tcolorbox
es.
documentclass{article}
usepackage{tcolorbox}
begin{document}
begin{tcolorbox}[
colback=green!50!blue,
colframe=green!50!blue,
left=1.5pt,right=1.5pt,top=1.5pt,bottom=-1.5pt,
sharp corners,
boxsep=0pt
]
begin{tcolorbox}[
colback=green!50!blue,
colframe=white,
leftrule=1.5pt,rightrule=1.5pt,toprule=1.5pt,bottomrule=1.5pt,
sharp corners,
fontupper=color{white}sffamilybfseriesLargecentering
]
Android tutorial
end{tcolorbox}%
end{tcolorbox}
end{document}
Now let's customize our chapter with it.
documentclass{book}
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
colback=myCyan,
colframe=myCyan,
left=1.5pt,right=1.5pt,top=1.5pt,bottom=-1.5pt,
sharp corners,
boxsep=0pt
]
begin{tcolorbox}[
colback=myCyan,
colframe=white,
leftrule=1.5pt,rightrule=1.5pt,toprule=1.5pt,bottomrule=1.5pt,
sharp corners,
fontupper=color{white}sffamilybfseriesHugecentering
]
thechapter. #1
end{tcolorbox}%
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
usepackage{lipsum}
begin{document}
chapter{Lorem lipsum}
lipsum[1]
end{document}
edited Apr 6 at 13:57
answered Apr 6 at 13:51
JouleVJouleV
14.8k22666
14.8k22666
add a comment |
add a comment |
There's no need for nested tcolorboxes
, you could use an enhanced
box with an additional borderline
:
documentclass{book}
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
enhanced,
colback=myCyan,
colframe=myCyan,
boxsep=5pt,
sharp corners,
borderline={1.5pt}{3pt}{white},
colupper=white,
fontupper=sffamilybfseriesHuge,
halign upper=center
]
thechapter. #1
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
usepackage{lipsum}
begin{document}
chapter{Lorem lipsum}
lipsum[1]
end{document}
Thanks sir, I really appreciate it.
– Ravi
Apr 8 at 7:53
add a comment |
There's no need for nested tcolorboxes
, you could use an enhanced
box with an additional borderline
:
documentclass{book}
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
enhanced,
colback=myCyan,
colframe=myCyan,
boxsep=5pt,
sharp corners,
borderline={1.5pt}{3pt}{white},
colupper=white,
fontupper=sffamilybfseriesHuge,
halign upper=center
]
thechapter. #1
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
usepackage{lipsum}
begin{document}
chapter{Lorem lipsum}
lipsum[1]
end{document}
Thanks sir, I really appreciate it.
– Ravi
Apr 8 at 7:53
add a comment |
There's no need for nested tcolorboxes
, you could use an enhanced
box with an additional borderline
:
documentclass{book}
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
enhanced,
colback=myCyan,
colframe=myCyan,
boxsep=5pt,
sharp corners,
borderline={1.5pt}{3pt}{white},
colupper=white,
fontupper=sffamilybfseriesHuge,
halign upper=center
]
thechapter. #1
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
usepackage{lipsum}
begin{document}
chapter{Lorem lipsum}
lipsum[1]
end{document}
There's no need for nested tcolorboxes
, you could use an enhanced
box with an additional borderline
:
documentclass{book}
usepackage[explicit]{titlesec}
usepackage[many]{tcolorbox}
definecolor{myCyan}{HTML}{13C39D}
titleformat{chapter}[display]
{sffamilybfseriesHugefilcenter}
{}
{0pt}
{%
begin{tcolorbox}[
enhanced,
colback=myCyan,
colframe=myCyan,
boxsep=5pt,
sharp corners,
borderline={1.5pt}{3pt}{white},
colupper=white,
fontupper=sffamilybfseriesHuge,
halign upper=center
]
thechapter. #1
end{tcolorbox}%
}
titlespacing*{chapter}{0pt}{0cm}{0cm}
usepackage{lipsum}
begin{document}
chapter{Lorem lipsum}
lipsum[1]
end{document}
answered Apr 8 at 7:48
IgnasiIgnasi
96.1k5176321
96.1k5176321
Thanks sir, I really appreciate it.
– Ravi
Apr 8 at 7:53
add a comment |
Thanks sir, I really appreciate it.
– Ravi
Apr 8 at 7:53
Thanks sir, I really appreciate it.
– Ravi
Apr 8 at 7:53
Thanks sir, I really appreciate it.
– Ravi
Apr 8 at 7:53
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f483519%2fhow-to-add-double-frame-in-tcolorbox%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
So all of your chapters are not numbered?
– JouleV
Apr 6 at 13:39
Yes, numbered. the image which i have provide is just for the demo purpose. Number will be at the begging of the chapter like this : 1. Android Tutorial
– Ravi
Apr 6 at 13:43