Search code examples
markdownmarp

Add internal links to a MARP presentation


I have a basic MARP presentation, https://github.com/marp-team/marp. I would like to add links to emulate footnotes or references. Is this possible, what about the PDF export?

Some text with source. [1]

The "1" should link to another slide:

1. some description

PS I do not have enough reputation to create the marp tag for this question, as described by the MARP Readme.


Solution

  • There are a couple of different options depending on what you want them to look like.

    Look at the Slide 3 example below. Just create a normal markdown link and put #n after the filename where n = your desired slide number.

    For links that look like footnotes you can apply the styling found in Slide 2.

    ---
    marp: true
    theme: gaia
    paginate: true
    class: invert
    ---
    
    # Slide 1
    
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur non maximus tortor, eget rutrum turpis. Suspendisse tortor ex, dictum a turpis a, imperdiet imperdiet nisi.
    
    ---
    
    <!-- _footer: "1. www.google.com" -->
    
    # Slide 2
    
    - Footnote link only <sup>1<sup>.
    - Footnote and superscript link <sup>[1][1]</sup>.
    
    [1]: https://www.google.com
    ---
    
    # Slide 3
    
    Inline link [to slide 1](./file-name.html#1)