Git Product home page Git Product logo

Comments (4)

GR8DAN avatar GR8DAN commented on June 11, 2024

You need to learn the joys (pain) of the fancyhdr package. See line 730 onwards in PhDThesisPSnPDF.cls. You could add a new page style option, i.e., replace lines 756 to 783 with:

% Style 3: Sets Page Number at the Top with Chapter Name and an empty footer
\fancypagestyle{PageStyleIII}{
  \renewcommand{\chaptermark}[1]{\markboth{##1}{}}
  % Clear the headers
  \fancyhf{}
  \fancyhead[RE]{\leftmark}
  \fancyhead[LO]{\leftmark}
  \fancyhead[LE,RO]{\thepage}
}

% Set Fancy Header Command is defined to Load FancyHdr after Geometry is defined
\newcommand{\setFancyHdr}{

\pagestyle{fancy}

\ifPHD@pageStyleI
  % Style 1: Sets Page Number at the Top and Chapter/Section Name on LE/RO
  \pagestyle{PageStyleI}
\else
  \ifPHD@pageStyleII
    % Style 2: Sets Page Number at the Bottom with Chapter/Section Name on LO/RE
    \pagestyle{PageStyleII}
  \else
    \ifPHD@pageStyleIII
      % Style 3: Sets Chapter Name on LO/RE
      \pagestyle{PageStyleIII}
    \else
      % Default Style: Sets Page Number at the Top (LE/RO) with Chapter/Section Name
      % on LO/RE and an empty footer
      \renewcommand{\chaptermark}[1]{\markboth {##1}{}}
      \renewcommand{\sectionmark}[1]{\markright{\thesection\ ##1}}
      \fancyhf{}
      \fancyhead[LO]{\nouppercase \rightmark}
      \fancyhead[LE,RO]{\bfseries\thepage}
      \fancyhead[RE]{\nouppercase \leftmark}
    \fi  
  \fi
\fi
}

Then add this below line 141:

\newif\ifPHD@pageStyleIII\PHD@pageStyleIIIfalse % Set Page StyleIII
\DeclareOption{PageStyleIII}{\PHD@pageStyleIIItrue}

Then pass PageStyleIII as an option to the \documentclass (line 4 in thesis.tex)

from phd-thesis-template.

angoodkind avatar angoodkind commented on June 11, 2024

Thank you so much for this! The only issue is that it doesn't seem to work with oneside printing, as the header only goes across part of the page. (Sorry for not including that information in the original issue.)

from phd-thesis-template.

GR8DAN avatar GR8DAN commented on June 11, 2024

The header/footer styling options are written for two-sided output for printing. A test for oneside or twoside can be used to add support for one-sided documents. For example, for my previous Style 3 example:

% Style 3: Sets Page Number at the Top with Chapter Name and an empty footer
\fancypagestyle{PageStyleIII}{
  \renewcommand{\chaptermark}[1]{\markboth{##1}{}}
  % Clear the headers
  \fancyhf{}
  \if@oneside
    \fancyhead[L]{\nouppercase \leftmark}
    \fancyhead[R]{\nouppercase \thepage}  
  \else
    \fancyhead[RE]{\nouppercase \leftmark}
    \fancyhead[LO]{\nouppercase \leftmark}
    \fancyhead[LE,RO]{\thepage}
  \fi
}

However, the oneside option cause fancyhdr warnings for the other styles. I see you have commented on issue #133 which is in the develop branch and attempts to address that issue.

from phd-thesis-template.

angoodkind avatar angoodkind commented on June 11, 2024

Ok, got it! Since I'm about to submit my thesis, I'm not going to play around with the development branch. I'll wait for it to move into production. Thanks so much for your help!

from phd-thesis-template.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.