Pgfplotstableset, longtable and subcaption











up vote
0
down vote

favorite












I am using pgfplotstableset and longtable to read data from a file and format it into a table composed of several subtables. I have managed to create the table and to include a caption over it. However, I would also like to include a subcaption over each one of the subtables and I have not been able to do it.



The desired output should look like:
Desired output



I have created the table above with caption*. However, I would prefer to use subcaption to maintain the consistency of my references. Below, I include the minimal code, which I have used to create the table above. I have tried replacing caption* with subcaption and I get the following error:



! Package caption Error: subcaption outside float.


Minimal code.
article.tex:



documentclass{article} 
usepackage{conf-simple}
begin{document}
includetable{data/minimal-data.dat}{Minimal data}{minimal-data}
end{document}


conf-simple.sty:



ProvidesPackage{conf-simple}
usepackage{subcaption}
usepackage{pgfplotstable}
usepackage{longtable}
usepackage{booktabs}

pgfplotstableset{
begin table=begin{longtable},
create on use/double/.style={create col/expr={thisrowno{1}*2}},
end table=end{longtable},
}

newcommand{includetable}[3]{

noindentbegin{minipage}{textwidth}
pgfplotstabletypeset[
col sep=space,
header=false,
column type=r,
columns={0,1,double}, % display specified columns
columns/0/.style={string type, column name =},
columns/1/.style={column name=small{Value}},
columns/double/.style={column name=small{Double}},
% requires booktabs to place horiz rules
every head row/.style={before row={caption{#2 label{table:#3}} \ caption*{(a) First subtable} \ toprule
multicolumn{3}{|c|}{Numbers} \ midrule}, after row=midrule},
every last row/.style={after row=bottomrule},
every first column/.style={column type/.add={|}{}},
every column/.style={column type/.add={}{|}},
]{#1}

end{minipage}

noindentbegin{minipage}{textwidth}
pgfplotstabletypeset[col sep=space,
header=false,
columns={0,1}, % display specified columns
columns/0/.style={string type,column name=},
columns/1/.style={column name=small{Value}},
% requires booktabs to place horiz rules
every head row/.style={before row={caption*{(b) Second subtable} \ toprule
multicolumn{2}{|c|}{Numbers} \ midrule }, after row=midrule},
every last row/.style={after row=bottomrule},
every first column/.style={column type/.add={|}{}},
every column/.style={column type/.add={}{|}},
]{#1}
end{minipage}

}

end{document}


Minimal data file:



One 1
Two 2
Three 3


As far as I understand, the problem is related to longtable not accepting subcaptions but I do not know how to build my table in a different way.



I have found related questions like this and this but they do not solve my issue.










share|improve this question
























  • How is it possible that article.tex has an end{table} but no begin{table} (and does not have an end{document})? Please consider cleaning up your code such that others can start playing with it.
    – marmot
    Sep 4 at 13:34










  • @marmot I am sorry about the mistake, I have changed it. The rest of the code has been copied directly from the minimal test I ran so there should be no more errors.
    – fa__
    Sep 4 at 13:53















up vote
0
down vote

favorite












I am using pgfplotstableset and longtable to read data from a file and format it into a table composed of several subtables. I have managed to create the table and to include a caption over it. However, I would also like to include a subcaption over each one of the subtables and I have not been able to do it.



The desired output should look like:
Desired output



I have created the table above with caption*. However, I would prefer to use subcaption to maintain the consistency of my references. Below, I include the minimal code, which I have used to create the table above. I have tried replacing caption* with subcaption and I get the following error:



! Package caption Error: subcaption outside float.


Minimal code.
article.tex:



documentclass{article} 
usepackage{conf-simple}
begin{document}
includetable{data/minimal-data.dat}{Minimal data}{minimal-data}
end{document}


conf-simple.sty:



ProvidesPackage{conf-simple}
usepackage{subcaption}
usepackage{pgfplotstable}
usepackage{longtable}
usepackage{booktabs}

pgfplotstableset{
begin table=begin{longtable},
create on use/double/.style={create col/expr={thisrowno{1}*2}},
end table=end{longtable},
}

newcommand{includetable}[3]{

noindentbegin{minipage}{textwidth}
pgfplotstabletypeset[
col sep=space,
header=false,
column type=r,
columns={0,1,double}, % display specified columns
columns/0/.style={string type, column name =},
columns/1/.style={column name=small{Value}},
columns/double/.style={column name=small{Double}},
% requires booktabs to place horiz rules
every head row/.style={before row={caption{#2 label{table:#3}} \ caption*{(a) First subtable} \ toprule
multicolumn{3}{|c|}{Numbers} \ midrule}, after row=midrule},
every last row/.style={after row=bottomrule},
every first column/.style={column type/.add={|}{}},
every column/.style={column type/.add={}{|}},
]{#1}

end{minipage}

noindentbegin{minipage}{textwidth}
pgfplotstabletypeset[col sep=space,
header=false,
columns={0,1}, % display specified columns
columns/0/.style={string type,column name=},
columns/1/.style={column name=small{Value}},
% requires booktabs to place horiz rules
every head row/.style={before row={caption*{(b) Second subtable} \ toprule
multicolumn{2}{|c|}{Numbers} \ midrule }, after row=midrule},
every last row/.style={after row=bottomrule},
every first column/.style={column type/.add={|}{}},
every column/.style={column type/.add={}{|}},
]{#1}
end{minipage}

}

end{document}


Minimal data file:



One 1
Two 2
Three 3


As far as I understand, the problem is related to longtable not accepting subcaptions but I do not know how to build my table in a different way.



I have found related questions like this and this but they do not solve my issue.










share|improve this question
























  • How is it possible that article.tex has an end{table} but no begin{table} (and does not have an end{document})? Please consider cleaning up your code such that others can start playing with it.
    – marmot
    Sep 4 at 13:34










  • @marmot I am sorry about the mistake, I have changed it. The rest of the code has been copied directly from the minimal test I ran so there should be no more errors.
    – fa__
    Sep 4 at 13:53













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I am using pgfplotstableset and longtable to read data from a file and format it into a table composed of several subtables. I have managed to create the table and to include a caption over it. However, I would also like to include a subcaption over each one of the subtables and I have not been able to do it.



The desired output should look like:
Desired output



I have created the table above with caption*. However, I would prefer to use subcaption to maintain the consistency of my references. Below, I include the minimal code, which I have used to create the table above. I have tried replacing caption* with subcaption and I get the following error:



! Package caption Error: subcaption outside float.


Minimal code.
article.tex:



documentclass{article} 
usepackage{conf-simple}
begin{document}
includetable{data/minimal-data.dat}{Minimal data}{minimal-data}
end{document}


conf-simple.sty:



ProvidesPackage{conf-simple}
usepackage{subcaption}
usepackage{pgfplotstable}
usepackage{longtable}
usepackage{booktabs}

pgfplotstableset{
begin table=begin{longtable},
create on use/double/.style={create col/expr={thisrowno{1}*2}},
end table=end{longtable},
}

newcommand{includetable}[3]{

noindentbegin{minipage}{textwidth}
pgfplotstabletypeset[
col sep=space,
header=false,
column type=r,
columns={0,1,double}, % display specified columns
columns/0/.style={string type, column name =},
columns/1/.style={column name=small{Value}},
columns/double/.style={column name=small{Double}},
% requires booktabs to place horiz rules
every head row/.style={before row={caption{#2 label{table:#3}} \ caption*{(a) First subtable} \ toprule
multicolumn{3}{|c|}{Numbers} \ midrule}, after row=midrule},
every last row/.style={after row=bottomrule},
every first column/.style={column type/.add={|}{}},
every column/.style={column type/.add={}{|}},
]{#1}

end{minipage}

noindentbegin{minipage}{textwidth}
pgfplotstabletypeset[col sep=space,
header=false,
columns={0,1}, % display specified columns
columns/0/.style={string type,column name=},
columns/1/.style={column name=small{Value}},
% requires booktabs to place horiz rules
every head row/.style={before row={caption*{(b) Second subtable} \ toprule
multicolumn{2}{|c|}{Numbers} \ midrule }, after row=midrule},
every last row/.style={after row=bottomrule},
every first column/.style={column type/.add={|}{}},
every column/.style={column type/.add={}{|}},
]{#1}
end{minipage}

}

end{document}


Minimal data file:



One 1
Two 2
Three 3


As far as I understand, the problem is related to longtable not accepting subcaptions but I do not know how to build my table in a different way.



I have found related questions like this and this but they do not solve my issue.










share|improve this question















I am using pgfplotstableset and longtable to read data from a file and format it into a table composed of several subtables. I have managed to create the table and to include a caption over it. However, I would also like to include a subcaption over each one of the subtables and I have not been able to do it.



The desired output should look like:
Desired output



I have created the table above with caption*. However, I would prefer to use subcaption to maintain the consistency of my references. Below, I include the minimal code, which I have used to create the table above. I have tried replacing caption* with subcaption and I get the following error:



! Package caption Error: subcaption outside float.


Minimal code.
article.tex:



documentclass{article} 
usepackage{conf-simple}
begin{document}
includetable{data/minimal-data.dat}{Minimal data}{minimal-data}
end{document}


conf-simple.sty:



ProvidesPackage{conf-simple}
usepackage{subcaption}
usepackage{pgfplotstable}
usepackage{longtable}
usepackage{booktabs}

pgfplotstableset{
begin table=begin{longtable},
create on use/double/.style={create col/expr={thisrowno{1}*2}},
end table=end{longtable},
}

newcommand{includetable}[3]{

noindentbegin{minipage}{textwidth}
pgfplotstabletypeset[
col sep=space,
header=false,
column type=r,
columns={0,1,double}, % display specified columns
columns/0/.style={string type, column name =},
columns/1/.style={column name=small{Value}},
columns/double/.style={column name=small{Double}},
% requires booktabs to place horiz rules
every head row/.style={before row={caption{#2 label{table:#3}} \ caption*{(a) First subtable} \ toprule
multicolumn{3}{|c|}{Numbers} \ midrule}, after row=midrule},
every last row/.style={after row=bottomrule},
every first column/.style={column type/.add={|}{}},
every column/.style={column type/.add={}{|}},
]{#1}

end{minipage}

noindentbegin{minipage}{textwidth}
pgfplotstabletypeset[col sep=space,
header=false,
columns={0,1}, % display specified columns
columns/0/.style={string type,column name=},
columns/1/.style={column name=small{Value}},
% requires booktabs to place horiz rules
every head row/.style={before row={caption*{(b) Second subtable} \ toprule
multicolumn{2}{|c|}{Numbers} \ midrule }, after row=midrule},
every last row/.style={after row=bottomrule},
every first column/.style={column type/.add={|}{}},
every column/.style={column type/.add={}{|}},
]{#1}
end{minipage}

}

end{document}


Minimal data file:



One 1
Two 2
Three 3


As far as I understand, the problem is related to longtable not accepting subcaptions but I do not know how to build my table in a different way.



I have found related questions like this and this but they do not solve my issue.







longtable pgfplotstable subcaption






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 4 at 21:19









John Kormylo

43.5k12466




43.5k12466










asked Sep 4 at 10:30









fa__

14




14












  • How is it possible that article.tex has an end{table} but no begin{table} (and does not have an end{document})? Please consider cleaning up your code such that others can start playing with it.
    – marmot
    Sep 4 at 13:34










  • @marmot I am sorry about the mistake, I have changed it. The rest of the code has been copied directly from the minimal test I ran so there should be no more errors.
    – fa__
    Sep 4 at 13:53


















  • How is it possible that article.tex has an end{table} but no begin{table} (and does not have an end{document})? Please consider cleaning up your code such that others can start playing with it.
    – marmot
    Sep 4 at 13:34










  • @marmot I am sorry about the mistake, I have changed it. The rest of the code has been copied directly from the minimal test I ran so there should be no more errors.
    – fa__
    Sep 4 at 13:53
















How is it possible that article.tex has an end{table} but no begin{table} (and does not have an end{document})? Please consider cleaning up your code such that others can start playing with it.
– marmot
Sep 4 at 13:34




How is it possible that article.tex has an end{table} but no begin{table} (and does not have an end{document})? Please consider cleaning up your code such that others can start playing with it.
– marmot
Sep 4 at 13:34












@marmot I am sorry about the mistake, I have changed it. The rest of the code has been copied directly from the minimal test I ran so there should be no more errors.
– fa__
Sep 4 at 13:53




@marmot I am sorry about the mistake, I have changed it. The rest of the code has been copied directly from the minimal test I ran so there should be no more errors.
– fa__
Sep 4 at 13:53










1 Answer
1






active

oldest

votes

















up vote
0
down vote













Only use fixsubtable inside a minipage or other group.



documentclass{article}
usepackage{subcaption}
usepackage{longtable}

makeatletter
newcommand{fixsubtable}{letcaption=caption@caption
def@captype{table}}
makeatother

begin{document}

begin{longtable}{@{}c@{}}
caption{No Data}
endhead
endfoot
begin{minipage}{textwidth}
fixsubtable
subcaption{First subtable}
centering
rule{0.25textwidth}{0.25textwidth}
end{minipage}\
end{longtable}

end{document}





share|improve this answer























  • This does work if I place the caption and subcaption at the beginning of the minipage. However if I try to place subcaption in the style before row, as I was doing with the caption I get the error ! Missing endgroup inserted.. Your solution servers me right except for the fact that it increases the blank space between the subcaption and the subtable.
    – fa__
    Sep 5 at 7:28












  • I just noticed the begin table=begin{longtable},. There is no point in using longtable inside a minipage. If you have a subtable that needs to have pagebreaks, that is a more difficult problem.
    – John Kormylo
    Sep 5 at 12:46










  • I am using longtable and pgfplotstableset to process the data from a file in order to create a table with several subtables. I am using a minipage for every one of the subtables. That is, I need pagebreaks between the subtables, not in them.
    – fa__
    Sep 5 at 13:29












  • So stop using begin table=begin{longtable}, etc., which is causing every subtable to use longtable (and consequently disables subcaption again).
    – John Kormylo
    Sep 5 at 13:44













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
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f449238%2fpgfplotstableset-longtable-and-subcaption%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













Only use fixsubtable inside a minipage or other group.



documentclass{article}
usepackage{subcaption}
usepackage{longtable}

makeatletter
newcommand{fixsubtable}{letcaption=caption@caption
def@captype{table}}
makeatother

begin{document}

begin{longtable}{@{}c@{}}
caption{No Data}
endhead
endfoot
begin{minipage}{textwidth}
fixsubtable
subcaption{First subtable}
centering
rule{0.25textwidth}{0.25textwidth}
end{minipage}\
end{longtable}

end{document}





share|improve this answer























  • This does work if I place the caption and subcaption at the beginning of the minipage. However if I try to place subcaption in the style before row, as I was doing with the caption I get the error ! Missing endgroup inserted.. Your solution servers me right except for the fact that it increases the blank space between the subcaption and the subtable.
    – fa__
    Sep 5 at 7:28












  • I just noticed the begin table=begin{longtable},. There is no point in using longtable inside a minipage. If you have a subtable that needs to have pagebreaks, that is a more difficult problem.
    – John Kormylo
    Sep 5 at 12:46










  • I am using longtable and pgfplotstableset to process the data from a file in order to create a table with several subtables. I am using a minipage for every one of the subtables. That is, I need pagebreaks between the subtables, not in them.
    – fa__
    Sep 5 at 13:29












  • So stop using begin table=begin{longtable}, etc., which is causing every subtable to use longtable (and consequently disables subcaption again).
    – John Kormylo
    Sep 5 at 13:44

















up vote
0
down vote













Only use fixsubtable inside a minipage or other group.



documentclass{article}
usepackage{subcaption}
usepackage{longtable}

makeatletter
newcommand{fixsubtable}{letcaption=caption@caption
def@captype{table}}
makeatother

begin{document}

begin{longtable}{@{}c@{}}
caption{No Data}
endhead
endfoot
begin{minipage}{textwidth}
fixsubtable
subcaption{First subtable}
centering
rule{0.25textwidth}{0.25textwidth}
end{minipage}\
end{longtable}

end{document}





share|improve this answer























  • This does work if I place the caption and subcaption at the beginning of the minipage. However if I try to place subcaption in the style before row, as I was doing with the caption I get the error ! Missing endgroup inserted.. Your solution servers me right except for the fact that it increases the blank space between the subcaption and the subtable.
    – fa__
    Sep 5 at 7:28












  • I just noticed the begin table=begin{longtable},. There is no point in using longtable inside a minipage. If you have a subtable that needs to have pagebreaks, that is a more difficult problem.
    – John Kormylo
    Sep 5 at 12:46










  • I am using longtable and pgfplotstableset to process the data from a file in order to create a table with several subtables. I am using a minipage for every one of the subtables. That is, I need pagebreaks between the subtables, not in them.
    – fa__
    Sep 5 at 13:29












  • So stop using begin table=begin{longtable}, etc., which is causing every subtable to use longtable (and consequently disables subcaption again).
    – John Kormylo
    Sep 5 at 13:44















up vote
0
down vote










up vote
0
down vote









Only use fixsubtable inside a minipage or other group.



documentclass{article}
usepackage{subcaption}
usepackage{longtable}

makeatletter
newcommand{fixsubtable}{letcaption=caption@caption
def@captype{table}}
makeatother

begin{document}

begin{longtable}{@{}c@{}}
caption{No Data}
endhead
endfoot
begin{minipage}{textwidth}
fixsubtable
subcaption{First subtable}
centering
rule{0.25textwidth}{0.25textwidth}
end{minipage}\
end{longtable}

end{document}





share|improve this answer














Only use fixsubtable inside a minipage or other group.



documentclass{article}
usepackage{subcaption}
usepackage{longtable}

makeatletter
newcommand{fixsubtable}{letcaption=caption@caption
def@captype{table}}
makeatother

begin{document}

begin{longtable}{@{}c@{}}
caption{No Data}
endhead
endfoot
begin{minipage}{textwidth}
fixsubtable
subcaption{First subtable}
centering
rule{0.25textwidth}{0.25textwidth}
end{minipage}\
end{longtable}

end{document}






share|improve this answer














share|improve this answer



share|improve this answer








edited Sep 4 at 21:44

























answered Sep 4 at 21:39









John Kormylo

43.5k12466




43.5k12466












  • This does work if I place the caption and subcaption at the beginning of the minipage. However if I try to place subcaption in the style before row, as I was doing with the caption I get the error ! Missing endgroup inserted.. Your solution servers me right except for the fact that it increases the blank space between the subcaption and the subtable.
    – fa__
    Sep 5 at 7:28












  • I just noticed the begin table=begin{longtable},. There is no point in using longtable inside a minipage. If you have a subtable that needs to have pagebreaks, that is a more difficult problem.
    – John Kormylo
    Sep 5 at 12:46










  • I am using longtable and pgfplotstableset to process the data from a file in order to create a table with several subtables. I am using a minipage for every one of the subtables. That is, I need pagebreaks between the subtables, not in them.
    – fa__
    Sep 5 at 13:29












  • So stop using begin table=begin{longtable}, etc., which is causing every subtable to use longtable (and consequently disables subcaption again).
    – John Kormylo
    Sep 5 at 13:44




















  • This does work if I place the caption and subcaption at the beginning of the minipage. However if I try to place subcaption in the style before row, as I was doing with the caption I get the error ! Missing endgroup inserted.. Your solution servers me right except for the fact that it increases the blank space between the subcaption and the subtable.
    – fa__
    Sep 5 at 7:28












  • I just noticed the begin table=begin{longtable},. There is no point in using longtable inside a minipage. If you have a subtable that needs to have pagebreaks, that is a more difficult problem.
    – John Kormylo
    Sep 5 at 12:46










  • I am using longtable and pgfplotstableset to process the data from a file in order to create a table with several subtables. I am using a minipage for every one of the subtables. That is, I need pagebreaks between the subtables, not in them.
    – fa__
    Sep 5 at 13:29












  • So stop using begin table=begin{longtable}, etc., which is causing every subtable to use longtable (and consequently disables subcaption again).
    – John Kormylo
    Sep 5 at 13:44


















This does work if I place the caption and subcaption at the beginning of the minipage. However if I try to place subcaption in the style before row, as I was doing with the caption I get the error ! Missing endgroup inserted.. Your solution servers me right except for the fact that it increases the blank space between the subcaption and the subtable.
– fa__
Sep 5 at 7:28






This does work if I place the caption and subcaption at the beginning of the minipage. However if I try to place subcaption in the style before row, as I was doing with the caption I get the error ! Missing endgroup inserted.. Your solution servers me right except for the fact that it increases the blank space between the subcaption and the subtable.
– fa__
Sep 5 at 7:28














I just noticed the begin table=begin{longtable},. There is no point in using longtable inside a minipage. If you have a subtable that needs to have pagebreaks, that is a more difficult problem.
– John Kormylo
Sep 5 at 12:46




I just noticed the begin table=begin{longtable},. There is no point in using longtable inside a minipage. If you have a subtable that needs to have pagebreaks, that is a more difficult problem.
– John Kormylo
Sep 5 at 12:46












I am using longtable and pgfplotstableset to process the data from a file in order to create a table with several subtables. I am using a minipage for every one of the subtables. That is, I need pagebreaks between the subtables, not in them.
– fa__
Sep 5 at 13:29






I am using longtable and pgfplotstableset to process the data from a file in order to create a table with several subtables. I am using a minipage for every one of the subtables. That is, I need pagebreaks between the subtables, not in them.
– fa__
Sep 5 at 13:29














So stop using begin table=begin{longtable}, etc., which is causing every subtable to use longtable (and consequently disables subcaption again).
– John Kormylo
Sep 5 at 13:44






So stop using begin table=begin{longtable}, etc., which is causing every subtable to use longtable (and consequently disables subcaption again).
– John Kormylo
Sep 5 at 13:44




















draft saved

draft discarded




















































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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f449238%2fpgfplotstableset-longtable-and-subcaption%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents