-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
beamer writer doesn't output \hypertarget
in header correctly
#3220
Comments
Hi, it seems that # Header1 {#head1}
## \hypertarget{abc}{abc}
text under abc
## \hypertarget{def}{def 1}
text under def
## \hypertarget{otherdef}{def 2}
link to [abc](#abc)
link to [def 1](#def) does the job. From Pandoc User's Guide:
|
Thanks! In this way the link points to the content under the header rather than the header itself (tried in okular), but this is totally acceptable. |
Should this really be closed? This seems like a workaround;
if there's a problem in pandoc, it should be fixed.
|
I didn't notice the username and thought that was the "official recommended solution" to this... Is it possible to make this work without inline latex code? |
According to the doc
a more pandoc way to achieve this could be # Header1 {#head1}
## abc {label=abc}
text under abc
## def 1 {label=def}
text under def
## otherdef
link to [abc](#abc)
link to [def 1](#def) |
Note that, in normal HTML, LaTeX, and ConTeXt and in other slide outputs, links to headings of whatever level work as advertised. The same is true of Beamer output except for whatever heading level is selected as the slide level. (Okay, for the above-slide-level links to work you have to remove [ignorenonframetext] from the class options.) Surely it makes sense to routinely add the |
@Frefreak - Disabling For this reason @georgejean's approach, which puts the hypertarget inside the frame title, seems better. (Of course, pandoc should do this automatically rather than making the user put in raw latex.) This should be an easy change; I'll put in in the pandoc 2.0 milestone. \begin{frame}{\hypertarget{abc}{abc}}
text under abc
\end{frame}
\begin{frame}{\hypertarget{def}{def 1}}
text under def
\end{frame}
\begin{frame}{\hypertarget{otherdef}{def 2}}
link to \protect\hyperlink{abc}{abc}
link to \protect\hyperlink{def}{def 1} |
Thank you. At that time I would use |
+++ Frefreak [Mar 15 17 18:23 ]:
Thank you. At that time I would use {#abc} instead of {label = abc}
right?
Correct.
|
Previously you could link to a header above or below slide level but not TO slide level. This commit changes that. Hypertargets are inserted inside frame titles; technically the reference is to just after the title, but in normal use (where slides are viewed full screen in a slide show), this does not matter. Closes #3220.
For this test snippet
I want the link under def points to abc header, the beamer output this by invoking
pandoc test.md -t beamer
:the generated pdf does contains a link but when clicked it redirects to the first page. If I manually add
\hypertarget{abc}{}
before the\begin{frame}{abc}
line and disable ignorenonframetext (which I know from this SO question) the link works as expected.Is this behaviour expected? Is there any easier way without manually modifying generated latex code to achieve the same effects? The latex writer (
-t latex
) seems create the link correctly though.The text was updated successfully, but these errors were encountered: