0

I have to produce the following layout scheme in the footer of a customized book document by using titlesec and titleps:

Left                           Center                           right
{item_name}                                                  {chapter}
<-----------------------------empty line----------------------------->
{book_title}                                              {pagenumber}

I initially tried the "fancyheader" (fancydhr) package, which has the ability to produce such 'fancy' footers (see section 11 of its user manual). However, the need to customize titles of chapters, sections, subsections and paragraphs prevented me to use it. I switched to "titlesec" and I succeeded in tweaking all section titles in the model document: could I make a multiline layout like the one I outlined above by using this package?

Edit

Following the advice of @JP-Ellis advice, here is the layout I tried:

\usepackage[italian]{babel}
\usepackage[a4paper, xetex, margin=1cm, includeheadfoot]{geometry}

\usepackage{fontspec} 
\setmainfont{Arial} 
\usepackage{pageslts} 

\usepackage{fancyhdr} 

\pagestyle{fancy} 
\makeatletter 
\lfoot{\leftmark \\~\\ \@title} 
\rfoot{\chaptername \\~\\ \thepage} 
\makeatother 

\usepackage{checkend}

\usepackage{color}
\definecolor{C_green}{rgb}{0,0.255,0.218}
\usepackage[allbordercolors={1 1 1}]{hyperref}
\usepackage[code=Code39,H=0.8cm]{makebarcode}
\usepackage{siunitx}

\usepackage{makeidx}
\makeindex   % Index creation
\title{Selezionatrice ottica\\ SEA TRUE 0.5 / 1.5 / 2 / 3 / 4 / 5 / 6 / 7}  

\begin{document}
\pagenumbering{arabic}

However, I did not got the same result you show above. Apart from the fact that I edited on the footer, there are some layout errors. In particular, this is the footer of the first chapter of a model document I am working on:

footer

1

You mention in your question that

the need to customize titles of chapters, sections, subsections and paragraphs prevented me to use [fancyhdr]

I'm not quite sure what customization you are referring to, but the way chapters and sections change change headings in fancyhdr can be adjusted by overwriting \chaptermark, \sectionmark and \subsectionmark. It is also possible to adjust the page style on new chapter pages (instead of the default plain style).

Here's a small implementation. In order to get new lines, I just used the usual \\. I instead the white space character ~ between the two \\ since without it, the second \\ has no line to end.

\documentclass{report}

\usepackage{fancyhdr}
\usepackage{mwe}

\pagestyle{fancy}
\makeatletter
\lhead{\leftmark \\~\\ \@title}
\rhead{\chaptername \\~\\ \thepage}
\makeatother

\renewcommand{\chaptermark}[1]{}
\renewcommand{\sectionmark}[1]{\markboth{#1}{}}
\renewcommand{\subsectionmark}[1]{}

\title{Daniele Tampieri}

\begin{document}
\blinddocument
\end{document}

output

Edit

As I accidentally assumed that we were dealing with headers only, I didn't check for the behaviour with footers. With headers, there usually won't be much of an issue if there is a large header as the main body will simply get pushed down further (this of course, depends on the particular layout). With footers though, this is slightly different and you need to ensure that the page layout allows for enough space to fit the whole footer otherwise, as seen above, the text runs of the page.

The geometry package offers plenty of options to adjust the various margins, and in particular it has the option includehead will make sure that the top margin does not include the header as the header counts towards the body. This works really well and ensures that enough space is left at the top of the page. The analogous option includefood however does not work as nicely and after a bit of trial and error, I found the following to work:

\usepackage[
  includehead=true,
  top=2cm,
  hmargin=3cm,
  bottom=4cm,
]{geometry}
3
  • Instead of using a comment for that, could you edit that into the question? Just make sure to mention that it was added (so others reading the question can follow the development of this question). Feel free to delete this comment once you have updated the question (just to avoid too much redundant information) :)
    – JP-Ellis
    Feb 29 '16 at 7:56
  • I added the content of my previous comment to my question, plus a picture of the layout I obtained. Note that the pagenumber was printed outside page limits. Feb 29 '16 at 8:36
  • @DanieleTampieri I have updated the answer accordingly :)
    – JP-Ellis
    Feb 29 '16 at 8:57

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.