Page LayoutChange Position of Chapter Title

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Mark
Posts: 2
Joined: Thu Oct 20, 2011 8:19 pm

Change Position of Chapter Title

Post by Mark »

Hey there!

I'm all new to LaTeX, so this question may be silly in your eyes - but here it comes:

At the university my group is to write a report, and we have decided to go with daleif1 chapterstyle.. However we would like the chaptertitle to be to the left and at the same line as the box on the right..

I've managed to move the chaptertitle to the left, but I can't seem to move it up..

Code: Select all

\usepackage{color,calc,graphicx,soul,fourier}
\definecolor{nicegray}{RGB}{49,79,79}
\makeatletter
\newlength\dlf@normtxtw
\setlength\dlf@normtxtw{\textwidth}
\def\myhelvetfont{\def\sfdefault{mdput}}
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
\sbox\feline@chapter{%
\resizebox{!}{#1}{\fboxsep=1pt%
\colorbox{nicegray}{\color{white}\bfseries\sffamily\thechapter}%
}}%
\rotatebox{90}{%
\resizebox{%
\heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
{!}{\scshape\so\@chapapp}}\quad%
\raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
\sbox\feline@chapter{\feline@chapter@marker[#1]}%
\makebox[0pt][l]{% aka \rlap
\makebox[1cm][r]{\usebox\feline@chapter}%
}}
\makechapterstyle{daleif1}{
\renewcommand\printchaptertitle[1]{\chaptitlefont\raggedright ##1\par}
\renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
\renewcommand\chaptitlefont{\normalfont\huge\bfseries\scshape\color{nicegray}}
\renewcommand\chapternamenum{}
\renewcommand\printchaptername{}
\renewcommand\printchapternum{\null\hfill\feline@chm[2.5cm]\par}
\renewcommand\afterchapternum{\par\vskip\midchapskip}
}
\makeatother
\chapterstyle{daleif1}

I've used several hours on this, but can't seem to get it right. Can you help me?

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Mark
Posts: 2
Joined: Thu Oct 20, 2011 8:19 pm

Change Position of Chapter Title

Post by Mark »

Inserted:

Code: Select all

\setlength{\midchapskip}{-100pt}
\setlength{\afterchapskip}{2.5cm}
\setlength{\beforechapskip}{-1cm}
And it seemed to do the job. But is this the "right" way to do it?
Post Reply