Internal links in rmarkdown don't work

前端 未结 5 953
夕颜
夕颜 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条回答
  •  猫巷女王i
    2020-12-14 17:13

    You're not setting the anchors correctly.

    Try the following:

    # start
    
    ```{r results="asis",tidy=FALSE,eval=TRUE}
    cat("click here: [link1](#test1)")
    ```
    
    click here: [link2](#test1)
    
    \pagebreak
    
    # test 3 {#test3}
    
    \pagebreak
    
    #test 2 {#test2}
    
    \pagebreak
    
    #test 1 {#test1}
    

提交回复
热议问题