# Right align chapter number to the chapter name when using memoir with veelo style

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.

Thank you.

-

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*{\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}}
\setlength{\beforechapskip}{18mm}
\setlength{\midchapskip}{\paperwidth}
\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}


-
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