Change /rightmark to show last header defined“CONTENTS” in header issueMaking a LaTeX document appear as...

Transfer over $10k

Unidentified items in bicycle tube repair kit

How do I tell my manager that his code review comment is wrong?

Why are notes ordered like they are on a piano?

Pressure to defend the relevance of one's area of mathematics

Selecting a secure PIN for building access

When and why did journal article titles become descriptive, rather than creatively allusive?

I caught several of my students plagiarizing. Could it be my fault as a teacher?

Map one pandas column using two dictionaries

Entropy as a function of temperature: is temperature well defined?

Survey Confirmation - Emphasize the question or the answer?

Is it the same airport YUL and YMQ in Canada?

Can I use 1000v rectifier diodes instead of 600v rectifier diodes?

Hang 20lb projector screen on Hardieplank

Does the time required to copy a spell into a spellbook have to be consecutive, or is that just the cumulative time required?

Write to EXCEL from SQL DB using VBA script

Floor tile layout process?

How to scale a verbatim environment on a minipage?

Packet sniffer for MacOS Mojave and above

How did Arya manage to disguise herself?

How to efficiently calculate prefix sum of frequencies of characters in a string?

Is lying to get "gardening leave" fraud?

Disabling Resource Governor in SQL Server

Is it cheaper to drop cargo than to land it?



Change /rightmark to show last header defined


“CONTENTS” in header issueMaking a LaTeX document appear as though it were typeset in MS WordHow to set rightmark after section command?Wrong rightmark in twocolumn modeHow to add last name to page number in header?Section Titles in Margin Notesrightmark not displaying subsectionUsing parskip and geometry package correctly in my documentUse titleclass only in part of documentInsert the number and name of the section in the header, (including on a chapter's opening page)“CONTENTS” in header issue













0















How can I change the default behaviour of rightmark to display the last defined section before the current page. The default behaviour appears to be the last defined section before the current page IF there are no new sections on the current page.



For example, the following produces a sample document with the default behaviour of rightmark.



documentclass[a4paper,oneside]{book}
usepackage{lipsum}
usepackage{fancyhdr}

pagestyle{fancy}
fancyhf{}
fancyhead[L]{rightmark}
fancyhead[R]{thepage}
renewcommand{headrulewidth}{0pt}

begin{document}
chapter{Lorem Ipsum :)}
section{Paragraphs 1 - 5}
lipsum[1-5]
section{Paragraphs 6 - 10}
lipsum[1-5]
section{Paragraphs 11 - 15}
lipsum[1-5]
end{document}


It looks a bit like this



enter image description here



I would like to make it look a bit more like this. Notice the header now references the last defined section



enter image description here










share|improve this question














bumped to the homepage by Community 2 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • latex uses firstmark and botmark but you want topmark

    – David Carlisle
    Sep 1 '18 at 15:58













  • @DavidCarlisle Thank you for the comment. I managed to get it working with that information. Would you agree with the approach I took in the answer to achieve the result or is there a better way?

    – Dan
    Sep 1 '18 at 17:23













  • @DavidCarlisle Thanks again for the advice, but do you know why topmark might be prefixed by CONTENTS? I posted a new question about it here. I appreciate any help you can give

    – Dan
    Sep 1 '18 at 19:57
















0















How can I change the default behaviour of rightmark to display the last defined section before the current page. The default behaviour appears to be the last defined section before the current page IF there are no new sections on the current page.



For example, the following produces a sample document with the default behaviour of rightmark.



documentclass[a4paper,oneside]{book}
usepackage{lipsum}
usepackage{fancyhdr}

pagestyle{fancy}
fancyhf{}
fancyhead[L]{rightmark}
fancyhead[R]{thepage}
renewcommand{headrulewidth}{0pt}

begin{document}
chapter{Lorem Ipsum :)}
section{Paragraphs 1 - 5}
lipsum[1-5]
section{Paragraphs 6 - 10}
lipsum[1-5]
section{Paragraphs 11 - 15}
lipsum[1-5]
end{document}


It looks a bit like this



enter image description here



I would like to make it look a bit more like this. Notice the header now references the last defined section



enter image description here










share|improve this question














bumped to the homepage by Community 2 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • latex uses firstmark and botmark but you want topmark

    – David Carlisle
    Sep 1 '18 at 15:58













  • @DavidCarlisle Thank you for the comment. I managed to get it working with that information. Would you agree with the approach I took in the answer to achieve the result or is there a better way?

    – Dan
    Sep 1 '18 at 17:23













  • @DavidCarlisle Thanks again for the advice, but do you know why topmark might be prefixed by CONTENTS? I posted a new question about it here. I appreciate any help you can give

    – Dan
    Sep 1 '18 at 19:57














0












0








0








How can I change the default behaviour of rightmark to display the last defined section before the current page. The default behaviour appears to be the last defined section before the current page IF there are no new sections on the current page.



For example, the following produces a sample document with the default behaviour of rightmark.



documentclass[a4paper,oneside]{book}
usepackage{lipsum}
usepackage{fancyhdr}

pagestyle{fancy}
fancyhf{}
fancyhead[L]{rightmark}
fancyhead[R]{thepage}
renewcommand{headrulewidth}{0pt}

begin{document}
chapter{Lorem Ipsum :)}
section{Paragraphs 1 - 5}
lipsum[1-5]
section{Paragraphs 6 - 10}
lipsum[1-5]
section{Paragraphs 11 - 15}
lipsum[1-5]
end{document}


It looks a bit like this



enter image description here



I would like to make it look a bit more like this. Notice the header now references the last defined section



enter image description here










share|improve this question














How can I change the default behaviour of rightmark to display the last defined section before the current page. The default behaviour appears to be the last defined section before the current page IF there are no new sections on the current page.



For example, the following produces a sample document with the default behaviour of rightmark.



documentclass[a4paper,oneside]{book}
usepackage{lipsum}
usepackage{fancyhdr}

pagestyle{fancy}
fancyhf{}
fancyhead[L]{rightmark}
fancyhead[R]{thepage}
renewcommand{headrulewidth}{0pt}

begin{document}
chapter{Lorem Ipsum :)}
section{Paragraphs 1 - 5}
lipsum[1-5]
section{Paragraphs 6 - 10}
lipsum[1-5]
section{Paragraphs 11 - 15}
lipsum[1-5]
end{document}


It looks a bit like this



enter image description here



I would like to make it look a bit more like this. Notice the header now references the last defined section



enter image description here







sectioning formatting






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 1 '18 at 15:51









DanDan

133117




133117





bumped to the homepage by Community 2 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 2 hours ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • latex uses firstmark and botmark but you want topmark

    – David Carlisle
    Sep 1 '18 at 15:58













  • @DavidCarlisle Thank you for the comment. I managed to get it working with that information. Would you agree with the approach I took in the answer to achieve the result or is there a better way?

    – Dan
    Sep 1 '18 at 17:23













  • @DavidCarlisle Thanks again for the advice, but do you know why topmark might be prefixed by CONTENTS? I posted a new question about it here. I appreciate any help you can give

    – Dan
    Sep 1 '18 at 19:57



















  • latex uses firstmark and botmark but you want topmark

    – David Carlisle
    Sep 1 '18 at 15:58













  • @DavidCarlisle Thank you for the comment. I managed to get it working with that information. Would you agree with the approach I took in the answer to achieve the result or is there a better way?

    – Dan
    Sep 1 '18 at 17:23













  • @DavidCarlisle Thanks again for the advice, but do you know why topmark might be prefixed by CONTENTS? I posted a new question about it here. I appreciate any help you can give

    – Dan
    Sep 1 '18 at 19:57

















latex uses firstmark and botmark but you want topmark

– David Carlisle
Sep 1 '18 at 15:58







latex uses firstmark and botmark but you want topmark

– David Carlisle
Sep 1 '18 at 15:58















@DavidCarlisle Thank you for the comment. I managed to get it working with that information. Would you agree with the approach I took in the answer to achieve the result or is there a better way?

– Dan
Sep 1 '18 at 17:23







@DavidCarlisle Thank you for the comment. I managed to get it working with that information. Would you agree with the approach I took in the answer to achieve the result or is there a better way?

– Dan
Sep 1 '18 at 17:23















@DavidCarlisle Thanks again for the advice, but do you know why topmark might be prefixed by CONTENTS? I posted a new question about it here. I appreciate any help you can give

– Dan
Sep 1 '18 at 19:57





@DavidCarlisle Thanks again for the advice, but do you know why topmark might be prefixed by CONTENTS? I posted a new question about it here. I appreciate any help you can give

– Dan
Sep 1 '18 at 19:57










1 Answer
1






active

oldest

votes


















0














Credits to David Carlisle for pointing me to topmark





As mentioned before, this can be achieved by using topmark. However, topmark returns the chapter as part of the value. So this can be got around by "silencing" the chaptermark.



In my case, I used



%Header / Footer info
pagestyle{fancy}

%Change commands so when `topmark` is used, the last defined section before the current page is used
renewcommand{chaptermark}[1]{markright{#1}}
%renewcommand{sectionmark}[1]{markright{#1}} %Uncomment this line if you don't like numbers

%Define the header / footer
fancyhf{}
fancyhead[L]{topmark}
fancyhead[R]{thepage}
renewcommand{headrulewidth}{0pt}





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%2f448862%2fchange-rightmark-to-show-last-header-defined%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














    Credits to David Carlisle for pointing me to topmark





    As mentioned before, this can be achieved by using topmark. However, topmark returns the chapter as part of the value. So this can be got around by "silencing" the chaptermark.



    In my case, I used



    %Header / Footer info
    pagestyle{fancy}

    %Change commands so when `topmark` is used, the last defined section before the current page is used
    renewcommand{chaptermark}[1]{markright{#1}}
    %renewcommand{sectionmark}[1]{markright{#1}} %Uncomment this line if you don't like numbers

    %Define the header / footer
    fancyhf{}
    fancyhead[L]{topmark}
    fancyhead[R]{thepage}
    renewcommand{headrulewidth}{0pt}





    share|improve this answer






























      0














      Credits to David Carlisle for pointing me to topmark





      As mentioned before, this can be achieved by using topmark. However, topmark returns the chapter as part of the value. So this can be got around by "silencing" the chaptermark.



      In my case, I used



      %Header / Footer info
      pagestyle{fancy}

      %Change commands so when `topmark` is used, the last defined section before the current page is used
      renewcommand{chaptermark}[1]{markright{#1}}
      %renewcommand{sectionmark}[1]{markright{#1}} %Uncomment this line if you don't like numbers

      %Define the header / footer
      fancyhf{}
      fancyhead[L]{topmark}
      fancyhead[R]{thepage}
      renewcommand{headrulewidth}{0pt}





      share|improve this answer




























        0












        0








        0







        Credits to David Carlisle for pointing me to topmark





        As mentioned before, this can be achieved by using topmark. However, topmark returns the chapter as part of the value. So this can be got around by "silencing" the chaptermark.



        In my case, I used



        %Header / Footer info
        pagestyle{fancy}

        %Change commands so when `topmark` is used, the last defined section before the current page is used
        renewcommand{chaptermark}[1]{markright{#1}}
        %renewcommand{sectionmark}[1]{markright{#1}} %Uncomment this line if you don't like numbers

        %Define the header / footer
        fancyhf{}
        fancyhead[L]{topmark}
        fancyhead[R]{thepage}
        renewcommand{headrulewidth}{0pt}





        share|improve this answer















        Credits to David Carlisle for pointing me to topmark





        As mentioned before, this can be achieved by using topmark. However, topmark returns the chapter as part of the value. So this can be got around by "silencing" the chaptermark.



        In my case, I used



        %Header / Footer info
        pagestyle{fancy}

        %Change commands so when `topmark` is used, the last defined section before the current page is used
        renewcommand{chaptermark}[1]{markright{#1}}
        %renewcommand{sectionmark}[1]{markright{#1}} %Uncomment this line if you don't like numbers

        %Define the header / footer
        fancyhf{}
        fancyhead[L]{topmark}
        fancyhead[R]{thepage}
        renewcommand{headrulewidth}{0pt}






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 1 '18 at 19:08

























        answered Sep 1 '18 at 17:22









        DanDan

        133117




        133117






























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f448862%2fchange-rightmark-to-show-last-header-defined%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

            Why does my Macbook overheat and use so much CPU and energy when on YouTube?Why do so many insist on using...

            How to prevent page numbers from appearing on glossaries?How to remove a dot and a page number in the...

            Puerta de Hutt Referencias Enlaces externos Menú de navegación15°58′00″S 5°42′00″O /...