Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using the memoir document class and the veelo chapter style. I'm having trouble aligning the chapter number to the right so it has the same right margin as the section name. Because of the page margins the black rectangle on the right of the chapter number does not appear. Part of the code I am using:

\documentclass[a4paper,12pt,twoside]{memoir}
\chapterstyle{veelo}
\settypeblocksize{252mm}{165mm}{*} 
\setlrmarginsandblock{25mm}{20mm}{*} 
\setulmarginsandblock{20mm}{25mm}{*} 
...
\chapter{Introduction}

When I compile I get what is on the left of the image below and I want to obtain what is on the right side.

Chapter style image

Thank you.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Unfortunately you didn't provide information about the horizontal position of the title with respect to the text; here's a possible definition of a new style achieving what you want:

\documentclass[a4paper,12pt,twoside]{memoir}
\usepackage{graphicx}
\usepackage{lipsum}

\settypeblocksize{252mm}{165mm}{*} 
\setlrmarginsandblock{25mm}{20mm}{*} 
\setulmarginsandblock{20mm}{25mm}{*} 

\makeatletter
\newlength{\numberheight}
\setlength{\numberheight}{\beforechapskip}

\newlength{\barlength}
\makechapterstyle{myveelo}{%
\setlength{\afterchapskip}{40pt}
\renewcommand*{\chapterheadstart}{\vspace*{40pt}}
\renewcommand*{\afterchapternum}{\par\nobreak\vskip 25pt}
\renewcommand*{\chapnamefont}{\normalfont\LARGE\flushright}
\renewcommand*{\chapnumfont}{\normalfont\HUGE}
\renewcommand*{\chaptitlefont}{\normalfont\HUGE\bfseries\flushright}
\renewcommand*{\printchaptername}{%
\chapnamefont\MakeUppercase{\@chapapp}\hspace*{\midchapskip}}
\renewcommand*{\chapternamenum}{}
\setlength{\beforechapskip}{18mm}
\setlength{\midchapskip}{\paperwidth}
\addtolength{\midchapskip}{-\textwidth}
\addtolength{\midchapskip}{-\spinemargin}
\addtolength{\midchapskip}{-2.5em}
\renewcommand*{\printchapternum}{%
\makebox[0pt][l]{\hspace{-\midchapskip}%
\resizebox{!}{\numberheight}{\chapnumfont \thechapter}%
\hspace{.8em}%
\rule{\midchapskip}{\beforechapskip}%
}}%
\makeoddfoot{plain}{}{}{\thepage}}
\makeatother
\chapterstyle{myveelo}

\begin{document}
\chapter{Introduction}
\lipsum[2]
\end{document}

enter image description here

share|improve this answer
    
Thank you very much... It worked brilliantly. I did not provide any information about the horizontal position of the title with respect to the text because it's the default one. –  adrian Sep 2 '12 at 6:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.