Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

navigation window for pdfs #72

Closed
parkus opened this issue Sep 19, 2018 · 2 comments · Fixed by #94
Closed

navigation window for pdfs #72

parkus opened this issue Sep 19, 2018 · 2 comments · Fixed by #94
Labels
a11y accessibility related issue bug bug; something to be fixed in AASTeX
Milestone

Comments

@parkus
Copy link

parkus commented Sep 19, 2018

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 breaks hyperref. Even better than having to use hyperref 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 to article, then the generated PDF will show the section headings in a navigation pane. (Make sure to delete the intermediate files before regenerating a PDF.)

\documentclass{aastex62}
\usepackage{hyperref}

\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. 

\section{Conclusions}
I recommend listening to the series as an audiobook on cross-country drives. 

\end{document}
@augustfly
Copy link
Member

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}

@augustfly augustfly added bug bug; something to be fixed in AASTeX a11y accessibility related issue labels Sep 19, 2018
@augustfly augustfly added this to the v6.3 milestone Sep 19, 2018
@parkus
Copy link
Author

parkus commented Sep 20, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y accessibility related issue bug bug; something to be fixed in AASTeX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants