0

Ultimately, for certain chapterlike sections, I would like to change the word "Chapter" to something else (i.e. "Conclusion"), while also suppressing the chapter number and still maintaining the chapter title (i.e. "Observations and Prospects for Future Research"). I would also like both the Table of Contents and the pdfbookmark to then read "Conclusion. Observations and Prospects for Future Research" the way you would normally have "Chapter 1. Preliminaries" for example).

Using \chapter*{Observations and Prospects for Future Research} kills the word "Chapter" altogether so I suspect some variation of \chapter is in order. Several problems come up, but I'll list the main two.

Assume for now that I am using \chapter{Observations and Prospects for Future Research} and making no attempt to suppress the chapter number. If I use \renewcommand{\chaptername}{Conclusion} the word "Chapter" is replaced as desired, but it is not capitalized. If I instead use \renewcommand{\chaptername}{CONCLUSION} it is capitalized everywhere (toc and bookmarks included) instead of only on the first page of the conclusion where it should be all caps. The amsbook.cls file uses \def\chaptername{Chapter} for this definition, so I am confused as to why the first option doesn't work.

The second problem concerns my attempt to suppress the chapter number. Using \renewcommand{\thechapter}{} gets rid of the number, but also suppresses the word "Conclusion" (or whatever comprises \chaptername) in the bookmarks. It appears properly on the first page of the conclusion and in the toc.

What is the simplest way to deal with these two issues?

mdpugh
  • 1
  • Maybe some variation of https://tex.stackexchange.com/questions/35433/creating-unnumbered-chapters-sections-plus-adding-them-to-the-toc-and-or-header would be sufficient? – Marijn Jan 03 '22 at 19:43
  • Unstated in this question, but noted in comments on the answer, this problem also involves the use of titlesec. That should have been included in the original question. – barbara beeton May 29 '23 at 14:37

1 Answers1

0

In my personal opinion, the “conclusions and prospects for future research” should be the final section of the introduction. There's no point in placing them at the end of the document, where nobody will find them.

Alternatively, they should be a standard numbered chapter, why not?

However, I know that in some fields having the conclusions where they shouldn't be is quite fashionable.

\documentclass[a4paper]{amsbook}
\usepackage{xpatch}

\usepackage{lipsum}

\makeatletter \newcommand{\nonumberchapter}[2]{% \begingroup \renewcommand{\chaptername}{#1}% \xpatchcmd{@makechapterhead}{\enspace\thechapter}{}{}{}% \addtocontents{toc}{\let\protect\tocchapter\protect\tocchapter@mod}% \chapter{#2}% \markboth{\MakeUppercase{#2}}{\MakeUppercase{#2}}% \addtocontents{toc}{\let\protect\tocchapter\protect\tocsection}% \endgroup } \protected\def\tocchapter@mod#1#2{#1. } \makeatother

\begin{document}

\frontmatter

\tableofcontents

\mainmatter

\chapter{Title of a chapter}

\nonumberchapter{Conclusion}{Observations and Prospects for Future Research}

\lipsum[1-20]

\end{document}

The table of contents.

enter image description here

The chapter heading.

enter image description here

The header in an even page.

enter image description here

The header in an odd page.

enter image description here

egreg
  • 1,121,712
  • Thank you--this is almost working and I know your solution should work, so I must have something going on that hasn't yet been brought into the picture. The capitalization issue is solved and everything is appearing as it should on the first page of the nonumberchapter, the toc, and the pdfbookmarks that hyperref generates. The only problem is that the chapter number is still there. I think the \xpatchcmd is not replacing \enspace\thechapter with `` as it should. Does hyperref or any other packages that you're aware of modify \@makechapterhead? What else could be going wrong? – mdpugh Jan 03 '22 at 23:57
  • Okay, I found the problem. I am loading titlesec also. I know it doesn't generally play well with amsbook.cls, but I need it for another unrelated reason and it has not presented a problem until now. I replaced your \xpatchcmd{\@makechapterhead}{\enspace\thechapter}{}{}{}% line with \xpatchcmd{\ttl@save@mkchap}{\enspace\thechapter}{}{}{}% and that almost fixed the problem. The "chapter" number does not appear on the first page of the "chapter" nor in the toc. But it is still appearing in the pdfbookmark generated by hypperref. This is the only remaining problem. – mdpugh Jan 04 '22 at 01:23
  • @mdpugh I can only say that you either use amsbook or titlesec, not both together. – egreg Jan 04 '22 at 10:07
  • First of all, I really appreciate your help; you have saved me a lot of time hunting through code. After further investigation, although having titlesec loaded caused part of the problem (which was fixed by changing which command \xpatchcmd patched), that is not what is causing the chapter number to appear in the pdfbookmarks. I commented out the line that loaded titlesec and the problem persists. I think the solution is to patch a command in hyperref.sty the way you proposed to patch \@makechapterhead in amsbook.cls, but I haven't found it yet. – mdpugh Jan 04 '22 at 18:19
  • 1
    @mdpugh I'm not sure this can be solved; not in an easy way, at least: one has to go through all patches done by hyperref, I believe. – egreg Jan 04 '22 at 18:24