My TOC requirements state that all "Appendix" entries must read as
follows:
APPENDIX A: Appendix Title
APPENDIX B: Appendix Title
and so on.
Right now, using the Appendix Package, my TOC reads as follows:
APPENDIX A Appendix Title
APPENDIX B Appendix Title
which is very close, but not exactly right - I need to add a semicolon
(":") after each Appendix chapter-letter in the TOC.
I'm pretty new to LaTeX/Tex, but after doing some reading, it seemed as
though the best way to have the word "APPENDIX" appear in the TOC was
to use the Appendix Package (which makes it very easy). But, if this
is incorrect, please let me know.
I've spent the last couple days trying to figure out how to edit (or
\renewcommand) something from the Appendix Package to get my desired
"APPENDIX A:" in the TOC ... but, so far, I've come up empty.
I think I've identified the part of the package that would require
modification ... the very last bit of code in the appendix.sty file:
\newcommand{\@redotocentry@pp}[1]{%
\let\oldacl@pp=\addcontentsline
\def\addcontentsline##1##2##3{%
\def\@pptempa{##1}\def\@pptempb{toc}%
\ifx\@pptempa\@pptempb
\def\@pptempa{##2}\def\@pptempb{#1}%
\ifx\@pptempa\@pptempb
\oldacl@pp{##1}{##2}{\appendixname\space ##3}%
\else
\oldacl@pp{##1}{##2}{##3}%
\fi
\else
\oldacl@pp{##1}{##2}{##3}%
\fi}
}
I've edited this portion of code many times - and ironically, I've the
semicolon to show up at every location in the TOC Appendix title,
except after the chapter-letter.
So, I was hoping that someone could help - basically, all I need is the
TOC entry that I listed above (whether I use the Appendix Package or
not) ... I'm open to any and all advice/help. In case it matters, I
use the \chapter command for all my appendices, which are linked to my
main .tex file via \include commands. In this way, I treat all my
appendices just like "normal" chapters, only changing the part of the
book that are in (before I begin my appendix \include commands, I have
a \begin{appendices} command, per the appendix package).
Anyway ... Thanks for the help ... I really appreciate it. (and, I've
done lots of searching through the comp.text.tex archives, and I
haven't found this question before ... but, I apologize if this is a
repeat.)
Thanks!
(and I want to preface all this, again, with the fact that I'm a
LaTeX/Tex newbie ... so, I could be completely off base here...)
As I said above, this last bit of code in appendix.sty seems to control
the title "Appendix A" in the TOC:
\newcommand{\@redotocentry@pp}[1]{%
\let\oldacl@pp=\addcontentsline
\def\addcontentsline##1##2##3{%
\def\@pptempa{##1}\def\@pptempb{toc}%
\ifx\@pptempa\@pptempb
\def\@pptempa{##2}\def\@pptempb{#1}%
\ifx\@pptempa\@pptempb
\oldacl@pp{##1}{##2}{\appendixname\space ##3}%
\else
\oldacl@pp{##1}{##2}{##3}%
\fi
\else
\oldacl@pp{##1}{##2}{##3}%
\fi}
}
and, furthermore, the argument ##3 seems to control both the appendix
chapter-letter (i.e., A, B, C, ...) and the appendix title (i.e.,
"Appendix Title") ... so, ##3 prints "A Appendix Title" ... which
means that, the way it's currently written, it's "impossible" to simply
"insert" a semicolon between the appendix chapter-letter and the
appendix title.
So, I've been experimenting with "other ways" of modifying the above
code. In my style file, I've inserted this:
\newcommand{\apptitle}[1]{\gdef\@chapter{#1}}
\renewcommand{\@redotocentry@pp}[1]{%
\let\oldacl@pp=\addcontentsline
\def\addcontentsline##1##2##3{%
\def\@pptempa{##1}\def\@pptempb{toc}%
\ifx\@pptempa\@pptempb
\def\@pptempa{##2}\def\@pptempb{#1}%
\ifx\@pptempa\@pptempb
\oldacl@pp{##1}{##2}{\appendixname\space ##3}%
%\oldacl@pp{##1}{##2}{\appendixname\space\thechapter:~\apptitle}%
\else
\oldacl@pp{##1}{##2}{##3}%
\fi
\else
\oldacl@pp{##1}{##2}{##3}%
\fi}
}
Hoping that "apptitle" would be defined as the appendix (or chapter)
title ... and then, i could insert each individual element into the TOC
( the \appendixname, \thechapter:, and the \apptitle) ... which, should
give me "APPENDIX A: Appendix Title" in the TOC ... or, so I thought.
It does not, however ... I get error messages all over the place -
ranging from "\chapter is not defined this way" to errors in my
appendix titles.
So, I'm at a total loss. All I want is to have "APPENDIX A: Appendix
Title" in my TOC entry ... and I'd like to maintain my current
\chapter{Appendix Title} via \include{file} method of calling the
appendices.
So, if anyone has any recommendations or ideas, please let me know.
Thank you for your time.
Before producing the final copy, edit it your .toc file to read
something like
...\numberline {Appendix A:}...
and then TeX (exactly) one more time. You may need to add a little
space after the colon.
^^ Thanks! This does work. I used it to get my thesis past our
"Format Reviewer" ... that was a big help - I appreciate it.
And yeah ... I meant "colon" ... I wrote "semicolon" (a few times) ...
but I meant colon ... it's been one of those weeks - brain cramps ...
sorry!
But, I think I found a "TeX" way to accomplish my goal ... basically, I
take the same macro that I gave above, and redefine \thechapter for a
single line ... then, I redefine \thechapter back to its "normal"
definition.
Yeah, it's a complete hack, but it seems to work ... and I already said
that I'm no good at LaTeX/TeX (yet). :-)
Anyway, here's my hack to get the following in the TOC:
APPENDIX A: Appendix Title
code in my thesis style file:
% call Appendix package with options
\RequirePackage[page,titletoc]{appendix}
%modify to get APPENDIX A: in TOC
\renewcommand{\@redotocentry@pp}[1]{%
\let\oldacl@pp=\addcontentsline
\def\addcontentsline##1##2##3{%
\def\@pptempa{##1}\def\@pptempb{toc}%
\ifx\@pptempa\@pptempb
\def\@pptempa{##2}\def\@pptempb{#1}%
\ifx\@pptempa\@pptempb
%MWT-change \thechapter to have colon
\renewcommand\thechapter{\@Alph\c@chapter:~}%
\oldacl@pp{##1}{##2}{\appendixname\space ##3}%
%MWT-change \thechapter back to normal
\renewcommand\thechapter{\@Alph\c@chapter}%
\else
\oldacl@pp{##1}{##2}{##3}%
\fi
\else
\oldacl@pp{##1}{##2}{##3}%
\fi}
}
So, it changed \thechapter for the brief moment just before writing to
the toc file ... then it changes \thechapter back to normal for all
other things (like, \makechapterhead and whatnot).
I hope this comes in handy to someone else ... or, I hope that someone
else can come up with a more elegant solution.
Thanks!
\renewcommand*\cftappendixname{\appendixname:~}
that is it! ;-)
(plus perhaps \setlength\cftchapternumberwidth}{2em} )
Using the right tools to begin with makes life a lot easier.
/daleif
And, as I said, I'm very new to LaTeX/TeX (this thesis is my first
experience with it), and I've been using Kopka and Daly as a reference
- and they don't mention the Memior class (also, I'm using some macros
and style files from other theses, and they all used book class too).
It also seemed that most other schools' theses were based on the book
class.
But, I do appreciate the heads-up ... I'll print out the Memiors manual
and go through it this weekend.
Do you know of any .tex files (large books, theses, ...) that use the
Memior class? I've found that it's easiest for me to learn a TeX file
if I can download a .tex example ... and possibly "borrow" some ideas
from those tex files.
Anyway, thanks for the reply ... I'll give Memoirs a look.
the main idea is often to be inspired by other sources and then
implement it in memoir, which is often quite easy (when you know your
way around memoir) because memoir includes so many features.
I don't know about any books online that have been written using the
memoir class (or at least not any with public available source code)
My own LaTeX book (written in danish, last years version available at
www.imf.au.dk/system/latex/bog/) is written using memoir.
If you want some inspiration about chapter designs, I have a showcase on
CTAN (www.ctan.org/tex-archive/info/MemoirChapStyles).
If you have any particular questions or need help in regards to memoir
feel free to contact me by private mail or here on ctt, I find it
amusing trying to implement stuff using memoir.
/daleif
Wow - you were right ... the chapter styles for the memoir class are
great. Your paper detailing the different options is excellent.
And your book is typeset beautifully - I have no idea what it says, but
it looks great. :-)
I'm still trying to digest all the information for the memior class -
it will probably take me over the weekend to figure it out. Memoir has
a lot of options ... but unfortunately, my dissertation format is very
boring - everything in the same size font, all titles centerd (all
\MakeUppercase), ... all that ... very boring.
But yes, I would like to take a look at memoir, and I might get in
touch with you if I have some questions ... I think that using memoir
will help me with this thesis, and future projects. I can even send
you my .tex files to show you my thesis format requirements.
In any case, I really appreciate the help ... and I'm very impressed
with memoir and your book ... I'll probably be in touch. :-)
Thanks.
-matt
> but I meant colon ... it's been one of those weeks - brain cramps ...
Better than colon cramps I guess.
--
Donald Arseneau as...@triumf.ca
> If you want some inspiration about chapter designs, I have a showcase on CTAN
> (www.ctan.org/tex-archive/info/MemoirChapStyles).
Why do so many of those have more space below the unnumbered chapter
title than below the title for numbered chapters?
--
Donald Arseneau as...@triumf.ca
hmm, very good question. I'll look into that in a later version. It's
interesting that it is also present in the standard memoir styles.
--
/daleif (remove RTFSIGNATURE from email address)
LaTeX FAQ: http://www.tex.ac.uk/faq
Superb Class: http://www.ctan.org/tex-archive/help/Catalogue/entries/memoir.html
LaTeX book: http://www.imf.au.dk/system/latex/bog/ (in Danish)
Remember to post minimal working examples.
The next version should look a lot better. Different chapter layout, different
text font, better TOC layout.
But I'll have to finish writing it first (and I'm not writing much at the moment).
>
> I'm still trying to digest all the information for the memior class -
> it will probably take me over the weekend to figure it out. Memoir has
> a lot of options ... but unfortunately, my dissertation format is very
> boring - everything in the same size font, all titles centerd (all
> \MakeUppercase), ... all that ... very boring.
>
Simple designs may also look great.
> But yes, I would like to take a look at memoir, and I might get in
> touch with you if I have some questions ... I think that using memoir
> will help me with this thesis, and future projects. I can even send
> you my .tex files to show you my thesis format requirements.
>
> In any case, I really appreciate the help ... and I'm very impressed
> with memoir and your book ... I'll probably be in touch. :-)
>
> Thanks.
> -matt
>
seems to be a simple problem
in the example code I use I have
\fancybreak{$***$}
\chapter*{...}
using
\fancybreak{$***$}\par
\chapter*{...}
solves the problem
I'll fix this and upload a new version to ctan.
> Lars Madsen wrote:
> > Donald Arseneau wrote:
> >> Why do so many of those have more space below the unnumbered chapter
> >>
> > hmm, very good question. I'll look into that in a later version. It's
> > interesting that it is also present in the standard memoir styles.
>
> in the example code I use I have
>
> \fancybreak{$***$}
> \chapter*{...}
>
> using
>
> \fancybreak{$***$}\par
> \chapter*{...}
>
> solves the problem
That shouldn't matter though. It is probably a bug in \fancybreak,
though maybe in \chapter. Very strange, though, if a \par before
\chapter* affects the spacing *after* the chapter title.
--
Donald Arseneau as...@triumf.ca
I don't think the problem is in \chapter since it works in the same way as in book.
Here is an example where I've added \fancybreak to a book example. Here you have
the same problem. It might be a design issue.
\documentclass{book}
\let\cleardoublepage\relax
\makeatletter
\newcommand{\fancybreak}{\@ifstar{\@sfbreak}{\@fbreak}}
\newcommand{\@fbreak}[1]{\par
\penalty -100
\noindent\parbox{\linewidth}{\centering #1}\null
\penalty -20
%% \vskip -\onelineskip
\@afterindentfalse
\@afterheading}
\newcommand{\@sfbreak}[1]{\par
\penalty -100
\noindent\parbox{\linewidth}{\centering #1}\null
\penalty -20
%% \vskip -\onelineskip
\@afterindenttrue
\@afterheading}
\makeatother
\begin{document}
\chapter{A chapter title}
Some text at the beginning of a chapter. And we add a lot of text to
make sure that it spans more than one line.
\par\fancybreak{$***$}%\par
\chapter*{A non-numbered chapter title}
Some text at the beginning of a chapter. And we add a lot of text to
make sure that it spans more than one line.
\thispagestyle{empty}
\end{document}
>Donald Arseneau wrote:
>> Lars Madsen <dal...@RTFSIGNATUREimf.au.dk> writes:
>>
>>
>>>Lars Madsen wrote:
>>>
>>>>Donald Arseneau wrote:
>>>>
>>>>>Why do so many of those have more space below the unnumbered chapter
>>>>>
>>>>
>>>>hmm, very good question. I'll look into that in a later version. It's
>>>>interesting that it is also present in the standard memoir styles.
>>>
>>>in the example code I use I have
>>>
>>>\fancybreak{$***$}
>>>\chapter*{...}
>>>
>>>using
>>>
>>>\fancybreak{$***$}\par
>>>\chapter*{...}
>>>
>>>solves the problem
>>
>>
>> That shouldn't matter though. It is probably a bug in \fancybreak,
>> though maybe in \chapter. Very strange, though, if a \par before
>> \chapter* affects the spacing *after* the chapter title.
>>
>>
>
>I don't think the problem is in \chapter since it works in the same way as in book.
>
>Here is an example where I've added \fancybreak to a book example. Here you have
>the same problem. It might be a design issue.
Since you nullify cleardoublepage, the paragraph started by
\fancybreak is not ended, and the chapter title is part of
the same paragraph as the ***. Thus, the \vspace command that
comes at the start of \@makeschapterhead is on the same line
as the first line of the title. But \vspace in a paragraph is
inserted _after_ the line it occurs in. So space that is intended
to be above the title (at the top of the page) ends up below it.
>
>\documentclass{book}
>\let\cleardoublepage\relax
The bug is in the above line. Change it to
\let\cleardoublepage\par.
Or make \fancybreak include \par (probably right before the
last penalty, which otherwise is a line break penalty).
Plus, I can't see what that \null is meant to do.
Dan
To reply by email, change LookInSig to luecking
*** Posted via a free Usenet account from http://www.teranews.com ***
that was what I came to as well
>> \documentclass{book}
>> \let\cleardoublepage\relax
>
> The bug is in the above line. Change it to
> \let\cleardoublepage\par.
sounds reasonable. I'll add it to a later version.
Just uploaded an edited version earlier today.
>
> Or make \fancybreak include \par (probably right before the
> last penalty, which otherwise is a line break penalty).
>
> Plus, I can't see what that \null is meant to do.
>
I think that up to Peter Wilson (when he gets back online)
> Since you nullify cleardoublepage, the paragraph started by
> \fancybreak is not ended,
Indeed. I've had a chance to look in memoir, and \fancybreak is
deficient. But also it is not unexpected if there are problems
after breaking a basic command like \cleardoublepage (so you can't
fault \chapter)....
> >\let\cleardoublepage\relax
> The bug is in the above line. Change it to
> \let\cleardoublepage\par.
Even that might allow some woe, if macros rely on \cleardoublepage
actually clearing the page and floats (and \prevdepth). But for
the little demos at hand, it is sufficient to watch out for any
unexpected troubles.
Oh, I would do \renewcommand\cleardoublepage{\par} just in case you
catch \par when it means something special (it changes meaning in
LaTeX).
> Or make \fancybreak include \par (probably right before the
> last penalty, which otherwise is a line break penalty).
> Plus, I can't see what that \null is meant to do.
My guess is that the \null was supposed to be \par. On the
other hand it might have been an incomplete attempt to remove the
depth of the \parbox (...\parbox{}\par\nobreak\null\penalty...).
--
Donald Arseneau as...@triumf.ca