Closed parkus closed 5 years ago
hi,
Yes, it is true that the ToC is disabled, but perhaps not why you think.
We directly import hyperref
into aastex6+
and as detailed in the documentation direct users to use \hypersetup
to modify the hyperlinking functionality as needed. Re-importing hyperref
is unnecessary.
However, it appears that a) we disable hyperref
bookmarks (and thus disable the ToC) by default in aastex62
(see aastex62.cls#L1997) and more critically b) unlike other hyperref
variables, this cannot be undone via hypersetup
.
In the MWE example below, you can see that the user can change the URL color, but if you watch the compile logs LaTeX complains that,
Package hyperref Warning: Option `bookmarks' has already been used, (hyperref) setting the option has no effect on input line 10.
While the user cannot change the bookmarks
default setting from false
to true
they can override the urlcolor
from blue to green. I'll have to dig to see why this is the case, but the issue for me is much bigger than author customization.
We have learned that a working table of contents is a critical step for creating PDFs that are accessible to those with disabilities. I am lost as to why we issue bookmarks=False,
as a default, though I am clearly the person to blame as I created that default block. Since this is most undesirable default behavior, I am marking this issue as a bug to be rectified in a future release. For now, modifying your individual aastex62
file to undo the bookmarks=false
should get you much closer to where you want to be for a working ToC in your manuscripts.
Mind the defaults even those set secretly by well-meaning AASTeX editors.
\documentclass{aastex62}
\hypersetup{
bookmarks=True,
urlcolor=green
}
\begin{document}
\section{Intro}
``The man in black fled across the desert, and the gunslinger followed.'' So begins Stephen King's \textit{Dark Tower} series.
\section{Body}
The series is quite long. See section \ref{sec:c}. \url{http://google.com}
\section{Conclusions}
I recommend listening to the series as an audiobook on cross-country drives.
\end{document}
Ah interesting. And even more interesting to know that this is actually an accessibility issue. Changing to bookmarks=true
in the aastex62.cls
file did the trick for me! Thank you for digging that out!
It is a nice feature to have an article's sections show up in the navigation pane of PDF viewers. Supposedly this can be achieved by simply adding
\usepackage{hyperref}
to the end of the preamble (https://tex.stackexchange.com/questions/42343), but it doesn't seem to work with AASTeX. Not essential, but it would be awesome if it did work, especially for really long articles! I suspect AASTeX might redefine the section commands in a way that breakshyperref
. Even better than having to usehyperref
would be if AASTeX automatically generated what is needed for the navigation pane.Below is an MWE. If the document class is changed from
aastex62
toarticle
, then the generated PDF will show the section headings in a navigation pane. (Make sure to delete the intermediate files before regenerating a PDF.)