Internal links in rmarkdown don't work

前端 未结 5 958
夕颜
夕颜 2020-12-14 16:13

I use rmarkdown to render pdf documents. Now I want to add internal links in the texts.

In the helping pages of rmarkdown, it says an internal link is defined as:

5条回答
  •  忘掉有多难
    2020-12-14 17:03

    Here is a simple way of doing internal links/references in an RMarkdown PDF document:

    A) Create a section header:

    ## Homework Assignments{#hwks}
    

    B) After creating the section header. I can refer to it in my text like this:

    If you are having a hard time with your [homework](#hwks), we have some tutors who can help you. 
    

    This creates a link back to the section header entitled "Homework Assignments".

    Notice a couple of things in the way I set up the link:

    1. "homework" ==> the word (or phrase) I use to call the header is in brackets

    2. [homework] is immediately followed by the identifier "#hwks" that I created above, but the identifier is now in parentheses, as in: (#hwks)

    This always works for me!

    (This was my first post here; I hope it makes sense. :) )

提交回复
热议问题