1

I would like to place my page number above the marginside note area. Therefore, the margin at header will be different from the text area. I capture a page from Concepts in Thermal Physics by Blundel as an example. enter image description here How to specify the position of the header?

Note: I used twoside in the documentclass.

2
2

It's easy to do with titleps, a companion package to titlesec:

    \documentclass[11pt, twoside]{book}

    \usepackage[outer=0.33\paperwidth, marginparwidth=0.25\paperwidth, marginparsep=5mm, showframe ]{geometry}
    \usepackage[pagestyles, indentafter]{titlesec}
    \usepackage{lipsum, marginnote}
    \renewcommand\marginfont{\footnotesize}
    \renewcommand\raggedleftmarginnote{\raggedright}
    \newpagestyle{marginhead}{%

    \sethead[\footnotesize\llap{\makebox[\dimexpr\marginparwidth+\marginparsep\relax][l]{\thepage\quad\textit{\chaptertitle}}}][][]%
    {}{}{\footnotesize\rlap{\makebox[\dimexpr\marginparwidth+\marginparsep\relax][r]{\textit{\sectiontitle}\quad\thepage}}}
    }

    \pagestyle{marginhead}

    \begin{document}

    \chapter{Introduction}
    \newpage
    \setcounter{page}{4}\setcounter{section}{1}

    \section{The thermodynamic limit}

    \lipsum[2]
    More text more text more text more text \marginnote{This header style begins at the same point as margin paragraphs}. More text more text more text more text.More text more text more text more text. More text more text more text more text.

    \lipsum


    \section{The Next Section}
    It also gets really messed up for two-sided documents, if the left and right margin are set to different values. Moving only section text would alleviate this problem.

    \end{document} 

enter image description here enter image description here

2
  • Thank you! There is an extra question: what's the difference or the same between \usepackage{sidenote} and \usepackage{marginnote}
    – Wayne Tsai
    Aug 15 '16 at 0:30
  • 1
    I suppose you mean sidenotes. The latter seems to have more possibilities, such as loading floats (I never had to use it). It requires marginnote.
    – Bernard
    Aug 15 '16 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.