Edit 1: I just see that the links in the MWE do not work (they lead all to page 1). Do you have an idea why?
Edit 2: Apparently, \hyperlink{label}{text}
works and \hyperref[label]{text}
does not work (I updated the MWE).
- This is maybe too much to ask!
- I want to have the bars (
ganttbar
) to be clickable (pgfgantt
) so that a click leads to another section within abeamer
document, e. g. like\hyperref[label]{text}
(Update:\hyperlink{label}{text}
). - The MWE below has clickable text but not clickable bars. The goal is that the bars (
ganttbar
) are clickable and lead to the corresponding sections.
The initial syntax \hyperref[label]{text}
that you tried was quite reasonable; however, for some reason, beamer
seems to work better with \hyperlink{label}{text}
, which is not the normal way to use \hyperlink
(see here for instance).
Other than that, it is possible to make only the bars clickable by using this improvement of a clever trick from Master Jake. The idea is that we can pass hyperlink={label}
to the TikZ node that represents the bar; thanks to the use of /tikz/append after command
, this will place an additional node exactly on top of the bar node. This additional node contains an invisible \rule
that precisely covers the bar node and is made into a hyperlink using \hyperlink{label}{...}
(a LaTeX label works here because this is for beamer
: see the previous paragraph).
For the screenshot below, I uncommented the \hypersetup{pdfborder={0 0 1}}
at the top so that you can see in gray the extent of each hyperlink:
One could abuse the annotations from the @frougon’s fantastic answer (this will make the whole line clickable, not just the bar):