problem with cross-referencing in section titles / header












0














I am using the following as a section title in the main body:



documentclass[a4paper,openany]{book}

usepackage{etoolbox} %Patches the "chapter" page numbering
usepackage{fancyhdr}
pagestyle{fancy}
fancyhead[RE]{slshape rightmark}
fancyhead[LO]{slshape leftmark}
fancyhead[LO,RE]{thepage}
fancyheadoffset[L]{0pt} %justification of the headers
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
patchcmd{chapter}{thispagestyle{plain}}{thispagestyle{empty}}{}{}
cfoot{} % get rid of the page number

usepackage[a4paper, includehead, includefoot,
top=0.75in,
bottom=0.5in,
outer=1in,
inner=1in,
]{geometry}

usepackage{hyperref}
usepackage{cleveref}

begin{document}
hypersetup{hidelinks} %Keep document hyperlinks but remove boarders

chapter{Chapter title text }label{chap:sd}
some text
clearpage
section{Section title text ref{chap:sd}}
end{document}


But in the heading, it just says "??".



How do I fix this?



EDIT: added more code










share|improve this question




















  • 1




    that refers to a (presumably missing) label{name1} elsewhere in the docuemnt, did you mean to use label{name1} here so that you could refer to this section?
    – David Carlisle
    Nov 5 at 0:09








  • 2




    @slew123 It would be easier to understand what you want if you provided a minimal example that shows what you want to happen instead of a single line of code and "it doesn't work". "TEXT HERE ??" is exactly what I would expect from your code, so it's not clear how you want it fixed. (David Carlisle has offered one interpretation, another is that you want the "??" to become some other section's number.)
    – Teepeemm
    Nov 5 at 2:11












  • Please show your MWE -- we can't know whether the ?? is shown in the section or not.
    – JouleV
    Nov 5 at 7:22










  • Ok, I will do this, give me a few minutes.
    – slew123
    Nov 5 at 17:04










  • I added the extra code, (with packages related to headers and referencing remaining) it seems to be a problem with hyperref package, not sure why.
    – slew123
    Nov 5 at 17:11


















0














I am using the following as a section title in the main body:



documentclass[a4paper,openany]{book}

usepackage{etoolbox} %Patches the "chapter" page numbering
usepackage{fancyhdr}
pagestyle{fancy}
fancyhead[RE]{slshape rightmark}
fancyhead[LO]{slshape leftmark}
fancyhead[LO,RE]{thepage}
fancyheadoffset[L]{0pt} %justification of the headers
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
patchcmd{chapter}{thispagestyle{plain}}{thispagestyle{empty}}{}{}
cfoot{} % get rid of the page number

usepackage[a4paper, includehead, includefoot,
top=0.75in,
bottom=0.5in,
outer=1in,
inner=1in,
]{geometry}

usepackage{hyperref}
usepackage{cleveref}

begin{document}
hypersetup{hidelinks} %Keep document hyperlinks but remove boarders

chapter{Chapter title text }label{chap:sd}
some text
clearpage
section{Section title text ref{chap:sd}}
end{document}


But in the heading, it just says "??".



How do I fix this?



EDIT: added more code










share|improve this question




















  • 1




    that refers to a (presumably missing) label{name1} elsewhere in the docuemnt, did you mean to use label{name1} here so that you could refer to this section?
    – David Carlisle
    Nov 5 at 0:09








  • 2




    @slew123 It would be easier to understand what you want if you provided a minimal example that shows what you want to happen instead of a single line of code and "it doesn't work". "TEXT HERE ??" is exactly what I would expect from your code, so it's not clear how you want it fixed. (David Carlisle has offered one interpretation, another is that you want the "??" to become some other section's number.)
    – Teepeemm
    Nov 5 at 2:11












  • Please show your MWE -- we can't know whether the ?? is shown in the section or not.
    – JouleV
    Nov 5 at 7:22










  • Ok, I will do this, give me a few minutes.
    – slew123
    Nov 5 at 17:04










  • I added the extra code, (with packages related to headers and referencing remaining) it seems to be a problem with hyperref package, not sure why.
    – slew123
    Nov 5 at 17:11
















0












0








0







I am using the following as a section title in the main body:



documentclass[a4paper,openany]{book}

usepackage{etoolbox} %Patches the "chapter" page numbering
usepackage{fancyhdr}
pagestyle{fancy}
fancyhead[RE]{slshape rightmark}
fancyhead[LO]{slshape leftmark}
fancyhead[LO,RE]{thepage}
fancyheadoffset[L]{0pt} %justification of the headers
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
patchcmd{chapter}{thispagestyle{plain}}{thispagestyle{empty}}{}{}
cfoot{} % get rid of the page number

usepackage[a4paper, includehead, includefoot,
top=0.75in,
bottom=0.5in,
outer=1in,
inner=1in,
]{geometry}

usepackage{hyperref}
usepackage{cleveref}

begin{document}
hypersetup{hidelinks} %Keep document hyperlinks but remove boarders

chapter{Chapter title text }label{chap:sd}
some text
clearpage
section{Section title text ref{chap:sd}}
end{document}


But in the heading, it just says "??".



How do I fix this?



EDIT: added more code










share|improve this question















I am using the following as a section title in the main body:



documentclass[a4paper,openany]{book}

usepackage{etoolbox} %Patches the "chapter" page numbering
usepackage{fancyhdr}
pagestyle{fancy}
fancyhead[RE]{slshape rightmark}
fancyhead[LO]{slshape leftmark}
fancyhead[LO,RE]{thepage}
fancyheadoffset[L]{0pt} %justification of the headers
renewcommand{headrulewidth}{0pt}
renewcommand{footrulewidth}{0pt}
patchcmd{chapter}{thispagestyle{plain}}{thispagestyle{empty}}{}{}
cfoot{} % get rid of the page number

usepackage[a4paper, includehead, includefoot,
top=0.75in,
bottom=0.5in,
outer=1in,
inner=1in,
]{geometry}

usepackage{hyperref}
usepackage{cleveref}

begin{document}
hypersetup{hidelinks} %Keep document hyperlinks but remove boarders

chapter{Chapter title text }label{chap:sd}
some text
clearpage
section{Section title text ref{chap:sd}}
end{document}


But in the heading, it just says "??".



How do I fix this?



EDIT: added more code







header-footer labels ref






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 5 at 17:11

























asked Nov 4 at 23:55









slew123

1168




1168








  • 1




    that refers to a (presumably missing) label{name1} elsewhere in the docuemnt, did you mean to use label{name1} here so that you could refer to this section?
    – David Carlisle
    Nov 5 at 0:09








  • 2




    @slew123 It would be easier to understand what you want if you provided a minimal example that shows what you want to happen instead of a single line of code and "it doesn't work". "TEXT HERE ??" is exactly what I would expect from your code, so it's not clear how you want it fixed. (David Carlisle has offered one interpretation, another is that you want the "??" to become some other section's number.)
    – Teepeemm
    Nov 5 at 2:11












  • Please show your MWE -- we can't know whether the ?? is shown in the section or not.
    – JouleV
    Nov 5 at 7:22










  • Ok, I will do this, give me a few minutes.
    – slew123
    Nov 5 at 17:04










  • I added the extra code, (with packages related to headers and referencing remaining) it seems to be a problem with hyperref package, not sure why.
    – slew123
    Nov 5 at 17:11
















  • 1




    that refers to a (presumably missing) label{name1} elsewhere in the docuemnt, did you mean to use label{name1} here so that you could refer to this section?
    – David Carlisle
    Nov 5 at 0:09








  • 2




    @slew123 It would be easier to understand what you want if you provided a minimal example that shows what you want to happen instead of a single line of code and "it doesn't work". "TEXT HERE ??" is exactly what I would expect from your code, so it's not clear how you want it fixed. (David Carlisle has offered one interpretation, another is that you want the "??" to become some other section's number.)
    – Teepeemm
    Nov 5 at 2:11












  • Please show your MWE -- we can't know whether the ?? is shown in the section or not.
    – JouleV
    Nov 5 at 7:22










  • Ok, I will do this, give me a few minutes.
    – slew123
    Nov 5 at 17:04










  • I added the extra code, (with packages related to headers and referencing remaining) it seems to be a problem with hyperref package, not sure why.
    – slew123
    Nov 5 at 17:11










1




1




that refers to a (presumably missing) label{name1} elsewhere in the docuemnt, did you mean to use label{name1} here so that you could refer to this section?
– David Carlisle
Nov 5 at 0:09






that refers to a (presumably missing) label{name1} elsewhere in the docuemnt, did you mean to use label{name1} here so that you could refer to this section?
– David Carlisle
Nov 5 at 0:09






2




2




@slew123 It would be easier to understand what you want if you provided a minimal example that shows what you want to happen instead of a single line of code and "it doesn't work". "TEXT HERE ??" is exactly what I would expect from your code, so it's not clear how you want it fixed. (David Carlisle has offered one interpretation, another is that you want the "??" to become some other section's number.)
– Teepeemm
Nov 5 at 2:11






@slew123 It would be easier to understand what you want if you provided a minimal example that shows what you want to happen instead of a single line of code and "it doesn't work". "TEXT HERE ??" is exactly what I would expect from your code, so it's not clear how you want it fixed. (David Carlisle has offered one interpretation, another is that you want the "??" to become some other section's number.)
– Teepeemm
Nov 5 at 2:11














Please show your MWE -- we can't know whether the ?? is shown in the section or not.
– JouleV
Nov 5 at 7:22




Please show your MWE -- we can't know whether the ?? is shown in the section or not.
– JouleV
Nov 5 at 7:22












Ok, I will do this, give me a few minutes.
– slew123
Nov 5 at 17:04




Ok, I will do this, give me a few minutes.
– slew123
Nov 5 at 17:04












I added the extra code, (with packages related to headers and referencing remaining) it seems to be a problem with hyperref package, not sure why.
– slew123
Nov 5 at 17:11






I added the extra code, (with packages related to headers and referencing remaining) it seems to be a problem with hyperref package, not sure why.
– slew123
Nov 5 at 17:11












1 Answer
1






active

oldest

votes


















0














Since no one has been able to fix the issue, I decided to rename the section title without using a reference.






share|improve this answer





















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


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f458415%2fproblem-with-cross-referencing-in-section-titles-header%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









    0














    Since no one has been able to fix the issue, I decided to rename the section title without using a reference.






    share|improve this answer


























      0














      Since no one has been able to fix the issue, I decided to rename the section title without using a reference.






      share|improve this answer
























        0












        0








        0






        Since no one has been able to fix the issue, I decided to rename the section title without using a reference.






        share|improve this answer












        Since no one has been able to fix the issue, I decided to rename the section title without using a reference.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 8 at 3:41









        slew123

        1168




        1168






























            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%2f458415%2fproblem-with-cross-referencing-in-section-titles-header%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?

            Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

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