Edited book: Multiple authors in one chapter and Table of contents for the same
up vote
2
down vote
favorite
I want to include the author name before the chapter title. I am using the following:
documentclass{book}
usepackage{titlesec}
usepackage{titletoc}
usepackage{lipsum}% just to generate some text
makeatletter
newcommand*l@authors{@dottedtocline{1}{0pt}{0pt}}
makeatother
newcommandchapaut[1]{%
addcontentsline{toc}{authors}{#1}%
{bfseries#1}vskip35pt}
titleformat{chapter}[display]
{normalfonthugebfseries}{}{20pt}{Huge}[addvspace{5pt}]
titlespacing*{chapter}
{0pt}{10pt}{0pt}
titlecontents{chapter}
[0pt]{addvspace{10pt}}{bfseries}{bfseries}{}
begin{document}
tableofcontents
chapter{Test chapter one}
chapaut{The name of the first author, The name of second author and The name of the third author}
lipsum[1-20]
chapter{Test chapter two}
chapaut{The First author and The second author}
lipsum[1-20]
end{document}
I want to change chapter with chapaut, so it will look like:
Also, in the table of contents:
table-of-contents chapters author-number tocstyle authorindex
|
show 10 more comments
up vote
2
down vote
favorite
I want to include the author name before the chapter title. I am using the following:
documentclass{book}
usepackage{titlesec}
usepackage{titletoc}
usepackage{lipsum}% just to generate some text
makeatletter
newcommand*l@authors{@dottedtocline{1}{0pt}{0pt}}
makeatother
newcommandchapaut[1]{%
addcontentsline{toc}{authors}{#1}%
{bfseries#1}vskip35pt}
titleformat{chapter}[display]
{normalfonthugebfseries}{}{20pt}{Huge}[addvspace{5pt}]
titlespacing*{chapter}
{0pt}{10pt}{0pt}
titlecontents{chapter}
[0pt]{addvspace{10pt}}{bfseries}{bfseries}{}
begin{document}
tableofcontents
chapter{Test chapter one}
chapaut{The name of the first author, The name of second author and The name of the third author}
lipsum[1-20]
chapter{Test chapter two}
chapaut{The First author and The second author}
lipsum[1-20]
end{document}
I want to change chapter with chapaut, so it will look like:
Also, in the table of contents:
table-of-contents chapters author-number tocstyle authorindex
drives me nuts, not sure want you mean. Can you please show me a code example
– mvp285286
May 29 '16 at 7:18
Is the problem resolved?
– Runar
May 29 '16 at 20:51
thank you for your example. But my problem isn't solved yet. Your code is good, but very complex :-) Is it possible to change my code, I just want to change the chapter with the author name like the img above
– mvp285286
May 30 '16 at 14:30
I simplified the code, removed some unused packages and some other code, and added a lot of comments to make sense of the code. Does it help?
– Runar
May 30 '16 at 20:55
awesome! thx, it works fine
– mvp285286
May 31 '16 at 9:49
|
show 10 more comments
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I want to include the author name before the chapter title. I am using the following:
documentclass{book}
usepackage{titlesec}
usepackage{titletoc}
usepackage{lipsum}% just to generate some text
makeatletter
newcommand*l@authors{@dottedtocline{1}{0pt}{0pt}}
makeatother
newcommandchapaut[1]{%
addcontentsline{toc}{authors}{#1}%
{bfseries#1}vskip35pt}
titleformat{chapter}[display]
{normalfonthugebfseries}{}{20pt}{Huge}[addvspace{5pt}]
titlespacing*{chapter}
{0pt}{10pt}{0pt}
titlecontents{chapter}
[0pt]{addvspace{10pt}}{bfseries}{bfseries}{}
begin{document}
tableofcontents
chapter{Test chapter one}
chapaut{The name of the first author, The name of second author and The name of the third author}
lipsum[1-20]
chapter{Test chapter two}
chapaut{The First author and The second author}
lipsum[1-20]
end{document}
I want to change chapter with chapaut, so it will look like:
Also, in the table of contents:
table-of-contents chapters author-number tocstyle authorindex
I want to include the author name before the chapter title. I am using the following:
documentclass{book}
usepackage{titlesec}
usepackage{titletoc}
usepackage{lipsum}% just to generate some text
makeatletter
newcommand*l@authors{@dottedtocline{1}{0pt}{0pt}}
makeatother
newcommandchapaut[1]{%
addcontentsline{toc}{authors}{#1}%
{bfseries#1}vskip35pt}
titleformat{chapter}[display]
{normalfonthugebfseries}{}{20pt}{Huge}[addvspace{5pt}]
titlespacing*{chapter}
{0pt}{10pt}{0pt}
titlecontents{chapter}
[0pt]{addvspace{10pt}}{bfseries}{bfseries}{}
begin{document}
tableofcontents
chapter{Test chapter one}
chapaut{The name of the first author, The name of second author and The name of the third author}
lipsum[1-20]
chapter{Test chapter two}
chapaut{The First author and The second author}
lipsum[1-20]
end{document}
I want to change chapter with chapaut, so it will look like:
Also, in the table of contents:
table-of-contents chapters author-number tocstyle authorindex
table-of-contents chapters author-number tocstyle authorindex
edited 2 days ago
Wings
289
289
asked May 29 '16 at 6:51
mvp285286
1398
1398
drives me nuts, not sure want you mean. Can you please show me a code example
– mvp285286
May 29 '16 at 7:18
Is the problem resolved?
– Runar
May 29 '16 at 20:51
thank you for your example. But my problem isn't solved yet. Your code is good, but very complex :-) Is it possible to change my code, I just want to change the chapter with the author name like the img above
– mvp285286
May 30 '16 at 14:30
I simplified the code, removed some unused packages and some other code, and added a lot of comments to make sense of the code. Does it help?
– Runar
May 30 '16 at 20:55
awesome! thx, it works fine
– mvp285286
May 31 '16 at 9:49
|
show 10 more comments
drives me nuts, not sure want you mean. Can you please show me a code example
– mvp285286
May 29 '16 at 7:18
Is the problem resolved?
– Runar
May 29 '16 at 20:51
thank you for your example. But my problem isn't solved yet. Your code is good, but very complex :-) Is it possible to change my code, I just want to change the chapter with the author name like the img above
– mvp285286
May 30 '16 at 14:30
I simplified the code, removed some unused packages and some other code, and added a lot of comments to make sense of the code. Does it help?
– Runar
May 30 '16 at 20:55
awesome! thx, it works fine
– mvp285286
May 31 '16 at 9:49
drives me nuts, not sure want you mean. Can you please show me a code example
– mvp285286
May 29 '16 at 7:18
drives me nuts, not sure want you mean. Can you please show me a code example
– mvp285286
May 29 '16 at 7:18
Is the problem resolved?
– Runar
May 29 '16 at 20:51
Is the problem resolved?
– Runar
May 29 '16 at 20:51
thank you for your example. But my problem isn't solved yet. Your code is good, but very complex :-) Is it possible to change my code, I just want to change the chapter with the author name like the img above
– mvp285286
May 30 '16 at 14:30
thank you for your example. But my problem isn't solved yet. Your code is good, but very complex :-) Is it possible to change my code, I just want to change the chapter with the author name like the img above
– mvp285286
May 30 '16 at 14:30
I simplified the code, removed some unused packages and some other code, and added a lot of comments to make sense of the code. Does it help?
– Runar
May 30 '16 at 20:55
I simplified the code, removed some unused packages and some other code, and added a lot of comments to make sense of the code. Does it help?
– Runar
May 30 '16 at 20:55
awesome! thx, it works fine
– mvp285286
May 31 '16 at 9:49
awesome! thx, it works fine
– mvp285286
May 31 '16 at 9:49
|
show 10 more comments
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
if I understand you correctly, you want to achieve two things:
In the Tabel of Contents, you would like the author(s) of that chapter to be listed before the title of the chapter.
When the chapter is printed, you would also here, like to have the author(s) before the chapter title.
I think this might help, but I do believe there is a better way to do it, than this, especially for the ToC.
One other way to print the authors on top of the chaptertitle in the text, might be to change the definition of chapter
, but sometimes changing the definition of certain commands might have unforeseen sideeffects, so only do that if you know what you are doing. This question might be of interest: Start new chapter on same page.
EDIT: Really long chaptertitles, spanning multiple lines in the toc, will now be indentet on every line, instead of only the first.
documentclass{book}
usepackage{titletoc}
usepackage{lipsum}% just to generate some text
% This part changes how chapters are displayed in the Table of COntents
titlecontents{chapter}
[0pt]% Left margin, optional
{}% Code insertet above
{bfseries}% Numbered-entryformat
{bfseries}% Numberless-format
{contentspagevskip1.5ex} %Below code, here: add dotfill and pagenumber for entry, and some vertical space between entries
% Custom command to keep the author on the same page of chaptertitle, and above it.
newcommand{chapterAndAuthor}[2]{%
% Takes the following input
% #1: Author
% #2: Chaptertitle
clearpage%
% Minipage to keep the author and chaptertitle on same page
noindentbegin{minipage}{textwidth}
% Set the author style
{bfseries#1}
% Bring the chaptertitle a bit closer to the authrotitle
vspace{-3baselineskip}
% Add an entry to the Table of Contents, with the name of the author in italics and the chapter title
addcontentsline{toc}{chapter}{{normalfontitshape #1}vspace{1ex}newline%
%To make long chapter titles spanning multiple lines indent on each line, a parbox is created. This is siimply a box holding a wrapped paragraph at a certain length. Also, we need to move the dotfill here.
hspace*{1em}protect{parbox[b]{textwidth}{#2 dotfill}}}
% Print the chapter
chapter*{#2}
end{minipage}
}
begin{document}
tableofcontents
clearpage
chapterAndAuthor{The name of the first author, The name of second author and The name of the third author}{Test Chapter One is really long, and I wouldn't really bother to read it as I am falling asleep}
lipsum[1-20]
chapterAndAuthor{John Doe}{Test Chapter Two}
lipsum[1-20]
end{document}
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
if I understand you correctly, you want to achieve two things:
In the Tabel of Contents, you would like the author(s) of that chapter to be listed before the title of the chapter.
When the chapter is printed, you would also here, like to have the author(s) before the chapter title.
I think this might help, but I do believe there is a better way to do it, than this, especially for the ToC.
One other way to print the authors on top of the chaptertitle in the text, might be to change the definition of chapter
, but sometimes changing the definition of certain commands might have unforeseen sideeffects, so only do that if you know what you are doing. This question might be of interest: Start new chapter on same page.
EDIT: Really long chaptertitles, spanning multiple lines in the toc, will now be indentet on every line, instead of only the first.
documentclass{book}
usepackage{titletoc}
usepackage{lipsum}% just to generate some text
% This part changes how chapters are displayed in the Table of COntents
titlecontents{chapter}
[0pt]% Left margin, optional
{}% Code insertet above
{bfseries}% Numbered-entryformat
{bfseries}% Numberless-format
{contentspagevskip1.5ex} %Below code, here: add dotfill and pagenumber for entry, and some vertical space between entries
% Custom command to keep the author on the same page of chaptertitle, and above it.
newcommand{chapterAndAuthor}[2]{%
% Takes the following input
% #1: Author
% #2: Chaptertitle
clearpage%
% Minipage to keep the author and chaptertitle on same page
noindentbegin{minipage}{textwidth}
% Set the author style
{bfseries#1}
% Bring the chaptertitle a bit closer to the authrotitle
vspace{-3baselineskip}
% Add an entry to the Table of Contents, with the name of the author in italics and the chapter title
addcontentsline{toc}{chapter}{{normalfontitshape #1}vspace{1ex}newline%
%To make long chapter titles spanning multiple lines indent on each line, a parbox is created. This is siimply a box holding a wrapped paragraph at a certain length. Also, we need to move the dotfill here.
hspace*{1em}protect{parbox[b]{textwidth}{#2 dotfill}}}
% Print the chapter
chapter*{#2}
end{minipage}
}
begin{document}
tableofcontents
clearpage
chapterAndAuthor{The name of the first author, The name of second author and The name of the third author}{Test Chapter One is really long, and I wouldn't really bother to read it as I am falling asleep}
lipsum[1-20]
chapterAndAuthor{John Doe}{Test Chapter Two}
lipsum[1-20]
end{document}
add a comment |
up vote
5
down vote
accepted
if I understand you correctly, you want to achieve two things:
In the Tabel of Contents, you would like the author(s) of that chapter to be listed before the title of the chapter.
When the chapter is printed, you would also here, like to have the author(s) before the chapter title.
I think this might help, but I do believe there is a better way to do it, than this, especially for the ToC.
One other way to print the authors on top of the chaptertitle in the text, might be to change the definition of chapter
, but sometimes changing the definition of certain commands might have unforeseen sideeffects, so only do that if you know what you are doing. This question might be of interest: Start new chapter on same page.
EDIT: Really long chaptertitles, spanning multiple lines in the toc, will now be indentet on every line, instead of only the first.
documentclass{book}
usepackage{titletoc}
usepackage{lipsum}% just to generate some text
% This part changes how chapters are displayed in the Table of COntents
titlecontents{chapter}
[0pt]% Left margin, optional
{}% Code insertet above
{bfseries}% Numbered-entryformat
{bfseries}% Numberless-format
{contentspagevskip1.5ex} %Below code, here: add dotfill and pagenumber for entry, and some vertical space between entries
% Custom command to keep the author on the same page of chaptertitle, and above it.
newcommand{chapterAndAuthor}[2]{%
% Takes the following input
% #1: Author
% #2: Chaptertitle
clearpage%
% Minipage to keep the author and chaptertitle on same page
noindentbegin{minipage}{textwidth}
% Set the author style
{bfseries#1}
% Bring the chaptertitle a bit closer to the authrotitle
vspace{-3baselineskip}
% Add an entry to the Table of Contents, with the name of the author in italics and the chapter title
addcontentsline{toc}{chapter}{{normalfontitshape #1}vspace{1ex}newline%
%To make long chapter titles spanning multiple lines indent on each line, a parbox is created. This is siimply a box holding a wrapped paragraph at a certain length. Also, we need to move the dotfill here.
hspace*{1em}protect{parbox[b]{textwidth}{#2 dotfill}}}
% Print the chapter
chapter*{#2}
end{minipage}
}
begin{document}
tableofcontents
clearpage
chapterAndAuthor{The name of the first author, The name of second author and The name of the third author}{Test Chapter One is really long, and I wouldn't really bother to read it as I am falling asleep}
lipsum[1-20]
chapterAndAuthor{John Doe}{Test Chapter Two}
lipsum[1-20]
end{document}
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
if I understand you correctly, you want to achieve two things:
In the Tabel of Contents, you would like the author(s) of that chapter to be listed before the title of the chapter.
When the chapter is printed, you would also here, like to have the author(s) before the chapter title.
I think this might help, but I do believe there is a better way to do it, than this, especially for the ToC.
One other way to print the authors on top of the chaptertitle in the text, might be to change the definition of chapter
, but sometimes changing the definition of certain commands might have unforeseen sideeffects, so only do that if you know what you are doing. This question might be of interest: Start new chapter on same page.
EDIT: Really long chaptertitles, spanning multiple lines in the toc, will now be indentet on every line, instead of only the first.
documentclass{book}
usepackage{titletoc}
usepackage{lipsum}% just to generate some text
% This part changes how chapters are displayed in the Table of COntents
titlecontents{chapter}
[0pt]% Left margin, optional
{}% Code insertet above
{bfseries}% Numbered-entryformat
{bfseries}% Numberless-format
{contentspagevskip1.5ex} %Below code, here: add dotfill and pagenumber for entry, and some vertical space between entries
% Custom command to keep the author on the same page of chaptertitle, and above it.
newcommand{chapterAndAuthor}[2]{%
% Takes the following input
% #1: Author
% #2: Chaptertitle
clearpage%
% Minipage to keep the author and chaptertitle on same page
noindentbegin{minipage}{textwidth}
% Set the author style
{bfseries#1}
% Bring the chaptertitle a bit closer to the authrotitle
vspace{-3baselineskip}
% Add an entry to the Table of Contents, with the name of the author in italics and the chapter title
addcontentsline{toc}{chapter}{{normalfontitshape #1}vspace{1ex}newline%
%To make long chapter titles spanning multiple lines indent on each line, a parbox is created. This is siimply a box holding a wrapped paragraph at a certain length. Also, we need to move the dotfill here.
hspace*{1em}protect{parbox[b]{textwidth}{#2 dotfill}}}
% Print the chapter
chapter*{#2}
end{minipage}
}
begin{document}
tableofcontents
clearpage
chapterAndAuthor{The name of the first author, The name of second author and The name of the third author}{Test Chapter One is really long, and I wouldn't really bother to read it as I am falling asleep}
lipsum[1-20]
chapterAndAuthor{John Doe}{Test Chapter Two}
lipsum[1-20]
end{document}
if I understand you correctly, you want to achieve two things:
In the Tabel of Contents, you would like the author(s) of that chapter to be listed before the title of the chapter.
When the chapter is printed, you would also here, like to have the author(s) before the chapter title.
I think this might help, but I do believe there is a better way to do it, than this, especially for the ToC.
One other way to print the authors on top of the chaptertitle in the text, might be to change the definition of chapter
, but sometimes changing the definition of certain commands might have unforeseen sideeffects, so only do that if you know what you are doing. This question might be of interest: Start new chapter on same page.
EDIT: Really long chaptertitles, spanning multiple lines in the toc, will now be indentet on every line, instead of only the first.
documentclass{book}
usepackage{titletoc}
usepackage{lipsum}% just to generate some text
% This part changes how chapters are displayed in the Table of COntents
titlecontents{chapter}
[0pt]% Left margin, optional
{}% Code insertet above
{bfseries}% Numbered-entryformat
{bfseries}% Numberless-format
{contentspagevskip1.5ex} %Below code, here: add dotfill and pagenumber for entry, and some vertical space between entries
% Custom command to keep the author on the same page of chaptertitle, and above it.
newcommand{chapterAndAuthor}[2]{%
% Takes the following input
% #1: Author
% #2: Chaptertitle
clearpage%
% Minipage to keep the author and chaptertitle on same page
noindentbegin{minipage}{textwidth}
% Set the author style
{bfseries#1}
% Bring the chaptertitle a bit closer to the authrotitle
vspace{-3baselineskip}
% Add an entry to the Table of Contents, with the name of the author in italics and the chapter title
addcontentsline{toc}{chapter}{{normalfontitshape #1}vspace{1ex}newline%
%To make long chapter titles spanning multiple lines indent on each line, a parbox is created. This is siimply a box holding a wrapped paragraph at a certain length. Also, we need to move the dotfill here.
hspace*{1em}protect{parbox[b]{textwidth}{#2 dotfill}}}
% Print the chapter
chapter*{#2}
end{minipage}
}
begin{document}
tableofcontents
clearpage
chapterAndAuthor{The name of the first author, The name of second author and The name of the third author}{Test Chapter One is really long, and I wouldn't really bother to read it as I am falling asleep}
lipsum[1-20]
chapterAndAuthor{John Doe}{Test Chapter Two}
lipsum[1-20]
end{document}
edited Apr 13 '17 at 12:34
Community♦
1
1
answered May 29 '16 at 9:16
Runar
5,098730
5,098730
add a comment |
add a comment |
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%2f312046%2fedited-book-multiple-authors-in-one-chapter-and-table-of-contents-for-the-same%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
drives me nuts, not sure want you mean. Can you please show me a code example
– mvp285286
May 29 '16 at 7:18
Is the problem resolved?
– Runar
May 29 '16 at 20:51
thank you for your example. But my problem isn't solved yet. Your code is good, but very complex :-) Is it possible to change my code, I just want to change the chapter with the author name like the img above
– mvp285286
May 30 '16 at 14:30
I simplified the code, removed some unused packages and some other code, and added a lot of comments to make sense of the code. Does it help?
– Runar
May 30 '16 at 20:55
awesome! thx, it works fine
– mvp285286
May 31 '16 at 9:49