8

I'm writing up my thesis right now, using memoir, and I have a problem with abstracts. Each chapter - besides the intro and conclusion - is an article published in a journal, and has its own abstract (which is in addition to the abstract at the beginning of the thesis). I like the way the abstract environment \begin{abstract}... typesets the abstracts for each chapter, but they show up as unnumbered chapters in the table of contents. If I use \abstractnum to force numbering it just numbers the abstracts as chapters; what I'd really like is for them to be numbered as sections:

2 Great chapter title
2.1 Abstract ....
2.2 Introduction ....
[...]

I've been up one side of Google and down the other to no avail, and I can't find anything in the memoir manual. Is there a simple way to do this in memoir, or do I have make the abstracts \section{}s and live with it?

Update:

I've been playing more and I can get the behaviour I want in individual chapters if I muck with the section numbering and add to the toc manually:

\begin{abstract}
\addtocounter{section}{1}
\addcontentsline{toc}{section}{\numberline{\thesection}Abstract}
...

But now I've got the opposite problem: I put the thesis abstract in the table of contents using \abstractintoc before the thesis abstract, but now the chapter abstracts show up twice, once as an unnumbered chapter and once as the properly numbered section:

2 Great chapter title
Abstract
2.1 Abstract..
2.2 Introduction...

Maybe it's easier to solve the problem when it's this way instead?

2
  • calling \abstractnum after the thesis abstract should be fine.
    – Stefan Kottwitz
    Mar 24, 2011 at 21:26
  • Welcome to tex.sx! It appears that your 2nd update is actually an answer to your question and not part of the question. So it would be great if you could post that update as an actual answer to your own question. (Yes, it's quite OK to post answers to own questions.) Then you can remove that answer from your question. Thanks! Mar 25, 2011 at 6:00

2 Answers 2

6

Besides calling \abstractnum, you can redefine \num@bs:

\makeatletter
\renewcommand*{\num@bs}{\section{\abstractname}}
\makeatother

It's originally defined in memoir.cls:

\newcommand{\num@bs}{\chapter{\abstractname}}

Instead of simply redefining this internal macro, you could create your own abstract environment using \renewenvironment{abstract}{...} and calling \section within.

As said in the comment, here's a minimal example:

\documentclass{memoir}
\abstractnum
\makeatletter
\renewcommand*{\num@bs}{\section{\abstractname}}
\makeatother
\listfiles
\begin{document}
\tableofcontents
\chapter{One}
\begin{abstract}
   Here is the abstract.
\end{abstract}
Text follows.
\end{document}

abstract as section

3
  • Hmm, thanks for the answer Stefan! Unfortunately, redefining \num@bs isn't doing anything; my abstracts show up just the same way (and I rudely updated the question while you were answering it :-).
    – Winawer
    Mar 24, 2011 at 21:01
  • @Winawer: you could show a minimal example which demonstrates that it doesn't work. I will add an example showing that it does work for me. We could compare to find the reason.
    – Stefan Kottwitz
    Mar 24, 2011 at 21:04
  • All right, that does it in the original (full) file too. Good enough for me! Thanks again.
    – Winawer
    Mar 24, 2011 at 21:26
3

Hendrik asked me to move this to a separate answer, so here it is...

Update: Following Stefan's awesome answer:

The minimal example you provided didn't quite work, Stefan, because I still need the thesis abstract and I need it unnumbered. But here's a minimal example that does work for me:

\documentclass{memoir}
\makeatletter
\renewcommand*{\num@bs}{\section{\abstractname}}
\makeatother

\listfiles
\begin{document}
\tableofcontents
\clearpage
\abstractintoc
\begin{abstract}
Here's the thesis abstract.  Should be unnumbered.
\end{abstract}

\abstractnum
\chapter{One}
\begin{abstract}
    Here is the chapter abstract.  Should be (and is) numbered.  
\end{abstract}
\section{Introduction}
Text follows.
\end{document}

Seems to work for me, so I'm going to go with that. :-)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .