Page LayoutToC Formatting

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
dsp
Posts: 1
Joined: Tue Feb 21, 2012 11:39 pm

ToC Formatting

Post by dsp »

hello

I am working on my dissertation using latex. I have some difficulties in toc format.
I need double space between header "chapter" and "chapter 31" as shown below.
double space between header and toc
double space between header and toc
double_space.PNG (21.81 KiB) Viewed 4484 times
Also I want to delete the highlights and move "Chapter" up as shown below
delete highlights and move "CHAPTER"up
delete highlights and move "CHAPTER"up
move up.PNG (12.7 KiB) Viewed 4484 times
Here are the tex and sty file as the mwe.
pwasu.sty
sty file
(10.26 KiB) Downloaded 317 times
pwasu.tex
tex file
(8.37 KiB) Downloaded 369 times
Thanks for your help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

ToC Formatting

Post by Frits »

Had a quick look at your code and noticed the following:

Code: Select all

\addcontentsline{toc}{chapter}{CHAPTER}
To solve your second question, replace that with

Code: Select all

\addtocontents{toc}{CHAPTER\par}
As far as your first question concerns: I'm not really familiar with memoir (assuming that 'chapter' string comes from memoir), so can't help you with that.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
vaman
Posts: 17
Joined: Wed Oct 09, 2019 5:51 am

ToC Formatting

Post by vaman »

Please try this.
CHAPTER \\ for one space and \\ \\ for two space and continue. It worked for me.

CHAPTER
\\
31. Chapter 4
This gives required spacing.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

ToC Formatting

Post by Stefan Kottwitz »

\\ is for ending a line. It's not for adding vertical space, it may be misused that way, such as with \\ \\ etc.

\par would end a paragraph, and would add a paragraph skip if that's configured. \par\vspace{\baselineskip} would end the paragraph and adds a vertical space of a line height.

Stefan
LaTeX.org admin
User avatar
Ijon Tichy
Posts: 640
Joined: Mon Dec 24, 2018 10:12 am

ToC Formatting

Post by Ijon Tichy »

You should never add more than one \\. It could result in "there's no line to end here" errors and in empty lines at the beginning of a page. To add extra space, you can either use the optional argument of \\ or \vspace.

BTW: A very easy, real solution for the original problem with the first ToC page would be to remove

Code: Select all

\addtocontents{toc}{\protect\thispagestyle{toc}}
from pwasu.tex (line 111) and change:

Code: Select all

\renewcommand*{\aftertoctitle}{\thispagestyle{plain}%
  \par\nobreak \mbox{}\hfill{\normalfont Page}\par\nobreak}
in pwasu.sty (line 167f) into:

Code: Select all

\renewcommand*{\aftertoctitle}{\thispagestyle{plain}%
  \par\nobreak {\normalfont Chapter}\hfill{\normalfont Page}\par\nobreak}
The problem at the second, third etc. page of the ToC is a result of the to low vertical separation of the page head and the text area. This can be solved removing line 73:

Code: Select all

\addtolength{\headsep}{-\topskip}
from pwasu.sty.
Sorry, but I can no longer participate here as the administrator is trampling on my wishes on one of his other platforms. :cry:
Post Reply