Page LayoutModifying chapter

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Tdawg
Posts: 3
Joined: Fri Jan 10, 2014 7:00 pm

Modifying chapter

Post by Tdawg »

Greetings, I have some problems getting the headertype that I want for my thesis, and I have tried for way too long by myself, not getting anywhere. The header I want to use is in an attachment here.

I tried reproducing this with \titleformat, but seeing I'm not very good at latex, I couldn't get any good results with that.

The picture attached is something I made, but it is not registered as a chapter in the table of content of my thesis, so its useless.

So I guess i have to change the layout of \chapter{}, but I don't have the skills to do that.. Any help would be appreciated.

The code for the header on the image is given below, though it is a very crude. It was just to show what I was going for.

Code: Select all

\begin{center}
\rule[0.1cm]{6.1cm}{5pt}  {Chapter here} \rule[0.1cm]{6.1cm}{5pt}\\
\rule[0.2cm]{15cm}{0.2pt}\\
{ \huge \bfseries {\bf {Chapter title here}} \\[0.4cm] }
\rule[1.5cm]{15cm}{0.2pt}\\
\end{center}


Regards,
T.
Attachments
Header I want to create
Header I want to create
Header.png (3.98 KiB) Viewed 5865 times

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

Tdawg
Posts: 3
Joined: Fri Jan 10, 2014 7:00 pm

Modifying chapter

Post by Tdawg »

Found this template at this link http://zoonek.free.fr/LaTeX/LaTeX_sampl ... ter/0.html, its number 14 there. But it can't get it to work.. Created a new file and copied the code, but i keep getting two errors, stating:
Error 1) ! LaTeX Error: File `sample.cls' not found.Type X to quit or <RETURN> to proceed,or enter new name. (Default extension: cls)Enter file name:! Emergency stop.<read >
Error 2) ! ==> Fatal error occurred, no output PDF file produced!

I myself is using \documentclass[twoside,12pt,a4paper]{report}, would be great if i could implement that template directly into that somehow.

This is the template code I found on the URL:

Code: Select all

\documentclass{sample}
\makeatletter
\def\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\def\@makechapterhead#1{%
  %\vspace*{50\p@}%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        \thickhrulefill\quad
        \scshape \@chapapp{} \thechapter
        \quad \thickhrulefill
        \par\nobreak
        \vspace*{10\p@}%
        \interlinepenalty\@M
        \hrule
        \vspace*{10\p@}%
        \Huge \bfseries #1\par\nobreak
        \par
        \vspace*{10\p@}%
        \hrule
    %\vskip 40\p@
    \vskip 100\p@
  }}
\def\@makeschapterhead#1{%
  %\vspace*{50\p@}%
  \vspace*{10\p@}%
  {\parindent \z@ \centering \reset@font
        \thickhrulefill
        \par\nobreak
        \vspace*{10\p@}%
        \interlinepenalty\@M
        \hrule
        \vspace*{10\p@}%
        \Huge \bfseries #1\par\nobreak
        \par
        \vspace*{10\p@}%
        \hrule
    %\vskip 40\p@
    \vskip 100\p@
  }}
\begin{document}
\chapter{Introduction}
\end{document}
Regards,
T.
mas
Posts: 226
Joined: Thu Dec 04, 2008 4:39 am

Modifying chapter

Post by mas »

Change the line

Code: Select all

\documentclass{sample}
to

Code: Select all

\documentclass{report}
It compiles. I am attaching the cropped output.
Attachments
x.jpg
x.jpg (15.27 KiB) Viewed 5845 times

OS: Debian/GNU Linux; LaTeX System : TeXLive; Editor : Vim
Tdawg
Posts: 3
Joined: Fri Jan 10, 2014 7:00 pm

Re: Modifying chapter

Post by Tdawg »

Oh, thank you! Feeling quite stupid right now.. But thanks again ;)

Regards,
T.
Post Reply