Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents
up vote
5
down vote
favorite
I would like to make it so that the vertical space below the title of each chapter is the same when using the Bjornstrup package (i.e. so that the descenders do not affect the spacing - as shown by the red arrow in the picture below). I think I'm fairly happy with the spacing around "A chapter", so I'd really like titles without descenders (e.g. "Contents") to have the same vertical spacing as "A chapter" below the title. I would also like to remove the large "0" in the contents title. Any help appreciated, as always.
documentclass[11pt,a4paper]{book}
% Packages[![enter image description here][1]][1]
usepackage[left=3.5cm, right=3.5cm, top=4.3cm, bottom=4.25cm]{geometry}
usepackage[utf8]{inputenc}
usepackage{libertine}
usepackage[libertine]{newtxmath}
usepackage{MnSymbol}
usepackage{xcolor}
usepackage{scrextend}
usepackage[calcwidth]{titlesec}
usepackage{titleps}
usepackage{microtype}
usepackage[Bjornstrup]{fncychap}
usepackage{tikz}
usepackage{lettrine}
usepackage{enumitem}
usepackage{type1cm}
usepackage{amsthm,thmtools}
usepackage[framemethod=tikz,%
innerleftmargin=0pt
skipabove=0pt,
skipbelow=0pt,
innertopmargin=0pt,
innerrightmargin=0pt,
topline=false,
rightline=false,
bottomline=false,
topline=false,
leftline=false,
innerbottommargin=0pt]{mdframed}
setlength{parindent}{0.67cm}
% Section
% Fonts
protecteddefmathbb#1{text{usefont{U}{msb}{m}{n}#1}}
% Header and Footer
% Chapter
newcommand{chapnumfont}{
usefont{T1}{pnc}{b}{n}
fontsize{100}{100}
selectfont
}
renewcommandDOCH{
settowidth{py}{CNoVthechapter}
addtolength{py}{0pt}
fboxsep=40pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}
kern-pyraise20pt
hbox{color{chapnumcolor}CNoVthechapter}\
}
renewcommandDOTI[1]{
nointerlineskipraggedright
fboxsep=myhi
vskip-1ex
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
renewcommandDOTIS[1]{
fboxsep=0pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}\
nointerlineskipraggedright
fboxsep=myhi
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
makeatother
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newcommand{chaptitle}[1]{
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[align=right,anchor=south east,inner sep=8pt,font=hugenormalfontbfseries] at (0.987linewidth,0) {#1};
node[font=fontsize{60}{62}usefont{OT1}{ptm}{m}{n}selectfontitshapebfseries,text=chapnumcolor] at
(0.975linewidth,2.1) {sloppythechapter};
end{tikzpicture}
}
titleformat{chapter}[display]
{normalfonthugebfseriessffamily}{}{25pt}{chaptitle}
titlespacing*{chapter} {0pt}{-126pt}{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
tikz-pgf table-of-contents chapters titles book-design
add a comment |
up vote
5
down vote
favorite
I would like to make it so that the vertical space below the title of each chapter is the same when using the Bjornstrup package (i.e. so that the descenders do not affect the spacing - as shown by the red arrow in the picture below). I think I'm fairly happy with the spacing around "A chapter", so I'd really like titles without descenders (e.g. "Contents") to have the same vertical spacing as "A chapter" below the title. I would also like to remove the large "0" in the contents title. Any help appreciated, as always.
documentclass[11pt,a4paper]{book}
% Packages[![enter image description here][1]][1]
usepackage[left=3.5cm, right=3.5cm, top=4.3cm, bottom=4.25cm]{geometry}
usepackage[utf8]{inputenc}
usepackage{libertine}
usepackage[libertine]{newtxmath}
usepackage{MnSymbol}
usepackage{xcolor}
usepackage{scrextend}
usepackage[calcwidth]{titlesec}
usepackage{titleps}
usepackage{microtype}
usepackage[Bjornstrup]{fncychap}
usepackage{tikz}
usepackage{lettrine}
usepackage{enumitem}
usepackage{type1cm}
usepackage{amsthm,thmtools}
usepackage[framemethod=tikz,%
innerleftmargin=0pt
skipabove=0pt,
skipbelow=0pt,
innertopmargin=0pt,
innerrightmargin=0pt,
topline=false,
rightline=false,
bottomline=false,
topline=false,
leftline=false,
innerbottommargin=0pt]{mdframed}
setlength{parindent}{0.67cm}
% Section
% Fonts
protecteddefmathbb#1{text{usefont{U}{msb}{m}{n}#1}}
% Header and Footer
% Chapter
newcommand{chapnumfont}{
usefont{T1}{pnc}{b}{n}
fontsize{100}{100}
selectfont
}
renewcommandDOCH{
settowidth{py}{CNoVthechapter}
addtolength{py}{0pt}
fboxsep=40pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}
kern-pyraise20pt
hbox{color{chapnumcolor}CNoVthechapter}\
}
renewcommandDOTI[1]{
nointerlineskipraggedright
fboxsep=myhi
vskip-1ex
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
renewcommandDOTIS[1]{
fboxsep=0pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}\
nointerlineskipraggedright
fboxsep=myhi
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
makeatother
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newcommand{chaptitle}[1]{
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[align=right,anchor=south east,inner sep=8pt,font=hugenormalfontbfseries] at (0.987linewidth,0) {#1};
node[font=fontsize{60}{62}usefont{OT1}{ptm}{m}{n}selectfontitshapebfseries,text=chapnumcolor] at
(0.975linewidth,2.1) {sloppythechapter};
end{tikzpicture}
}
titleformat{chapter}[display]
{normalfonthugebfseriessffamily}{}{25pt}{chaptitle}
titlespacing*{chapter} {0pt}{-126pt}{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
tikz-pgf table-of-contents chapters titles book-design
add a comment |
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I would like to make it so that the vertical space below the title of each chapter is the same when using the Bjornstrup package (i.e. so that the descenders do not affect the spacing - as shown by the red arrow in the picture below). I think I'm fairly happy with the spacing around "A chapter", so I'd really like titles without descenders (e.g. "Contents") to have the same vertical spacing as "A chapter" below the title. I would also like to remove the large "0" in the contents title. Any help appreciated, as always.
documentclass[11pt,a4paper]{book}
% Packages[![enter image description here][1]][1]
usepackage[left=3.5cm, right=3.5cm, top=4.3cm, bottom=4.25cm]{geometry}
usepackage[utf8]{inputenc}
usepackage{libertine}
usepackage[libertine]{newtxmath}
usepackage{MnSymbol}
usepackage{xcolor}
usepackage{scrextend}
usepackage[calcwidth]{titlesec}
usepackage{titleps}
usepackage{microtype}
usepackage[Bjornstrup]{fncychap}
usepackage{tikz}
usepackage{lettrine}
usepackage{enumitem}
usepackage{type1cm}
usepackage{amsthm,thmtools}
usepackage[framemethod=tikz,%
innerleftmargin=0pt
skipabove=0pt,
skipbelow=0pt,
innertopmargin=0pt,
innerrightmargin=0pt,
topline=false,
rightline=false,
bottomline=false,
topline=false,
leftline=false,
innerbottommargin=0pt]{mdframed}
setlength{parindent}{0.67cm}
% Section
% Fonts
protecteddefmathbb#1{text{usefont{U}{msb}{m}{n}#1}}
% Header and Footer
% Chapter
newcommand{chapnumfont}{
usefont{T1}{pnc}{b}{n}
fontsize{100}{100}
selectfont
}
renewcommandDOCH{
settowidth{py}{CNoVthechapter}
addtolength{py}{0pt}
fboxsep=40pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}
kern-pyraise20pt
hbox{color{chapnumcolor}CNoVthechapter}\
}
renewcommandDOTI[1]{
nointerlineskipraggedright
fboxsep=myhi
vskip-1ex
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
renewcommandDOTIS[1]{
fboxsep=0pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}\
nointerlineskipraggedright
fboxsep=myhi
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
makeatother
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newcommand{chaptitle}[1]{
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[align=right,anchor=south east,inner sep=8pt,font=hugenormalfontbfseries] at (0.987linewidth,0) {#1};
node[font=fontsize{60}{62}usefont{OT1}{ptm}{m}{n}selectfontitshapebfseries,text=chapnumcolor] at
(0.975linewidth,2.1) {sloppythechapter};
end{tikzpicture}
}
titleformat{chapter}[display]
{normalfonthugebfseriessffamily}{}{25pt}{chaptitle}
titlespacing*{chapter} {0pt}{-126pt}{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
tikz-pgf table-of-contents chapters titles book-design
I would like to make it so that the vertical space below the title of each chapter is the same when using the Bjornstrup package (i.e. so that the descenders do not affect the spacing - as shown by the red arrow in the picture below). I think I'm fairly happy with the spacing around "A chapter", so I'd really like titles without descenders (e.g. "Contents") to have the same vertical spacing as "A chapter" below the title. I would also like to remove the large "0" in the contents title. Any help appreciated, as always.
documentclass[11pt,a4paper]{book}
% Packages[![enter image description here][1]][1]
usepackage[left=3.5cm, right=3.5cm, top=4.3cm, bottom=4.25cm]{geometry}
usepackage[utf8]{inputenc}
usepackage{libertine}
usepackage[libertine]{newtxmath}
usepackage{MnSymbol}
usepackage{xcolor}
usepackage{scrextend}
usepackage[calcwidth]{titlesec}
usepackage{titleps}
usepackage{microtype}
usepackage[Bjornstrup]{fncychap}
usepackage{tikz}
usepackage{lettrine}
usepackage{enumitem}
usepackage{type1cm}
usepackage{amsthm,thmtools}
usepackage[framemethod=tikz,%
innerleftmargin=0pt
skipabove=0pt,
skipbelow=0pt,
innertopmargin=0pt,
innerrightmargin=0pt,
topline=false,
rightline=false,
bottomline=false,
topline=false,
leftline=false,
innerbottommargin=0pt]{mdframed}
setlength{parindent}{0.67cm}
% Section
% Fonts
protecteddefmathbb#1{text{usefont{U}{msb}{m}{n}#1}}
% Header and Footer
% Chapter
newcommand{chapnumfont}{
usefont{T1}{pnc}{b}{n}
fontsize{100}{100}
selectfont
}
renewcommandDOCH{
settowidth{py}{CNoVthechapter}
addtolength{py}{0pt}
fboxsep=40pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}
kern-pyraise20pt
hbox{color{chapnumcolor}CNoVthechapter}\
}
renewcommandDOTI[1]{
nointerlineskipraggedright
fboxsep=myhi
vskip-1ex
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
renewcommandDOTIS[1]{
fboxsep=0pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}\
nointerlineskipraggedright
fboxsep=myhi
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
makeatother
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newcommand{chaptitle}[1]{
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[align=right,anchor=south east,inner sep=8pt,font=hugenormalfontbfseries] at (0.987linewidth,0) {#1};
node[font=fontsize{60}{62}usefont{OT1}{ptm}{m}{n}selectfontitshapebfseries,text=chapnumcolor] at
(0.975linewidth,2.1) {sloppythechapter};
end{tikzpicture}
}
titleformat{chapter}[display]
{normalfonthugebfseriessffamily}{}{25pt}{chaptitle}
titlespacing*{chapter} {0pt}{-126pt}{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
tikz-pgf table-of-contents chapters titles book-design
tikz-pgf table-of-contents chapters titles book-design
edited Dec 7 at 16:53
asked Dec 6 at 21:41
wrb98
19119
19119
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
I would refrain from writing two different commands. If you ever want to adjust the appearance, you'll have to do it twice. TikZ has pgfkeys which allow you to switch the numbering on with a simple tikzset{title number=true}
and off with tikzset{title number=false}
. And to keep the distance the same, you only need to add an appropriate text depth.
documentclass[11pt,a4paper]{book}
% Packages[![enter image description here][1]][1]
usepackage[left=3.5cm, right=3.5cm, top=4.3cm, bottom=4.25cm]{geometry}
usepackage[utf8]{inputenc}
usepackage{libertine}
usepackage[libertine]{newtxmath}
usepackage{MnSymbol}
usepackage{xcolor}
usepackage{scrextend}
usepackage[calcwidth]{titlesec}
usepackage{titleps}
usepackage{microtype}
usepackage[Bjornstrup]{fncychap}
usepackage{tikz}
usepackage{lettrine}
usepackage{enumitem}
usepackage{type1cm}
%usepackage{amsthm,thmtools} % see https://tex.stackexchange.com/a/41551/121799
usepackage[framemethod=tikz,%
innerleftmargin=0pt
skipabove=0pt,
skipbelow=0pt,
innertopmargin=0pt,
innerrightmargin=0pt,
topline=false,
rightline=false,
bottomline=false,
topline=false,
leftline=false,
innerbottommargin=0pt]{mdframed}
setlength{parindent}{0.67cm}
% Section
% Fonts
protecteddefmathbb#1{text{usefont{U}{msb}{m}{n}#1}}
% Header and Footer
% Chapter
newcommand{chapnumfont}{
usefont{T1}{pnc}{b}{n}
fontsize{100}{100}
selectfont
}
renewcommandDOCH{
settowidth{py}{CNoVthechapter}
addtolength{py}{0pt}
fboxsep=40pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}
kern-pyraise20pt
hbox{color{chapnumcolor}CNoVthechapter}\
}
renewcommandDOTI[1]{
nointerlineskipraggedright
fboxsep=myhi
vskip-1ex
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
renewcommandDOTIS[1]{
fboxsep=0pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}\
nointerlineskipraggedright
fboxsep=myhi
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
makeatother
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newififShowTitleNo
tikzset{title number/.is if=ShowTitleNo}
tikzset{title number=false}
newcommand{chaptitle}[1]{
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[align=right,text depth=0.25ex,anchor=south east,inner sep=8pt,font=hugenormalfontbfseries] at (0.987linewidth,0) {#1};
ifShowTitleNo
node[font=fontsize{60}{62}usefont{OT1}{ptm}{m}{n}selectfontitshapebfseries,text=chapnumcolor] at
(0.975linewidth,2.1) {sloppythechapter};
fi
end{tikzpicture}
}
titleformat{chapter}[display]
{normalfonthugebfseriessffamily}{}{25pt}{chaptitle}
titlespacing*{chapter} {0pt}{-126pt}{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
tikzset{title number=true}
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
add a comment |
up vote
5
down vote
It's not necessary to load fncychap
(is it ever?), as you're completely redefining the chapter heading with titlesec
.
The number can be get rid of by defining different styles for numbered and unnumbered chapters.
% openany to make a side by side picture
documentclass[11pt,a4paper,openany]{book}
usepackage{titlesec}
usepackage{titleps}
usepackage{tikz}
newcommand{chapnumfont}{%
fontsize{100}{100}usefont{T1}{ptm}{b}{n}%
}
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newcommand{chaptitlenumbered}[1]{%
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[
align=right,
anchor=south east,
inner sep=8pt,
font=hugenormalfontbfseries
] at (0.987linewidth,0) {strut#1};
node[
align=right,
font=fontsize{60}{62}usefont{OT1}{ptm}{b}{it},
text=chapnumcolor
] at (0.975linewidth,2.1) {thechapter};
end{tikzpicture}%
}
newcommand{chaptitleunnumbered}[1]{%
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[
align=right,
anchor=south east,
inner sep=8pt,
font=hugenormalfontbfseries
] at (0.987linewidth,0) {strut#1};
end{tikzpicture}%
}
titleformat{name=chapter}[display]
{normalfonthugebfseriessffamily}
{}
{0pt}
{chaptitlenumbered}
titleformat{name=chapter,numberless}[display]
{normalfonthugebfseriessffamily}
{}
{25pt}
{chaptitleunnumbered}
titlespacing*{chapter}
{0pt}
{-126pt}
{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
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',
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%2f463598%2ftitle-spacing-in-bjornstrup-chapter-removing-chapter-number-from-contents%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
up vote
1
down vote
accepted
I would refrain from writing two different commands. If you ever want to adjust the appearance, you'll have to do it twice. TikZ has pgfkeys which allow you to switch the numbering on with a simple tikzset{title number=true}
and off with tikzset{title number=false}
. And to keep the distance the same, you only need to add an appropriate text depth.
documentclass[11pt,a4paper]{book}
% Packages[![enter image description here][1]][1]
usepackage[left=3.5cm, right=3.5cm, top=4.3cm, bottom=4.25cm]{geometry}
usepackage[utf8]{inputenc}
usepackage{libertine}
usepackage[libertine]{newtxmath}
usepackage{MnSymbol}
usepackage{xcolor}
usepackage{scrextend}
usepackage[calcwidth]{titlesec}
usepackage{titleps}
usepackage{microtype}
usepackage[Bjornstrup]{fncychap}
usepackage{tikz}
usepackage{lettrine}
usepackage{enumitem}
usepackage{type1cm}
%usepackage{amsthm,thmtools} % see https://tex.stackexchange.com/a/41551/121799
usepackage[framemethod=tikz,%
innerleftmargin=0pt
skipabove=0pt,
skipbelow=0pt,
innertopmargin=0pt,
innerrightmargin=0pt,
topline=false,
rightline=false,
bottomline=false,
topline=false,
leftline=false,
innerbottommargin=0pt]{mdframed}
setlength{parindent}{0.67cm}
% Section
% Fonts
protecteddefmathbb#1{text{usefont{U}{msb}{m}{n}#1}}
% Header and Footer
% Chapter
newcommand{chapnumfont}{
usefont{T1}{pnc}{b}{n}
fontsize{100}{100}
selectfont
}
renewcommandDOCH{
settowidth{py}{CNoVthechapter}
addtolength{py}{0pt}
fboxsep=40pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}
kern-pyraise20pt
hbox{color{chapnumcolor}CNoVthechapter}\
}
renewcommandDOTI[1]{
nointerlineskipraggedright
fboxsep=myhi
vskip-1ex
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
renewcommandDOTIS[1]{
fboxsep=0pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}\
nointerlineskipraggedright
fboxsep=myhi
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
makeatother
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newififShowTitleNo
tikzset{title number/.is if=ShowTitleNo}
tikzset{title number=false}
newcommand{chaptitle}[1]{
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[align=right,text depth=0.25ex,anchor=south east,inner sep=8pt,font=hugenormalfontbfseries] at (0.987linewidth,0) {#1};
ifShowTitleNo
node[font=fontsize{60}{62}usefont{OT1}{ptm}{m}{n}selectfontitshapebfseries,text=chapnumcolor] at
(0.975linewidth,2.1) {sloppythechapter};
fi
end{tikzpicture}
}
titleformat{chapter}[display]
{normalfonthugebfseriessffamily}{}{25pt}{chaptitle}
titlespacing*{chapter} {0pt}{-126pt}{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
tikzset{title number=true}
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
add a comment |
up vote
1
down vote
accepted
I would refrain from writing two different commands. If you ever want to adjust the appearance, you'll have to do it twice. TikZ has pgfkeys which allow you to switch the numbering on with a simple tikzset{title number=true}
and off with tikzset{title number=false}
. And to keep the distance the same, you only need to add an appropriate text depth.
documentclass[11pt,a4paper]{book}
% Packages[![enter image description here][1]][1]
usepackage[left=3.5cm, right=3.5cm, top=4.3cm, bottom=4.25cm]{geometry}
usepackage[utf8]{inputenc}
usepackage{libertine}
usepackage[libertine]{newtxmath}
usepackage{MnSymbol}
usepackage{xcolor}
usepackage{scrextend}
usepackage[calcwidth]{titlesec}
usepackage{titleps}
usepackage{microtype}
usepackage[Bjornstrup]{fncychap}
usepackage{tikz}
usepackage{lettrine}
usepackage{enumitem}
usepackage{type1cm}
%usepackage{amsthm,thmtools} % see https://tex.stackexchange.com/a/41551/121799
usepackage[framemethod=tikz,%
innerleftmargin=0pt
skipabove=0pt,
skipbelow=0pt,
innertopmargin=0pt,
innerrightmargin=0pt,
topline=false,
rightline=false,
bottomline=false,
topline=false,
leftline=false,
innerbottommargin=0pt]{mdframed}
setlength{parindent}{0.67cm}
% Section
% Fonts
protecteddefmathbb#1{text{usefont{U}{msb}{m}{n}#1}}
% Header and Footer
% Chapter
newcommand{chapnumfont}{
usefont{T1}{pnc}{b}{n}
fontsize{100}{100}
selectfont
}
renewcommandDOCH{
settowidth{py}{CNoVthechapter}
addtolength{py}{0pt}
fboxsep=40pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}
kern-pyraise20pt
hbox{color{chapnumcolor}CNoVthechapter}\
}
renewcommandDOTI[1]{
nointerlineskipraggedright
fboxsep=myhi
vskip-1ex
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
renewcommandDOTIS[1]{
fboxsep=0pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}\
nointerlineskipraggedright
fboxsep=myhi
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
makeatother
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newififShowTitleNo
tikzset{title number/.is if=ShowTitleNo}
tikzset{title number=false}
newcommand{chaptitle}[1]{
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[align=right,text depth=0.25ex,anchor=south east,inner sep=8pt,font=hugenormalfontbfseries] at (0.987linewidth,0) {#1};
ifShowTitleNo
node[font=fontsize{60}{62}usefont{OT1}{ptm}{m}{n}selectfontitshapebfseries,text=chapnumcolor] at
(0.975linewidth,2.1) {sloppythechapter};
fi
end{tikzpicture}
}
titleformat{chapter}[display]
{normalfonthugebfseriessffamily}{}{25pt}{chaptitle}
titlespacing*{chapter} {0pt}{-126pt}{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
tikzset{title number=true}
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
add a comment |
up vote
1
down vote
accepted
up vote
1
down vote
accepted
I would refrain from writing two different commands. If you ever want to adjust the appearance, you'll have to do it twice. TikZ has pgfkeys which allow you to switch the numbering on with a simple tikzset{title number=true}
and off with tikzset{title number=false}
. And to keep the distance the same, you only need to add an appropriate text depth.
documentclass[11pt,a4paper]{book}
% Packages[![enter image description here][1]][1]
usepackage[left=3.5cm, right=3.5cm, top=4.3cm, bottom=4.25cm]{geometry}
usepackage[utf8]{inputenc}
usepackage{libertine}
usepackage[libertine]{newtxmath}
usepackage{MnSymbol}
usepackage{xcolor}
usepackage{scrextend}
usepackage[calcwidth]{titlesec}
usepackage{titleps}
usepackage{microtype}
usepackage[Bjornstrup]{fncychap}
usepackage{tikz}
usepackage{lettrine}
usepackage{enumitem}
usepackage{type1cm}
%usepackage{amsthm,thmtools} % see https://tex.stackexchange.com/a/41551/121799
usepackage[framemethod=tikz,%
innerleftmargin=0pt
skipabove=0pt,
skipbelow=0pt,
innertopmargin=0pt,
innerrightmargin=0pt,
topline=false,
rightline=false,
bottomline=false,
topline=false,
leftline=false,
innerbottommargin=0pt]{mdframed}
setlength{parindent}{0.67cm}
% Section
% Fonts
protecteddefmathbb#1{text{usefont{U}{msb}{m}{n}#1}}
% Header and Footer
% Chapter
newcommand{chapnumfont}{
usefont{T1}{pnc}{b}{n}
fontsize{100}{100}
selectfont
}
renewcommandDOCH{
settowidth{py}{CNoVthechapter}
addtolength{py}{0pt}
fboxsep=40pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}
kern-pyraise20pt
hbox{color{chapnumcolor}CNoVthechapter}\
}
renewcommandDOTI[1]{
nointerlineskipraggedright
fboxsep=myhi
vskip-1ex
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
renewcommandDOTIS[1]{
fboxsep=0pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}\
nointerlineskipraggedright
fboxsep=myhi
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
makeatother
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newififShowTitleNo
tikzset{title number/.is if=ShowTitleNo}
tikzset{title number=false}
newcommand{chaptitle}[1]{
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[align=right,text depth=0.25ex,anchor=south east,inner sep=8pt,font=hugenormalfontbfseries] at (0.987linewidth,0) {#1};
ifShowTitleNo
node[font=fontsize{60}{62}usefont{OT1}{ptm}{m}{n}selectfontitshapebfseries,text=chapnumcolor] at
(0.975linewidth,2.1) {sloppythechapter};
fi
end{tikzpicture}
}
titleformat{chapter}[display]
{normalfonthugebfseriessffamily}{}{25pt}{chaptitle}
titlespacing*{chapter} {0pt}{-126pt}{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
tikzset{title number=true}
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
I would refrain from writing two different commands. If you ever want to adjust the appearance, you'll have to do it twice. TikZ has pgfkeys which allow you to switch the numbering on with a simple tikzset{title number=true}
and off with tikzset{title number=false}
. And to keep the distance the same, you only need to add an appropriate text depth.
documentclass[11pt,a4paper]{book}
% Packages[![enter image description here][1]][1]
usepackage[left=3.5cm, right=3.5cm, top=4.3cm, bottom=4.25cm]{geometry}
usepackage[utf8]{inputenc}
usepackage{libertine}
usepackage[libertine]{newtxmath}
usepackage{MnSymbol}
usepackage{xcolor}
usepackage{scrextend}
usepackage[calcwidth]{titlesec}
usepackage{titleps}
usepackage{microtype}
usepackage[Bjornstrup]{fncychap}
usepackage{tikz}
usepackage{lettrine}
usepackage{enumitem}
usepackage{type1cm}
%usepackage{amsthm,thmtools} % see https://tex.stackexchange.com/a/41551/121799
usepackage[framemethod=tikz,%
innerleftmargin=0pt
skipabove=0pt,
skipbelow=0pt,
innertopmargin=0pt,
innerrightmargin=0pt,
topline=false,
rightline=false,
bottomline=false,
topline=false,
leftline=false,
innerbottommargin=0pt]{mdframed}
setlength{parindent}{0.67cm}
% Section
% Fonts
protecteddefmathbb#1{text{usefont{U}{msb}{m}{n}#1}}
% Header and Footer
% Chapter
newcommand{chapnumfont}{
usefont{T1}{pnc}{b}{n}
fontsize{100}{100}
selectfont
}
renewcommandDOCH{
settowidth{py}{CNoVthechapter}
addtolength{py}{0pt}
fboxsep=40pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}
kern-pyraise20pt
hbox{color{chapnumcolor}CNoVthechapter}\
}
renewcommandDOTI[1]{
nointerlineskipraggedright
fboxsep=myhi
vskip-1ex
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
renewcommandDOTIS[1]{
fboxsep=0pt
colorbox{chapbgcolor}{rule{0pt}{40pt}parbox[b]{textwidth}{hfill}}\
nointerlineskipraggedright
fboxsep=myhi
colorbox{chapbgcolor}{parbox[t]{mylen}{CTVFmTi{#1}}}parnobreak
vskip 40pt
}
makeatother
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newififShowTitleNo
tikzset{title number/.is if=ShowTitleNo}
tikzset{title number=false}
newcommand{chaptitle}[1]{
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[align=right,text depth=0.25ex,anchor=south east,inner sep=8pt,font=hugenormalfontbfseries] at (0.987linewidth,0) {#1};
ifShowTitleNo
node[font=fontsize{60}{62}usefont{OT1}{ptm}{m}{n}selectfontitshapebfseries,text=chapnumcolor] at
(0.975linewidth,2.1) {sloppythechapter};
fi
end{tikzpicture}
}
titleformat{chapter}[display]
{normalfonthugebfseriessffamily}{}{25pt}{chaptitle}
titlespacing*{chapter} {0pt}{-126pt}{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
tikzset{title number=true}
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
answered Dec 9 at 11:20
marmot
83k493178
83k493178
add a comment |
add a comment |
up vote
5
down vote
It's not necessary to load fncychap
(is it ever?), as you're completely redefining the chapter heading with titlesec
.
The number can be get rid of by defining different styles for numbered and unnumbered chapters.
% openany to make a side by side picture
documentclass[11pt,a4paper,openany]{book}
usepackage{titlesec}
usepackage{titleps}
usepackage{tikz}
newcommand{chapnumfont}{%
fontsize{100}{100}usefont{T1}{ptm}{b}{n}%
}
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newcommand{chaptitlenumbered}[1]{%
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[
align=right,
anchor=south east,
inner sep=8pt,
font=hugenormalfontbfseries
] at (0.987linewidth,0) {strut#1};
node[
align=right,
font=fontsize{60}{62}usefont{OT1}{ptm}{b}{it},
text=chapnumcolor
] at (0.975linewidth,2.1) {thechapter};
end{tikzpicture}%
}
newcommand{chaptitleunnumbered}[1]{%
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[
align=right,
anchor=south east,
inner sep=8pt,
font=hugenormalfontbfseries
] at (0.987linewidth,0) {strut#1};
end{tikzpicture}%
}
titleformat{name=chapter}[display]
{normalfonthugebfseriessffamily}
{}
{0pt}
{chaptitlenumbered}
titleformat{name=chapter,numberless}[display]
{normalfonthugebfseriessffamily}
{}
{25pt}
{chaptitleunnumbered}
titlespacing*{chapter}
{0pt}
{-126pt}
{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
add a comment |
up vote
5
down vote
It's not necessary to load fncychap
(is it ever?), as you're completely redefining the chapter heading with titlesec
.
The number can be get rid of by defining different styles for numbered and unnumbered chapters.
% openany to make a side by side picture
documentclass[11pt,a4paper,openany]{book}
usepackage{titlesec}
usepackage{titleps}
usepackage{tikz}
newcommand{chapnumfont}{%
fontsize{100}{100}usefont{T1}{ptm}{b}{n}%
}
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newcommand{chaptitlenumbered}[1]{%
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[
align=right,
anchor=south east,
inner sep=8pt,
font=hugenormalfontbfseries
] at (0.987linewidth,0) {strut#1};
node[
align=right,
font=fontsize{60}{62}usefont{OT1}{ptm}{b}{it},
text=chapnumcolor
] at (0.975linewidth,2.1) {thechapter};
end{tikzpicture}%
}
newcommand{chaptitleunnumbered}[1]{%
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[
align=right,
anchor=south east,
inner sep=8pt,
font=hugenormalfontbfseries
] at (0.987linewidth,0) {strut#1};
end{tikzpicture}%
}
titleformat{name=chapter}[display]
{normalfonthugebfseriessffamily}
{}
{0pt}
{chaptitlenumbered}
titleformat{name=chapter,numberless}[display]
{normalfonthugebfseriessffamily}
{}
{25pt}
{chaptitleunnumbered}
titlespacing*{chapter}
{0pt}
{-126pt}
{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
add a comment |
up vote
5
down vote
up vote
5
down vote
It's not necessary to load fncychap
(is it ever?), as you're completely redefining the chapter heading with titlesec
.
The number can be get rid of by defining different styles for numbered and unnumbered chapters.
% openany to make a side by side picture
documentclass[11pt,a4paper,openany]{book}
usepackage{titlesec}
usepackage{titleps}
usepackage{tikz}
newcommand{chapnumfont}{%
fontsize{100}{100}usefont{T1}{ptm}{b}{n}%
}
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newcommand{chaptitlenumbered}[1]{%
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[
align=right,
anchor=south east,
inner sep=8pt,
font=hugenormalfontbfseries
] at (0.987linewidth,0) {strut#1};
node[
align=right,
font=fontsize{60}{62}usefont{OT1}{ptm}{b}{it},
text=chapnumcolor
] at (0.975linewidth,2.1) {thechapter};
end{tikzpicture}%
}
newcommand{chaptitleunnumbered}[1]{%
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[
align=right,
anchor=south east,
inner sep=8pt,
font=hugenormalfontbfseries
] at (0.987linewidth,0) {strut#1};
end{tikzpicture}%
}
titleformat{name=chapter}[display]
{normalfonthugebfseriessffamily}
{}
{0pt}
{chaptitlenumbered}
titleformat{name=chapter,numberless}[display]
{normalfonthugebfseriessffamily}
{}
{25pt}
{chaptitleunnumbered}
titlespacing*{chapter}
{0pt}
{-126pt}
{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
It's not necessary to load fncychap
(is it ever?), as you're completely redefining the chapter heading with titlesec
.
The number can be get rid of by defining different styles for numbered and unnumbered chapters.
% openany to make a side by side picture
documentclass[11pt,a4paper,openany]{book}
usepackage{titlesec}
usepackage{titleps}
usepackage{tikz}
newcommand{chapnumfont}{%
fontsize{100}{100}usefont{T1}{ptm}{b}{n}%
}
colorlet{chapbgcolor}{gray!75}
colorlet{chapnumcolor}{black!60}
newcommand{chaptitlenumbered}[1]{%
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[
align=right,
anchor=south east,
inner sep=8pt,
font=hugenormalfontbfseries
] at (0.987linewidth,0) {strut#1};
node[
align=right,
font=fontsize{60}{62}usefont{OT1}{ptm}{b}{it},
text=chapnumcolor
] at (0.975linewidth,2.1) {thechapter};
end{tikzpicture}%
}
newcommand{chaptitleunnumbered}[1]{%
begin{tikzpicture}
fill[chapbgcolor!70,rounded corners=0pt] (0,2.3) rectangle (linewidth,0);
node[
align=right,
anchor=south east,
inner sep=8pt,
font=hugenormalfontbfseries
] at (0.987linewidth,0) {strut#1};
end{tikzpicture}%
}
titleformat{name=chapter}[display]
{normalfonthugebfseriessffamily}
{}
{0pt}
{chaptitlenumbered}
titleformat{name=chapter,numberless}[display]
{normalfonthugebfseriessffamily}
{}
{25pt}
{chaptitleunnumbered}
titlespacing*{chapter}
{0pt}
{-126pt}
{33pt}
setlengthheadheight{15pt}
begin{document}
tableofcontents
chapter{A chapter}
mbox{}
newpage
More text...
newpage
Even more text...
end{document}
answered Dec 8 at 22:44
egreg
704k8618763155
704k8618763155
add a comment |
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.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- 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%2f463598%2ftitle-spacing-in-bjornstrup-chapter-removing-chapter-number-from-contents%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