Page LayoutQuotchap alignment

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
dulcificum
Posts: 9
Joined: Thu Oct 23, 2008 12:08 am

Quotchap alignment

Post by dulcificum »

I'm using quotchap with the avantgarde setting for my chapter headings. Unfortunately, the large grey chapter number is not aligned to the right correctly and is too far to the left unlike the chapter title. Is there an easy way to manually fix this?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

dulcificum
Posts: 9
Joined: Thu Oct 23, 2008 12:08 am

Re: Quotchap alignment

Post by dulcificum »

Any ideas?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Quotchap alignment

Post by Stefan Kottwitz »

Hi,

if you would post a minimal working example probably somebody would compile and test it and you could get a suggestion. Not everybody is using quotchap or would take time to create a test file to find a fix.

Stefan
LaTeX.org admin
dulcificum
Posts: 9
Joined: Thu Oct 23, 2008 12:08 am

Quotchap alignment

Post by dulcificum »

Sorry about that, I didn't think a MWE would be necessary as it's just the alignment that needs fixing. This should work:

Code: Select all

\documentclass[a4paper,english]{book}

%make borders narrower

\setlength{\topmargin}{-.05in}
\setlength{\textheight}{9in}
\setlength{\oddsidemargin}{.25in}
\setlength{\evensidemargin}{.25in}
\setlength{\textwidth}{5.75in}
\setlength\footskip{40pt} 

\usepackage{thesis}
\usepackage[calcwidth]{titlesec}

\usepackage{setspace} %doublespacing
\usepackage[norule]{footmisc} %no footnote rule

\titleformat{\section}[hang]{\sffamily\bfseries}  {\Large\thesection}{12pt}{\Large}[{\titlerule[0.5pt]}] 

\usepackage{babel}

\begin{document}

\begin{savequote}[5pc]
\sffamily Quote quote\\
Blah blah.
\end{savequote}

\setstretch{1} 
\chapter{\sffamily{Introduction}}
\label{Introduction} 

\section{Section One}

\setstretch{1.8} 
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since
the 1500s, when an unknown printer took a galley of type and scrambled
it to make a type specimen book. It has survived not only five centuries,
but also the leap into electronic typesetting, remaining essentially
unchanged. It was popularised in the 1960s with the release of Letraset
sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem
Ipsum.

\setstretch{1} 
\chapter{\sffamily{Chapter Two}}
\label{Chapter Two} 

\section{Section One}

\setstretch{1.8} 
Lorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since
the 1500s, when an unknown printer took a galley of type and scrambled
it to make a type specimen book. It has survived not only five centuries,
but also the leap into electronic typesetting, remaining essentially
unchanged. It was popularised in the 1960s with the release of Letraset
sheets containing Lorem Ipsum passages, and more recently with desktop
publishing software like Aldus PageMaker including versions of Lorem
Ipsum.


\end{document}
Where thesis.sty is:

Code: Select all

%%
%% This is file `phdthesis.sty`,

\NeedsTeXFormat{LaTeX2e}[1994/06/01]
\ProvidesPackage{thesis}[2007/09/11]

%% change the equation number appearance
%% load up the AMS math package
\RequirePackage{amsmath}

%% load up the fancy box making package
\RequirePackage{fancybox}

%% make the equation numbers have little ovals around them
\def\tagform@#1{\maketag@@@{\cornersize{0.8}\ovalbox{\ignorespaces\sffamily{#1}\unskip\@@italiccorr}}}

%% Load up PS insertion package
\RequirePackage{psboxit}
\PScommands

%% Load up fancy headers and footers package
\RequirePackage{fancyhdr}

%% now reset the headers and footers
\fancyhead{}
\fancyfoot{}
%% make the odd pages have the section name on the top right
\fancyhead[RO]{\sffamily\bfseries \rightmark}
%% make the even pages have the chapter name on the top left
\fancyhead[LE]{\sffamily\bfseries \leftmark}

%% put the page numbers on the bottom in a nice box
%% even side pages
\fancyfoot[LE]{\psboxit{box 0.8 setgray fill}
{\framebox[10mm][c]{\rule{0cm}{4mm}\color{black}{\bfseries \thepage}}}}
%% odd side pages
\fancyfoot[RO]{\psboxit{box 1 setgray fill}
{\hspace{\textwidth}\psboxit{box 0.8 setgray fill}
{\framebox[10mm][c]{\rule{0cm}{4mm}\color{black}{\bfseries \thepage}}}}}

%% make the bottom line above the page number box
\renewcommand{\footrulewidth}{0.4pt}
\renewcommand{\footruleskip}{0mm}

%% bring the style into effect
\pagestyle{fancy}

%% now redefine the plain style pages (chapter pages, contents pages)
%% to have the same page number stuff on the bottom
\fancypagestyle{plain}{
\fancyhf{}
\fancyfoot[RO]{\psboxit{box 1 setgray fill}
{\hspace{\textwidth}\psboxit{box 0.8 setgray fill}
{\framebox[10mm][c]{\rule{0cm}{4mm}\color{black}{\bfseries \thepage}}}}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.5pt}
}

%% this next section (till \makeatother) makes sure that blank pages
%% are actually completely blank, cause they're not usually
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
	\hbox{}
	\vspace*{\fill}
	\thispagestyle{empty}
	\newpage
	\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother


%% now change the chapter style
%% load up the quotchap package
\RequirePackage[avantgarde]{quotchap}

%% make the quotation appear next to the chapter number
\renewcommand\chapterheadstartvskip{\vspace*{-5\baselineskip}}

%% now change the section heading to have a line beneath it
%% load up the fancy title-style package
\RequirePackage[calcwidth]{titlesec}

\titleformat{\section}[hang]{\sffamily\bfseries}
{\Large\thesection}{12pt}{\Large}[{\titlerule[0.5pt]}]

%% make the odd pages have the section name on the top right
\fancyhead[RO]{\sffamily\bfseries \rightmark}
%% make the even pages have the chapter name on the top left
\fancyhead[LE]{\sffamily\bfseries \leftmark}

%%
%% End of file `phdthesis.sty`
Thanks.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Quotchap alignment

Post by Stefan Kottwitz »

Hi,

it seems to me that the chapter number is right aligned, but the width of the number 1 is too wide for instance, depending on the font used.
To see that try

Code: Select all

\RequirePackage[times]{quotchap}
in thesis.sty instead of

Code: Select all

\RequirePackage[avantgarde]{quotchap}
Stefan
LaTeX.org admin
dulcificum
Posts: 9
Joined: Thu Oct 23, 2008 12:08 am

Re: Quotchap alignment

Post by dulcificum »

Thanks for your response. I don't understand what you mean though - how can the number be too wide to be right-aligned?

I tried with times and it's slightly better but still not fully over to the right. Is there any way of including a manual offset?

Cheers,
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Quotchap alignment

Post by Stefan Kottwitz »

dulcificum wrote:how can the number be too wide to be right-aligned?
There's white space around the number.
dulcificum wrote:Is there any way of including a manual offset?
Sure, try for instance this hack:

Code: Select all

\renewcommand*\thechapter{\arabic{chapter}\!}
\chapter{\sffamily{Introduction}}
\renewcommand*\thechapter{\arabic{chapter}}
Stefan
LaTeX.org admin
dulcificum
Posts: 9
Joined: Thu Oct 23, 2008 12:08 am

Quotchap alignment

Post by dulcificum »

That seems to work for the number "1" but not for any of the other chapters - they are offset too much to the right now. Can you explain what the code does so maybe I can understand what you're trying to do better?

If there is whitespace around the number, how can I disable that?

Also, your hack introduced errors like the following:

Code: Select all

Package hyperref Warning: Token not allowed in a PDFDocEncoded string:
(hyperref)                \kern -1.66702pt
(hyperref)                removed on input line 99.

[1
Non-PDF special ignored!
Non-PDF special ignored!]
Underfull \vbox (badness 4303) has occurred while \output is active []

 [2
Non-PDF special ignored!]
Underfull \vbox (badness 2205) has occurred while \output is active []

 [3
Non-PDF special ignored!
Non-PDF special ignored!] [4
Non-PDF special ignored!]
Chapter 2\tmspace -\thinmuskip {.1667em}.
dulcificum
Posts: 9
Joined: Thu Oct 23, 2008 12:08 am

Re: Quotchap alignment

Post by dulcificum »

Any ideas?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10322
Joined: Mon Mar 10, 2008 9:44 pm

Re: Quotchap alignment

Post by Stefan Kottwitz »

Hi, I have to be short at the moment, I've got few time. You could use that hack for each \chapter, just use \hspace{-distance} instead of \!.
To change the spacing of certain numbers you could use features of the microtype package.

Stefan
LaTeX.org admin
Post Reply