Discussion:
chapter subtitle
(too old to reply)
TinTin™
2005-10-14 13:07:31 UTC
Permalink
What I would like to do is the following;

change the \chapter[short]{long} in such a way that the short is
printed as the chapter maintitle and the long is printed as a subtitle.
(short would still be printed in the toc)

I'm quite new to LaTeX, and can't seem to understand how the short is
added the the toc. If I understand that I can probably figure out how I
can get this demand satisfied.

Does anyone out there know of a class file which does what I want?
Or can you give me some pointers.

I am using the book.cls

Greetings,

Sido Jensma
Morten Høgholm
2005-10-14 13:36:59 UTC
Permalink
Post by TinTin™
What I would like to do is the following;
change the \chapter[short]{long} in such a way that the short is
printed as the chapter maintitle and the long is printed as a subtitle.
(short would still be printed in the toc)
Ah, then you're probably looking for something like
<http://www.tex.ac.uk/cgi-bin/texfaq2html?label=epigraph>.
Post by TinTin™
I am using the book.cls
You might also want to look at
<http://www.tex.ac.uk/cgi-bin/texfaq2html?label=replstdcls>.
--
Morten
TinTin™
2005-10-14 14:25:59 UTC
Permalink
Thanks for your quick response. Epigraph could do what I want to do,
however I don't find it an elegant solution.

As for the other link I will look into that.

More suggestions??
--
sido
TinTin™
2005-10-14 14:57:17 UTC
Permalink
OK, I succeeded in doing what I wanted to do By doing this;
\newcommand\chapter{\***@openright\cleardoublepage\else\clearpage\fi
\thispagestyle{plain}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \***@secnumdepth >\***@ne
\***@mainmatter
\refstepcounter{chapter}%
\typeout{\@chapapp\space\thechapter.}%
\addcontentsline{toc}{chapter}%
{\protect\numberline{\thechapter}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
\***@twocolumn
\@topnewpage[\@makechapterhead{#1}]%
\@topnewpage[\@makesubchapterhead{#2}]
%<--------------------------
\else
\@makechapterhead{#1}%
\@makesubchapterhead{#2}
%<--------------------------------------------------
\@afterheading
\fi}
\def\@makechapterhead#1{%
\vspace*{50\p@}%
{\parindent \z@ \raggedright \normalfont
\ifnum \***@secnumdepth >\***@ne
\***@mainmatter
\raggedleft\sffamily\huge \@chapapp\space \thechapter
\par\nobreak
\vskip 20\p@
\fi
\fi
\interlinepenalty\@M
\Huge \bfseries #1\par\nobreak
\vskip 0\p@
}}
\def\@makesubchapterhead#1{%
<-------------------------------------------------------------------
\begin{flushright} \sffamily \bfseries \Large #1\par\nobreak
\end{flushright}%<---------------
}

So now I get

CHAPTER 1

SHORT
and a longer subtitle which clarifies things (hopefully)

By giving this command \chapter[short]{and a longer subtitle which
clarifies things (hopefully)}

I'm sorry next time I won't rush to mailinglist and give it more
extensive try myself.

--
sido
Lars Madsen
2005-10-14 15:03:16 UTC
Permalink
[snip]

and you are aware that this breaks the normal functionality of the \chapter
command? where

\chapter[short]{long}

results in

short in the header and the toc and long as the chapter title.

and in memoir you could even do

\chapter[toc][header]{title}
--
/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.
TinTin™
2005-10-14 15:12:42 UTC
Permalink
I am aware. I will use this class for personal use and I don't find it
obtrusive. When I have time I will make the
\chapter[toc][header]{title} work.

Thank you,
sido
Michael
2005-10-14 16:02:48 UTC
Permalink
Perhaps it would be easier to declare an own chapter command like:

\newcommand\mychapter[2]{ \chapter[#1]{#1, #2}}
Post by TinTin™
I am aware. I will use this class for personal use and I don't find it
obtrusive. When I have time I will make the
\chapter[toc][header]{title} work.
Thank you,
sido
TinTin™
2005-10-16 21:03:09 UTC
Permalink
In order to make my class file usefull to friends and family in the
future I decided to restore the chaptercommand and simply add a new
command

\newcommand*{\chapSub}[1]%
{
\ifthenelse{\equal{#1}{}}{\relax}{#1}}
}
Which I added to the chapterpage, this also gives me what I want.

--
sido
Michael
2005-10-17 17:35:36 UTC
Permalink
Maybe I'm missing something subtle, but whats the difference with:
\newcommand*{\chapSub}[1]{#1}
or
\newcommand*\chapSub[1][]{ \ifthenelse{\equal{#1}{}}{\relax}{#1}}}
?
Post by TinTin™
In order to make my class file usefull to friends and family in the
future I decided to restore the chaptercommand and simply add a new
command
\newcommand*{\chapSub}[1]%
{
\ifthenelse{\equal{#1}{}}{\relax}{#1}}
}
Which I added to the chapterpage, this also gives me what I want.
--
sido
Donald Arseneau
2005-10-18 13:55:37 UTC
Permalink
Post by Michael
\newcommand*{\chapSub}[1]{#1}
or
\newcommand*\chapSub[1][]{ \ifthenelse{\equal{#1}{}}{\relax}{#1}}}
?
The former requires the argument in braces, and the braces must be
provided even when the parameter is null.

The latter requires the argument in square brackets, and the brackets
may be omitted in the case of a null argument.
--
Donald Arseneau ***@triumf.ca
Loading...