1

I'm using the article class from the classicthesis package. I need a customized header and footer. I'm very close to the desired output but don't know how to add the page number above the footer line. Below is an image that shows the desired output. In addition, how can I increase the header size? Thanks in advance.

\documentclass[11pt,a4paper,footinclude,headinclude]{article} 

 \usepackage[nochapters]{classicthesis}

  \usepackage{graphicx}

   \areaset[current]{350pt}{761pt}

    \begin{document}

     \clearscrheadfoot

      \ihead{Header text}
       \chead{}
        \ohead{\includegraphics[height=10mm]{Logo.png}}

         \lofoot{\footnotesize website}
         \cfoot{\footnotesize\textbf{Footer Text}}
         \rofoot{\footnotesize phone}

          \setheadsepline{0.5pt}
           \setfootsepline{0.5pt}

            some dummy text

           \end{document}

enter image description here

1
  • Welcome to TeX.StackExchange!
    – cabohah
    Commented Jan 25, 2023 at 8:26

1 Answer 1

0

Note: Using classicthesis with a standard class instead of a KOMA-Script class, deactivates several features of classicthesis. If this is not a problem, it could even be good, because it avoids some not recommended combinations of KOMA-Script class with packages like titlesec.

There are several suggestions to add extra elements to the page style. Because classicthesis uses package scrlayer-scrpage the most powerful would be to add an extra layer either for the text below the horizontal line or for the page number above the line. Here an example for the last one:

\documentclass[11pt,a4paper,footinclude,headinclude]{article} 

\usepackage[nochapters]{classicthesis}

\usepackage{graphicx}

\areaset[current]{350pt}{761pt}

\clearpairofpagestyles% deprecated \clearscrheadfoot replaced

\ihead{Header text}% with single sided, this is the same like \lofoot
\chead{}
\ohead{\smash{\includegraphics[height=10mm]{example-image}}}% image replaced
                                % to make the example working; \smash added to
                                % ignore the height of the image and therefore
                                % avoid a warning about the height of the head

\setkomafont{pagefoot}{\footnotesize}% setting the basic font size of the page footer
\setkomafont{pagenumber}{\normalsize}% setting the font size of the page number
\KOMAoptions{headsepline=.5pt,footsepline=.5pt}% deprecated \setheadsepline
                                % and \setfootsepline replaced

\ifoot{website}
\cfoot{\textbf{Footer Text}}
\ofoot{phone}

\makeatletter
\DeclareLayer[%
  foreground,% layer only used in foreground
  foot,% basic position in the foot
  hoffset=\sls@leftmargin{foot},% left position changed according to the original layers of scrlayer-scrpage
  addvoffset=-\baselineskip,% move it upwards
  contents={%
    \raggedleft\normalfont
    \usekomafont{pageheadfoot}{\usekomafont{pagefoot}{\pagemark}}\par% the \par is needed to make \raggedleft work
  }%
]{pagenumber}
\makeatother
  
\AddLayersToPageStyle{scrheadings}{pagenumber}% add the new layer to pagestyle scrheadings
\AddLayersToPageStyle{plain.scrheadings}{pagenumber}% and also to the plain page style plain.scrheadings

\begin{document}

some dummy text

\end{document}

But there is a more general and easier suggestion: Using \raisebox to move the number above the line and to give it a zero height and depth:

\documentclass[11pt,a4paper,footinclude,headinclude]{article} 

\usepackage[nochapters]{classicthesis}

\usepackage{graphicx}

\areaset[current]{350pt}{761pt}

\clearpairofpagestyles% deprecated \clearscrheadfoot replaced

\ihead{Header text}% with single sided, this is the same like \lofoot
\chead{}
\ohead{\smash{\includegraphics[height=10mm]{example-image}}}% image replaced
                                % to make the example working; \smash added to
                                % ignore the height of the image and therefore
                                % avoid a warning about the height of the head

\setkomafont{pagefoot}{\footnotesize}% setting the basic font size of the page footer
\setkomafont{pagenumber}{\normalsize}% setting the font size of the page number
\KOMAoptions{headsepline=.5pt,footsepline=.5pt}% deprecated \setheadsepline
                                % and \setfootsepline replaced

\ifoot{website}
\cfoot{\textbf{Footer Text}}
\ofoot{phone%
  \makebox[0pt][r]{\raisebox{1.2\baselineskip}[0pt][0pt]{\pagemark}}% added
                                % the page number right aligned without width
                                % and moved upwards without height an depth.
}

\begin{document}

some dummy text

\end{document}

Both examples result in:

hole page with page number atop the foot rule

Please note also my comments about deprecated code. For more information about the replacements see the KOMA-Script manual.

4
  • Thanks very much. Worked like a charm!
    – nanda
    Commented Jan 25, 2023 at 12:28
  • @nanda Thank you works here by voting (clicking on the thumbs up) and, if applicable by accepting the answer (click on the hook).
    – cabohah
    Commented Jan 25, 2023 at 12:35
  • Any idea on how to increase the head height? I've tried different things but nothing seems to work.
    – nanda
    Commented Feb 2, 2023 at 22:55
  • @nanda This would be another question and you should ask it separately (if it is not already asked). However classicthesis internally uses package typearea. With this options headinclude, headlines, headheight are described in the KOMA-Script manuals. An alternative would be to use package geometry. But note, IMHO classicthesis is not very flexible. So if you want several changes to it, it could be easier to start newly without it.
    – cabohah
    Commented Feb 3, 2023 at 8:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .