hyperlinks to slides #424
-
I try to build some kind of TOC in Powerpoint with the phantastic offier package. Working with placeholders and ph_slidelink might be possible but laborious. ftext also does not have the possibility to support links. In flextable there seems to be a function hyperlink_text() - but only for Word as far as I can see. Is is possible to use it for slide links or is there any other way to achieve this task?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
hello Few comments/questions:
What you are trying to do seems very hard to me, unless we implement a derivate of Is PowerPoint the only option you have? Why not building an HTML version of your presentation. HTML is a very good format and usually provides more options than pptx (in that case, Your remark about This is an example using loc_title <- ph_location_type(type = "title")
doc <- read_pptx()
doc <- add_slide(doc)
doc <- ph_with(x = doc, "youp", location = ph_location(top = 0, newlabel = "a"))
doc <- ph_with(x = doc, "yoip", location = ph_location(top = 1, newlabel = "b"))
doc <- ph_with(x = doc, "yois", location = ph_location(top = 2, newlabel = "c"))
doc <- add_slide(doc)
doc <- ph_with(x = doc, "dummy title 1", location = loc_title)
doc <- add_slide(doc)
doc <- ph_with(x = doc, "dummy title 2", location = loc_title)
doc <- add_slide(doc)
doc <- ph_with(x = doc, "dummy title 3", location = loc_title)
doc <- on_slide(doc, 1)
doc <- ph_slidelink(x = doc, ph_label = "a", slide_index = 2)
doc <- ph_slidelink(x = doc, ph_label = "b", slide_index = 3)
doc <- ph_slidelink(x = doc, ph_label = "c", slide_index = 4)
print(doc, target = "fileout.pptx" ) What do you think of this? |
Beta Was this translation helpful? Give feedback.
-
Thanks David. Sometimes you have to use PPTX because "it's the way we do things, just do it". With respect to hyperlink_text() the Note in the reference says something about requiring word as output format (maybe I just misunderstood the intention of the note). So i didn't try to use it in Powerpoint. Now i tried, and: it works! Changing the package code to support internal links would mean some struggle with the "action" attribute of the a:hlinkClick XML-tag, but given the hyperlink_text()-functionality, I can already use the "#"-feature as a workaround which works with MS products (I guess it's not standard compliant though)
|
Beta Was this translation helpful? Give feedback.
-
yeah, I am ok with that. This is great, I didn't know using
I really don't know. I am almost sure I did not do anything about that. I am surprised it works, but I can reproduce and see it works. :) Also thanks for the feedback about the note. I will rephrase it. When I wrote that, I meant that if working with "R Mardown" and a Word output, the chunk would not be rendered correctly if |
Beta Was this translation helpful? Give feedback.
Thanks David. Sometimes you have to use PPTX because "it's the way we do things, just do it".
With respect to hyperlink_text() the Note in the reference says something about requiring word as output format (maybe I just misunderstood the intention of the note). So i didn't try to use it in Powerpoint. Now i tried, and: it works!
Changing the package code to support internal links would mean some struggle with the "action" attribute of the a:hlinkClick XML-tag, but given the hyperlink_text()-functionality, I can already use the "#"-feature as a workaround which works with MS products (I guess it's not standard compliant though)