Document Classesmemoir and bookmark

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
magister
Posts: 17
Joined: Sun Aug 02, 2009 4:42 am

memoir and bookmark

Post by magister »

I'm using memoir and the bookmark package. I want the bookmarks in my PDF to appear like this when the document is opened:

Introduction
+Part I
+Part II
Bibliography
+Appendices
Glossary

What I'm getting is:

Introduction
+Part I
+Part II
Bibliography
Appendices
Appendix A
Appendix B
Appendix C
Glossary

If I understand correctly, memoir's appendix command redefines \chapter so that the label appears as Appendix (but I still started each appendix with a \chapter command).

So the levels for bookmarks should be: Part = -1, Chapter = 0 (also for Appendix), Section = 1. After studying the bookmark documentation, I thought that the following code would work:

Code: Select all

[end of the last chapter]
\bookmarksetup{startatroot}

\bibliography{bibdata}

\appendix
\appendixpage

\bookmarksetup{level=0}

\chapter{Appendix A}
text of appendix A
The startatroot command is necessary; otherwise the biblio, appendix page, and glossary are children of Part II rather than appearing on their own. And it works as expected.

But the Appendix A, B, and C appear on their own, not as children of the Appendices bookmark. I have tried all sorts of variations on this and also using \rellevel. I also tried setting the bookmarks manually in the appendix chapters but got two bookmarks for each. What I need to do is tell bookmark to make the appendix chapters be one level down (and therefore, presumably, not displayed) but I am obviously missing something. (This is my first time using bookmark.) I'd appreciate any help.

David

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

memoir and bookmark

Post by frabjous »

Could you provide a complete minimal working example, compiliable on its own, and not just a snippet?
magister
Posts: 17
Joined: Sun Aug 02, 2009 4:42 am

Re: memoir and bookmark

Post by magister »

See the attached. I omitted some fancy memoir code that prevents the glossary and the colophon from getting the title "Appendix X." That doesn't affect the PDF bookmark issue.

I'd like the PDF bookmarks to look like this:
+Part the First
+Part the Second
+Appendices
Glossary
Colophon

and NOT
+Part the First
+Part the Second
Appendices
Supplement 1
Supplement 2
Supplement 3
Glossary
Colophon
Attachments
minimal ex v2a.tex
(6.09 KiB) Downloaded 376 times
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

memoir and bookmark

Post by frabjous »

It seems to be some kind of problem with \appendixpage. Perhaps you could achieve the same effect with \part*?

E.g., try replacing

Code: Select all

\appendix
\appendixpage

\bookmarksetup{level=0}
with

Code: Select all

\clearpage\phantomsection%
\appendix%
\part*{Appendices}\addcontentsline{toc}{part}{Appendices}
But when I get a chance, I may play around with this some more. This is a weird problem, and I wonder if it's just for the memoir class.
magister
Posts: 17
Joined: Sun Aug 02, 2009 4:42 am

Re: memoir and bookmark

Post by magister »

Frabjous,

Your suggestion works well, at least in my minimal example; I'll go try it now in the main book file. Thanks also for your comment. Telling bookmark to go one level lower seemed like an easy enough thing to do, and I was getting very frustrated when I couldn't get it to work.

David
Post Reply