Table of contents numbering arent correct
I am trying to get a table of contents based on the page number (in the footer on the right side) but in some strange way it is counting from the wrong start. It says page 3 instead of 2 and page 4 instead of 3. I have played with the positions of the code but nothing seems to help.
This is my code:
documentclass[11pt, A4]{article}
usepackage[a4paper,top=2cm,hmargin=2cm,bottom=2.9cm,]{geometry}
usepackage{tikz}
usepackage{tikzpagenodes}
usetikzlibrary{calc}
usepackage{fancyhdr}
usepackage{graphicx}
usepackage{xcolor}
usepackage{colortbl}
usepackage[utf8]{inputenc}
usepackage{titletoc}
usepackage[T1]{fontenc}
usepackage{sectsty}
usepackage{float}
usepackage{atbegshi}
makeatletter
renewcommand{@seccntformat}[1]{}
makeatother
renewcommandnumberline[1]{}
setlengthheadheight{48pt}
%lhead{includegraphics[width=5cm]{Afbeeldingen/logo.jpg}}
rhead{}
renewcommand{headrulewidth}{0pt}
renewcommand{contentsname}{Inhoudsopgave}
chapterfont{color[RGB]{227,24,24}}
sectionfont{color[RGB]{227,24,24}}
subsectionfont{color[RGB]{227,24,24}}
definecolor{bcsred}{RGB}{227,24,24}
newcommandFooter{%
begin{tikzpicture}[remember picture, overlay]
node[yshift=1.75cm] at (17, 24.5) {};
draw [line width=0.55mm] (-0.5,-23.5) -- (16.5,-23.5);
node[yshift=1.75cm, text=red] at (1.5, -26) {Test};
node[yshift=1.75cm, text=gray] at (15, -26) {2019-03-21} ;
node[fill=black, text=white, yshift=1.75cm] at (17, -25.5) {thepage};
fill[bcsred]
(current page.south west) -- (current page.south east) --
([yshift=-30pt]current page.south east|-current page text area.south east) --
([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
end{tikzpicture}%
}
pagestyle{fancy}
cfoot{}
AtBeginShipout{Footer}
AtBeginShipoutFirst{}
begin{document}
begin{titlepage}
begin{center}
line(1,0){300}\
[0.25in]
hugebfseries Test \
[2mm]
line(1,0){300}\
[1.5cm]
fontfamily{Arial}selectfont
textscLARGE Test\
[1cm]
textscLarge Test \
[12cm]
end{center}
end{titlepage}
setcounter{page}{2}
%newpage
tableofcontents
newpage
section{Test}
newpage
section{Alerts}
end{document}
table-of-contents
add a comment |
I am trying to get a table of contents based on the page number (in the footer on the right side) but in some strange way it is counting from the wrong start. It says page 3 instead of 2 and page 4 instead of 3. I have played with the positions of the code but nothing seems to help.
This is my code:
documentclass[11pt, A4]{article}
usepackage[a4paper,top=2cm,hmargin=2cm,bottom=2.9cm,]{geometry}
usepackage{tikz}
usepackage{tikzpagenodes}
usetikzlibrary{calc}
usepackage{fancyhdr}
usepackage{graphicx}
usepackage{xcolor}
usepackage{colortbl}
usepackage[utf8]{inputenc}
usepackage{titletoc}
usepackage[T1]{fontenc}
usepackage{sectsty}
usepackage{float}
usepackage{atbegshi}
makeatletter
renewcommand{@seccntformat}[1]{}
makeatother
renewcommandnumberline[1]{}
setlengthheadheight{48pt}
%lhead{includegraphics[width=5cm]{Afbeeldingen/logo.jpg}}
rhead{}
renewcommand{headrulewidth}{0pt}
renewcommand{contentsname}{Inhoudsopgave}
chapterfont{color[RGB]{227,24,24}}
sectionfont{color[RGB]{227,24,24}}
subsectionfont{color[RGB]{227,24,24}}
definecolor{bcsred}{RGB}{227,24,24}
newcommandFooter{%
begin{tikzpicture}[remember picture, overlay]
node[yshift=1.75cm] at (17, 24.5) {};
draw [line width=0.55mm] (-0.5,-23.5) -- (16.5,-23.5);
node[yshift=1.75cm, text=red] at (1.5, -26) {Test};
node[yshift=1.75cm, text=gray] at (15, -26) {2019-03-21} ;
node[fill=black, text=white, yshift=1.75cm] at (17, -25.5) {thepage};
fill[bcsred]
(current page.south west) -- (current page.south east) --
([yshift=-30pt]current page.south east|-current page text area.south east) --
([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
end{tikzpicture}%
}
pagestyle{fancy}
cfoot{}
AtBeginShipout{Footer}
AtBeginShipoutFirst{}
begin{document}
begin{titlepage}
begin{center}
line(1,0){300}\
[0.25in]
hugebfseries Test \
[2mm]
line(1,0){300}\
[1.5cm]
fontfamily{Arial}selectfont
textscLARGE Test\
[1cm]
textscLarge Test \
[12cm]
end{center}
end{titlepage}
setcounter{page}{2}
%newpage
tableofcontents
newpage
section{Test}
newpage
section{Alerts}
end{document}
table-of-contents
You should usea4paper
as class option instead ofA4
.
– JouleV
Mar 25 at 13:49
Welkom bij TeX.SE! There is asetcounter{page}{2}
in your code (just beforetableofcontents
), that might be the problem? Try setting it to1
or just remove the command.
– Marijn
Mar 25 at 14:03
@Marijn I have tried that before, i have tried it to set it to 1 and 0 but nothing seems to work. I also placed it on different places in my code, before tableofcontent and after. On the top of my code and after /document but nothing worked so far. I dont understand why it takes the wrong page number it so confusing. If i change it to 1 then the table of contents is correct but then the page numbering in the footer is wrong and says number 1 on two pages before it goes to 2.
– Stranger543210
Mar 25 at 14:05
add a comment |
I am trying to get a table of contents based on the page number (in the footer on the right side) but in some strange way it is counting from the wrong start. It says page 3 instead of 2 and page 4 instead of 3. I have played with the positions of the code but nothing seems to help.
This is my code:
documentclass[11pt, A4]{article}
usepackage[a4paper,top=2cm,hmargin=2cm,bottom=2.9cm,]{geometry}
usepackage{tikz}
usepackage{tikzpagenodes}
usetikzlibrary{calc}
usepackage{fancyhdr}
usepackage{graphicx}
usepackage{xcolor}
usepackage{colortbl}
usepackage[utf8]{inputenc}
usepackage{titletoc}
usepackage[T1]{fontenc}
usepackage{sectsty}
usepackage{float}
usepackage{atbegshi}
makeatletter
renewcommand{@seccntformat}[1]{}
makeatother
renewcommandnumberline[1]{}
setlengthheadheight{48pt}
%lhead{includegraphics[width=5cm]{Afbeeldingen/logo.jpg}}
rhead{}
renewcommand{headrulewidth}{0pt}
renewcommand{contentsname}{Inhoudsopgave}
chapterfont{color[RGB]{227,24,24}}
sectionfont{color[RGB]{227,24,24}}
subsectionfont{color[RGB]{227,24,24}}
definecolor{bcsred}{RGB}{227,24,24}
newcommandFooter{%
begin{tikzpicture}[remember picture, overlay]
node[yshift=1.75cm] at (17, 24.5) {};
draw [line width=0.55mm] (-0.5,-23.5) -- (16.5,-23.5);
node[yshift=1.75cm, text=red] at (1.5, -26) {Test};
node[yshift=1.75cm, text=gray] at (15, -26) {2019-03-21} ;
node[fill=black, text=white, yshift=1.75cm] at (17, -25.5) {thepage};
fill[bcsred]
(current page.south west) -- (current page.south east) --
([yshift=-30pt]current page.south east|-current page text area.south east) --
([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
end{tikzpicture}%
}
pagestyle{fancy}
cfoot{}
AtBeginShipout{Footer}
AtBeginShipoutFirst{}
begin{document}
begin{titlepage}
begin{center}
line(1,0){300}\
[0.25in]
hugebfseries Test \
[2mm]
line(1,0){300}\
[1.5cm]
fontfamily{Arial}selectfont
textscLARGE Test\
[1cm]
textscLarge Test \
[12cm]
end{center}
end{titlepage}
setcounter{page}{2}
%newpage
tableofcontents
newpage
section{Test}
newpage
section{Alerts}
end{document}
table-of-contents
I am trying to get a table of contents based on the page number (in the footer on the right side) but in some strange way it is counting from the wrong start. It says page 3 instead of 2 and page 4 instead of 3. I have played with the positions of the code but nothing seems to help.
This is my code:
documentclass[11pt, A4]{article}
usepackage[a4paper,top=2cm,hmargin=2cm,bottom=2.9cm,]{geometry}
usepackage{tikz}
usepackage{tikzpagenodes}
usetikzlibrary{calc}
usepackage{fancyhdr}
usepackage{graphicx}
usepackage{xcolor}
usepackage{colortbl}
usepackage[utf8]{inputenc}
usepackage{titletoc}
usepackage[T1]{fontenc}
usepackage{sectsty}
usepackage{float}
usepackage{atbegshi}
makeatletter
renewcommand{@seccntformat}[1]{}
makeatother
renewcommandnumberline[1]{}
setlengthheadheight{48pt}
%lhead{includegraphics[width=5cm]{Afbeeldingen/logo.jpg}}
rhead{}
renewcommand{headrulewidth}{0pt}
renewcommand{contentsname}{Inhoudsopgave}
chapterfont{color[RGB]{227,24,24}}
sectionfont{color[RGB]{227,24,24}}
subsectionfont{color[RGB]{227,24,24}}
definecolor{bcsred}{RGB}{227,24,24}
newcommandFooter{%
begin{tikzpicture}[remember picture, overlay]
node[yshift=1.75cm] at (17, 24.5) {};
draw [line width=0.55mm] (-0.5,-23.5) -- (16.5,-23.5);
node[yshift=1.75cm, text=red] at (1.5, -26) {Test};
node[yshift=1.75cm, text=gray] at (15, -26) {2019-03-21} ;
node[fill=black, text=white, yshift=1.75cm] at (17, -25.5) {thepage};
fill[bcsred]
(current page.south west) -- (current page.south east) --
([yshift=-30pt]current page.south east|-current page text area.south east) --
([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
end{tikzpicture}%
}
pagestyle{fancy}
cfoot{}
AtBeginShipout{Footer}
AtBeginShipoutFirst{}
begin{document}
begin{titlepage}
begin{center}
line(1,0){300}\
[0.25in]
hugebfseries Test \
[2mm]
line(1,0){300}\
[1.5cm]
fontfamily{Arial}selectfont
textscLARGE Test\
[1cm]
textscLarge Test \
[12cm]
end{center}
end{titlepage}
setcounter{page}{2}
%newpage
tableofcontents
newpage
section{Test}
newpage
section{Alerts}
end{document}
table-of-contents
table-of-contents
asked Mar 25 at 13:48
Stranger543210Stranger543210
183
183
You should usea4paper
as class option instead ofA4
.
– JouleV
Mar 25 at 13:49
Welkom bij TeX.SE! There is asetcounter{page}{2}
in your code (just beforetableofcontents
), that might be the problem? Try setting it to1
or just remove the command.
– Marijn
Mar 25 at 14:03
@Marijn I have tried that before, i have tried it to set it to 1 and 0 but nothing seems to work. I also placed it on different places in my code, before tableofcontent and after. On the top of my code and after /document but nothing worked so far. I dont understand why it takes the wrong page number it so confusing. If i change it to 1 then the table of contents is correct but then the page numbering in the footer is wrong and says number 1 on two pages before it goes to 2.
– Stranger543210
Mar 25 at 14:05
add a comment |
You should usea4paper
as class option instead ofA4
.
– JouleV
Mar 25 at 13:49
Welkom bij TeX.SE! There is asetcounter{page}{2}
in your code (just beforetableofcontents
), that might be the problem? Try setting it to1
or just remove the command.
– Marijn
Mar 25 at 14:03
@Marijn I have tried that before, i have tried it to set it to 1 and 0 but nothing seems to work. I also placed it on different places in my code, before tableofcontent and after. On the top of my code and after /document but nothing worked so far. I dont understand why it takes the wrong page number it so confusing. If i change it to 1 then the table of contents is correct but then the page numbering in the footer is wrong and says number 1 on two pages before it goes to 2.
– Stranger543210
Mar 25 at 14:05
You should use
a4paper
as class option instead of A4
.– JouleV
Mar 25 at 13:49
You should use
a4paper
as class option instead of A4
.– JouleV
Mar 25 at 13:49
Welkom bij TeX.SE! There is a
setcounter{page}{2}
in your code (just before tableofcontents
), that might be the problem? Try setting it to 1
or just remove the command.– Marijn
Mar 25 at 14:03
Welkom bij TeX.SE! There is a
setcounter{page}{2}
in your code (just before tableofcontents
), that might be the problem? Try setting it to 1
or just remove the command.– Marijn
Mar 25 at 14:03
@Marijn I have tried that before, i have tried it to set it to 1 and 0 but nothing seems to work. I also placed it on different places in my code, before tableofcontent and after. On the top of my code and after /document but nothing worked so far. I dont understand why it takes the wrong page number it so confusing. If i change it to 1 then the table of contents is correct but then the page numbering in the footer is wrong and says number 1 on two pages before it goes to 2.
– Stranger543210
Mar 25 at 14:05
@Marijn I have tried that before, i have tried it to set it to 1 and 0 but nothing seems to work. I also placed it on different places in my code, before tableofcontent and after. On the top of my code and after /document but nothing worked so far. I dont understand why it takes the wrong page number it so confusing. If i change it to 1 then the table of contents is correct but then the page numbering in the footer is wrong and says number 1 on two pages before it goes to 2.
– Stranger543210
Mar 25 at 14:05
add a comment |
1 Answer
1
active
oldest
votes
The code in the question uses the page number during the AtBeginShipout
call. This is tricky because the page counter is modified by different macros and hooks at various times, which makes it difficult to always get the correct value during page shipout.
As an alternative you can use a custom counter that is displayed and increased in the Footer
macro, which is responsible for the page number in the box, independent from the actual page counter. The 'real' page counter is still used for the numbers in the Table of Contents.
Partial code:
newcounter{mypagenumber}
setcounter{mypagenumber}{1}
newcommandFooter{%
begin{tikzpicture}[remember picture, overlay]
node[yshift=1.75cm] at (17, 24.5) {};
draw [line width=0.55mm] (-0.5,-23.5) -- (16.5,-23.5);
node[yshift=1.75cm, text=red] at (1.5, -26) {Test};
node[yshift=1.75cm, text=gray] at (15, -26) {2019-03-21} ;
node[fill=black, text=white, yshift=1.75cm] at (17, -25.5) {themypagenumber};
fill[bcsred]
(current page.south west) -- (current page.south east) --
([yshift=-30pt]current page.south east|-current page text area.south east) --
([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
end{tikzpicture}%
stepcounter{mypagenumber}
}
Result:
The next pages also show the correct number, consistent with the Table of Contents (i.e., 2, 3, etc., not shown in the screenshot).
Note that there is a different problem with the footer macro that adds an empty page with only a header and footer at the end, but that is most likely unrelated to the page counter issue.
Thanks for your reply, i will check it now
– Stranger543210
Mar 26 at 12:23
I get the following error: Runaway argument? {newcounter {mypagenumber} setcounter {mypagenumber}{1} newcommand ETC. ! File ended while scanning use of @argdef. <inserted text> par <*> rapportage2.tex ? ! Emergency stop. <inserted text> par <*> rapportage2.tex
– Stranger543210
Mar 26 at 12:29
Let's debug in chat, chat.stackexchange.com/rooms/91547/…
– Marijn
Mar 26 at 12:33
i can not talk to you, my reputation is too low :( need 20
– Stranger543210
Mar 26 at 12:35
Thank you it works! found the solution
– Stranger543210
Mar 26 at 12:39
|
show 1 more 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%2f481352%2ftable-of-contents-numbering-arent-correct%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
The code in the question uses the page number during the AtBeginShipout
call. This is tricky because the page counter is modified by different macros and hooks at various times, which makes it difficult to always get the correct value during page shipout.
As an alternative you can use a custom counter that is displayed and increased in the Footer
macro, which is responsible for the page number in the box, independent from the actual page counter. The 'real' page counter is still used for the numbers in the Table of Contents.
Partial code:
newcounter{mypagenumber}
setcounter{mypagenumber}{1}
newcommandFooter{%
begin{tikzpicture}[remember picture, overlay]
node[yshift=1.75cm] at (17, 24.5) {};
draw [line width=0.55mm] (-0.5,-23.5) -- (16.5,-23.5);
node[yshift=1.75cm, text=red] at (1.5, -26) {Test};
node[yshift=1.75cm, text=gray] at (15, -26) {2019-03-21} ;
node[fill=black, text=white, yshift=1.75cm] at (17, -25.5) {themypagenumber};
fill[bcsred]
(current page.south west) -- (current page.south east) --
([yshift=-30pt]current page.south east|-current page text area.south east) --
([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
end{tikzpicture}%
stepcounter{mypagenumber}
}
Result:
The next pages also show the correct number, consistent with the Table of Contents (i.e., 2, 3, etc., not shown in the screenshot).
Note that there is a different problem with the footer macro that adds an empty page with only a header and footer at the end, but that is most likely unrelated to the page counter issue.
Thanks for your reply, i will check it now
– Stranger543210
Mar 26 at 12:23
I get the following error: Runaway argument? {newcounter {mypagenumber} setcounter {mypagenumber}{1} newcommand ETC. ! File ended while scanning use of @argdef. <inserted text> par <*> rapportage2.tex ? ! Emergency stop. <inserted text> par <*> rapportage2.tex
– Stranger543210
Mar 26 at 12:29
Let's debug in chat, chat.stackexchange.com/rooms/91547/…
– Marijn
Mar 26 at 12:33
i can not talk to you, my reputation is too low :( need 20
– Stranger543210
Mar 26 at 12:35
Thank you it works! found the solution
– Stranger543210
Mar 26 at 12:39
|
show 1 more comment
The code in the question uses the page number during the AtBeginShipout
call. This is tricky because the page counter is modified by different macros and hooks at various times, which makes it difficult to always get the correct value during page shipout.
As an alternative you can use a custom counter that is displayed and increased in the Footer
macro, which is responsible for the page number in the box, independent from the actual page counter. The 'real' page counter is still used for the numbers in the Table of Contents.
Partial code:
newcounter{mypagenumber}
setcounter{mypagenumber}{1}
newcommandFooter{%
begin{tikzpicture}[remember picture, overlay]
node[yshift=1.75cm] at (17, 24.5) {};
draw [line width=0.55mm] (-0.5,-23.5) -- (16.5,-23.5);
node[yshift=1.75cm, text=red] at (1.5, -26) {Test};
node[yshift=1.75cm, text=gray] at (15, -26) {2019-03-21} ;
node[fill=black, text=white, yshift=1.75cm] at (17, -25.5) {themypagenumber};
fill[bcsred]
(current page.south west) -- (current page.south east) --
([yshift=-30pt]current page.south east|-current page text area.south east) --
([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
end{tikzpicture}%
stepcounter{mypagenumber}
}
Result:
The next pages also show the correct number, consistent with the Table of Contents (i.e., 2, 3, etc., not shown in the screenshot).
Note that there is a different problem with the footer macro that adds an empty page with only a header and footer at the end, but that is most likely unrelated to the page counter issue.
Thanks for your reply, i will check it now
– Stranger543210
Mar 26 at 12:23
I get the following error: Runaway argument? {newcounter {mypagenumber} setcounter {mypagenumber}{1} newcommand ETC. ! File ended while scanning use of @argdef. <inserted text> par <*> rapportage2.tex ? ! Emergency stop. <inserted text> par <*> rapportage2.tex
– Stranger543210
Mar 26 at 12:29
Let's debug in chat, chat.stackexchange.com/rooms/91547/…
– Marijn
Mar 26 at 12:33
i can not talk to you, my reputation is too low :( need 20
– Stranger543210
Mar 26 at 12:35
Thank you it works! found the solution
– Stranger543210
Mar 26 at 12:39
|
show 1 more comment
The code in the question uses the page number during the AtBeginShipout
call. This is tricky because the page counter is modified by different macros and hooks at various times, which makes it difficult to always get the correct value during page shipout.
As an alternative you can use a custom counter that is displayed and increased in the Footer
macro, which is responsible for the page number in the box, independent from the actual page counter. The 'real' page counter is still used for the numbers in the Table of Contents.
Partial code:
newcounter{mypagenumber}
setcounter{mypagenumber}{1}
newcommandFooter{%
begin{tikzpicture}[remember picture, overlay]
node[yshift=1.75cm] at (17, 24.5) {};
draw [line width=0.55mm] (-0.5,-23.5) -- (16.5,-23.5);
node[yshift=1.75cm, text=red] at (1.5, -26) {Test};
node[yshift=1.75cm, text=gray] at (15, -26) {2019-03-21} ;
node[fill=black, text=white, yshift=1.75cm] at (17, -25.5) {themypagenumber};
fill[bcsred]
(current page.south west) -- (current page.south east) --
([yshift=-30pt]current page.south east|-current page text area.south east) --
([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
end{tikzpicture}%
stepcounter{mypagenumber}
}
Result:
The next pages also show the correct number, consistent with the Table of Contents (i.e., 2, 3, etc., not shown in the screenshot).
Note that there is a different problem with the footer macro that adds an empty page with only a header and footer at the end, but that is most likely unrelated to the page counter issue.
The code in the question uses the page number during the AtBeginShipout
call. This is tricky because the page counter is modified by different macros and hooks at various times, which makes it difficult to always get the correct value during page shipout.
As an alternative you can use a custom counter that is displayed and increased in the Footer
macro, which is responsible for the page number in the box, independent from the actual page counter. The 'real' page counter is still used for the numbers in the Table of Contents.
Partial code:
newcounter{mypagenumber}
setcounter{mypagenumber}{1}
newcommandFooter{%
begin{tikzpicture}[remember picture, overlay]
node[yshift=1.75cm] at (17, 24.5) {};
draw [line width=0.55mm] (-0.5,-23.5) -- (16.5,-23.5);
node[yshift=1.75cm, text=red] at (1.5, -26) {Test};
node[yshift=1.75cm, text=gray] at (15, -26) {2019-03-21} ;
node[fill=black, text=white, yshift=1.75cm] at (17, -25.5) {themypagenumber};
fill[bcsred]
(current page.south west) -- (current page.south east) --
([yshift=-30pt]current page.south east|-current page text area.south east) --
([yshift=-30pt]current page.south west|-current page text area.south west) -- cycle;
end{tikzpicture}%
stepcounter{mypagenumber}
}
Result:
The next pages also show the correct number, consistent with the Table of Contents (i.e., 2, 3, etc., not shown in the screenshot).
Note that there is a different problem with the footer macro that adds an empty page with only a header and footer at the end, but that is most likely unrelated to the page counter issue.
answered Mar 25 at 15:42
MarijnMarijn
8,439636
8,439636
Thanks for your reply, i will check it now
– Stranger543210
Mar 26 at 12:23
I get the following error: Runaway argument? {newcounter {mypagenumber} setcounter {mypagenumber}{1} newcommand ETC. ! File ended while scanning use of @argdef. <inserted text> par <*> rapportage2.tex ? ! Emergency stop. <inserted text> par <*> rapportage2.tex
– Stranger543210
Mar 26 at 12:29
Let's debug in chat, chat.stackexchange.com/rooms/91547/…
– Marijn
Mar 26 at 12:33
i can not talk to you, my reputation is too low :( need 20
– Stranger543210
Mar 26 at 12:35
Thank you it works! found the solution
– Stranger543210
Mar 26 at 12:39
|
show 1 more comment
Thanks for your reply, i will check it now
– Stranger543210
Mar 26 at 12:23
I get the following error: Runaway argument? {newcounter {mypagenumber} setcounter {mypagenumber}{1} newcommand ETC. ! File ended while scanning use of @argdef. <inserted text> par <*> rapportage2.tex ? ! Emergency stop. <inserted text> par <*> rapportage2.tex
– Stranger543210
Mar 26 at 12:29
Let's debug in chat, chat.stackexchange.com/rooms/91547/…
– Marijn
Mar 26 at 12:33
i can not talk to you, my reputation is too low :( need 20
– Stranger543210
Mar 26 at 12:35
Thank you it works! found the solution
– Stranger543210
Mar 26 at 12:39
Thanks for your reply, i will check it now
– Stranger543210
Mar 26 at 12:23
Thanks for your reply, i will check it now
– Stranger543210
Mar 26 at 12:23
I get the following error: Runaway argument? {newcounter {mypagenumber} setcounter {mypagenumber}{1} newcommand ETC. ! File ended while scanning use of @argdef. <inserted text> par <*> rapportage2.tex ? ! Emergency stop. <inserted text> par <*> rapportage2.tex
– Stranger543210
Mar 26 at 12:29
I get the following error: Runaway argument? {newcounter {mypagenumber} setcounter {mypagenumber}{1} newcommand ETC. ! File ended while scanning use of @argdef. <inserted text> par <*> rapportage2.tex ? ! Emergency stop. <inserted text> par <*> rapportage2.tex
– Stranger543210
Mar 26 at 12:29
Let's debug in chat, chat.stackexchange.com/rooms/91547/…
– Marijn
Mar 26 at 12:33
Let's debug in chat, chat.stackexchange.com/rooms/91547/…
– Marijn
Mar 26 at 12:33
i can not talk to you, my reputation is too low :( need 20
– Stranger543210
Mar 26 at 12:35
i can not talk to you, my reputation is too low :( need 20
– Stranger543210
Mar 26 at 12:35
Thank you it works! found the solution
– Stranger543210
Mar 26 at 12:39
Thank you it works! found the solution
– Stranger543210
Mar 26 at 12:39
|
show 1 more 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%2f481352%2ftable-of-contents-numbering-arent-correct%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
You should use
a4paper
as class option instead ofA4
.– JouleV
Mar 25 at 13:49
Welkom bij TeX.SE! There is a
setcounter{page}{2}
in your code (just beforetableofcontents
), that might be the problem? Try setting it to1
or just remove the command.– Marijn
Mar 25 at 14:03
@Marijn I have tried that before, i have tried it to set it to 1 and 0 but nothing seems to work. I also placed it on different places in my code, before tableofcontent and after. On the top of my code and after /document but nothing worked so far. I dont understand why it takes the wrong page number it so confusing. If i change it to 1 then the table of contents is correct but then the page numbering in the footer is wrong and says number 1 on two pages before it goes to 2.
– Stranger543210
Mar 25 at 14:05