Page LayoutFormatting Table of Contents

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Lianne
Posts: 3
Joined: Mon Jan 12, 2009 2:13 pm

Formatting Table of Contents

Post by Lianne »

Hi,

I have a formatting problem with my table of contents. Appendices appear as: "A This is the First Appendix". However, I would like to have: "Appendix A This is the First Appendix". Since I use special formatting (fncychap) for chapters and chapter*s, I do not want to use \chapter* and add a separate toc line. Thanks in advance! Lianne.

I added below my preamable, in case that's necessary info:

Code: Select all

%%%%%%%%%%%%%%%%%%%%%%%%
%%preamable
%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[10pt, twoside, openright]{report}
\usepackage[dvips]{graphicx}
\usepackage{verbatim}
\usepackage{subfigure} 
\usepackage{multirow}
\usepackage{rotating}
\usepackage{color}
\usepackage{picins}
\usepackage{sectsty} 
\usepackage[Lianne]{fncychap}
\usepackage{fancyhdr}

\setlength{\paperheight}{240mm}
\setlength{\paperwidth}{170mm}
\setlength{\evensidemargin}{-5mm}
\setlength{\oddsidemargin}{0in} %% default is 1 inch, 2.5 cm
\setlength{\topmargin}{-5mm} %% default is 1 inch, 2.5 cm
\setlength{\textheight}{200mm}
\setlength{\textwidth}{125mm}

\pagestyle{fancy}
\fancyhf{} 
\fancyfoot[LE,RO]{\bfseries\thepage}
\fancyhead[LE]{\leftmark}
\fancyhead[RO]{\rightmark}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

\fancypagestyle{plain}{%
\fancyhead{} 
\fancyfoot{} 
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}

\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
    \hbox{}
    \vspace*{\fill}
    \thispagestyle{empty}
    \newpage
    \if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother

\graphicspath{{introduction/}{relatedwork/}{background/}{solution/}{case1/}{case2/}{mode4sla/}{conclusion/}{appendix/}} 

\setlength{\marginparwidth}{1.2in}
\let\oldmarginpar\marginpar
\renewcommand\marginpar[1]{\-\oldmarginpar[\raggedleft\footnotesize #1]%
{\raggedright\footnotesize #1}}

\linespread{1.1}

\partfont{\raggedleft\huge\bf\rm\sectionrule{5ex}{1pt}{5ex}{1pt}}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

Re: Formatting Table of Contents

Post by corderin »

Try the appendix package with the following options...

In the preamble

\usepackage[toc,page,titletoc]{appendix}


I hope this helps...

Then in the document

\begin{appendices}
\begin{appendix}
\chapter{This is my first appendix}


\end{appendix}
\end{appendices}
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Formatting Table of Contents

Post by localghost »

The appendix is introduced with the \appendix command (switch), not with an environment.


Best regards
Thorsten¹
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

Re: Formatting Table of Contents

Post by corderin »

I am not sure, but it works also so...
corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

Re: Formatting Table of Contents

Post by corderin »

Ok, Liane...

With the appendices package

It is enough with:

\begin{appendices}
\chapter{First}

\chapter{Second}
\end{appendices}

each chapter will be an independent appendix.... :-), it is easier so...
corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

Re: Formatting Table of Contents

Post by corderin »

My last reply....in the case you want to use \autoref{app:...} (with a \label{app:...})to reference an appendix and get Appendix A automatically for example, you nedd the \appendix command after the \begin{appendices}...in other case you will get only A and not Appendix A when using \autoref.
Lianne
Posts: 3
Joined: Mon Jan 12, 2009 2:13 pm

Re: Formatting Table of Contents

Post by Lianne »

Dear Corderin,

Thanks a lot for all your effort. Unfortunately this does not solve my problem. I am indeed using:

\appendix
\include{my_appendix}

Where "my_appendix" is a chapter. I tried your suggestions putting it in an appendices environment, but I still get in my Table of Contents:

"A This is the First Appendix". Instead of "Appendix A This is the First Appendix".

I have the feeling I need to adapt a command (renewcommand) when creating the appendices half way the document (something like: \chaptername). But I cannot find out how to chance this half way the document (instead of in the preamable).
corderin
Posts: 77
Joined: Sun Dec 14, 2008 2:27 pm

Re: Formatting Table of Contents

Post by corderin »

You need the appendix package with the following options
\usepackage[toc,page,titletoc]{appendix}

then
\renewcommand{\appendixname}{Appendix}
\renewcommand{\appendixtocname}{List of appendices}

Read the appendix package documentation.
Last edited by corderin on Tue Jan 13, 2009 12:46 am, edited 1 time in total.
Lianne
Posts: 3
Joined: Mon Jan 12, 2009 2:13 pm

Re: Formatting Table of Contents

Post by Lianne »

Dear Corderin,

Thanks a lot, you solved my problem! :D I now use the appendices environment, with "titletoc" as a package option. It nicely produces the "Appendix A" in the ToC.
Post Reply