TransWikia.com

Rename last chapter to epilogue,

TeX - LaTeX Asked by Maxim Moloshenko on August 14, 2021

First of all: I read through many possible solutions here, but none seem to work for me. I want to rename the last chapter of a book to be named “Epilogue” in the ToC and for all similar purposes AND have a ‘real’ name. So what I have now is:

Chapter heading:

enter image description here

Top of page in the epilogue:

enter image description here

Table of contents:

enter image description here

What I WOULD like to have is this:
enter image description here

So far I have tried putting different commands in front of the last chapter{} but it usually changed only a part, and never worked on the ToC, so I figured the trick might be somewhere in the definition of the ToC. EDIT: This is the most minimal example that I can produce in a reasonable time by checking if something breaks when I comment out stuff, as I don’t understand most of the advanced commands yet.

Bonus question: Could something be easily changed so that the odd and even side margins are different, so that it would be more suitable for printing?

documentclass[12pt,extrafontsizes,twoside,openright,final]{memoir}
begin{document}
tableofcontents*
chapter{Once upon a time}
there was a princess (more text here, so that it is actually
at least 3 pages)
fixepilogue
chapter{Epilogue: Ending}
then she died (more text here, so that it is actually at
least 3 pages)
end{document}

3 Answers

Okay, so I trimmed your MWE to the point that it was, in fact, both minimal (no extraneous font information, formatting, and so forth) and working (it compiled without error). I'm not going to duplicate your formatting; but the principle here works.

It appears that, for your TOC, you want the word "Epilogue" to replace your chapter number (which you give in words); the below code will do that. It also places the word "Epilogue" and the name of the epilogue in the header, though it doesn't format the header the way yours does. (You may need to switch the arguments in markboth to make this work for you; I didn't pay attention to which you want where.)

documentclass[12pt,extrafontsizes,twoside,openright,final]{memoir}
usepackage{lipsum}
begin{document}
tableofcontents*
chapter{Once upon a time}
there was a princess (more text here, so that it is actually
at least 3 pages)
renewcommand{chaptername}{Epilogue}
renewcommand{thechapter}{Epilogue}
makeatletter
renewcommand{@makechapterhead}[1]{%
    markboth{Epilogue}{#1}%
    vspace*{10pt}%
    begin{center}%
    LARGE%
    chaptername%
    vskip1em%
    leavevmode#1%
    end{center}%
    vspace*{10p@}%
}%
makeatother
chapter{Ending}
then she died (more text here, so that it is actually at
least 3 pages)lipsumlipsum
end{document}

What this code does is, just before your epilogue, redefine chaptername to be "Epilogue" (this makes it print "Epilogue" instead of "Chapter") and it redefines your chapter number to be "Epilogue", as well (this makes it print "Epilogue" instead of a chapter number in your TOC). It doesn't effect the chapter number itself, however, which internally is still the same.

It then redefines LaTeX's internal command @makechapterhead, in ways that should be pretty transparent. You can fix this to be formatted however you like. Here's what this code gives you, though:

Epilogue in TOC Epilogue in Header

I think this is the general outline of what you're looking for. Hope that helps.

Correct answer by dgoodmaniii on August 14, 2021

Basically all you have to do is

renewcommand{chaptername}{ignorespaces}
renewcommand{thechapter}{Epilogue}
chapter{Ending}

since this is the last chapter in the document. The chapter counter will still be stepped, even though it's not necessary.

Answered by Werner on August 14, 2021

For me the solution is

renewcommand{chaptername}{ignorespaces}
renewcommand{thechapter}{Epilogue}
chapter{}

and I avoided the superposition.

Answered by Arnaldo on August 14, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP