1

I am trying to get the following geometry. I have geometry set like this: \usepackage[a4paper, top=4cm,bottom=2.5cm,right=2.5cm,left=4cm, headheight=15pt]{geometry} and I am using the book document class. I have been looking for some ideas on how to set a specific number of lines before and after the chapter's name (see figure 1), but without success. I am also required to have the page number 1.5cm above the first line of the text (see figure 2), but I do not know how to control it. Chapter page does not require page number, but others page do. Any help will be very much appreciated.

Figure1:

FIgure2:

enter image description here

EDIT: Some more details, all I have been specified is to have a 4cm top and left margin, and a 2.5cm bottom and right margin. That is why I used the geometry package as indicated above. The pagenumber has to be at the top right of the page. Also, I am using a 12pt font size and Times New Roman and XeLatex. For the chapter name I am using the \large size.

14
  • please can you add a complete example? and what does mean top margin ?
    – touhami
    Commented Jun 29, 2016 at 18:22
  • @touhami Sorry for messing things up. I hope it is clear now. My understanding is that top margin is where the text starts, if no header is present, but I am not completely sure. Commented Jun 29, 2016 at 18:40
  • A priori, this can be done with titlesec, but we need more details.
    – Bernard
    Commented Jun 29, 2016 at 18:44
  • @Bernard What kind of details? so I can add them. Commented Jun 29, 2016 at 18:47
  • The value for top margin (and also inner margin, outer margin, text height, text width, paper format). Where you want the page number exactly is not clear . Font size for chapter title and for chapter label.
    – Bernard
    Commented Jun 29, 2016 at 18:51

1 Answer 1

2

Here is what I understood of your requirements:

\documentclass[12pt, a4paper, oneside]{book}%
\usepackage[top=4cm,bottom=2.5cm,right=2.5cm,left=4cm, headheight=15pt, showframe]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{lipsum,setspace }
\usepackage[pagestyles, clearempty]{titlesec}

\newpagestyle{myps}{%
\assignpagestyle{\chapter}{empty}
\sethead[\thepage][][]{}{}{\thepage}
\setfoot{}{}{}}%

\titleformat{\chapter}[display]{\Large\bfseries}{\chaptername~\thechapter}{0pt}{}
\titlespacing*{\chapter}{0pt}{32pt}{28pt}%
\titlespacing*{name=\chapter, numberless}{0pt}{54pt}{28pt}%
\pagestyle{myps}

\begin{document}

\chapter{A first chapter}

\lipsum[1-6]

\chapter*{Test chapter}

\lipsum[2-3]

\end{document} 

enter image description here

4
  • Thanks for the reply. Could you please explain how you came up with those number in the titlespacing? Also, is there a way to get rid of the header in the first page of chapters? Commented Jun 29, 2016 at 21:26
  • My pdfviewer has a measurement tool, so I measured the actual value of interline spacing on the basis of the distance between the first and the 10th line of normal text. This gave with a good precision, a value of 13pt. Then I found the values in \titlespacing by trial and errors. Of course, if you change the font size, you have to do it all again, but you have an order of magnitude. For your second question, you don't have a header on the first page of chapters: it is the showframe option of geometry, for checking. Delete it for the final version, of course.
    – Bernard
    Commented Jun 29, 2016 at 21:37
  • May I know what that pdfviewer is? Commented Jun 29, 2016 at 21:40
  • SumatraPDF (under Windows). But GSview also has this possibility.
    – Bernard
    Commented Jun 29, 2016 at 21:42

You must log in to answer this question.

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