我想創(chuàng)建一個(gè)指向 rmarkdown 文件中某個(gè)部分的內(nèi)部鏈接,但該部分是一個(gè)選項(xiàng)卡,標(biāo)準(zhǔn)鏈接方法似乎不起作用。
標(biāo)準(zhǔn)方法是:
--- title: "Untitled" output: html_document --- # Section to link to text and more # Next section See [this section](#section-to-link-to) Works!
就我而言,我想要連結(jié)到的部分是選項(xiàng)卡集的一部分:
--- title: "Untitled" output: html_document --- # Section {.tabset} ## Subsection to link to text and more ## Next subsection text and more # Next section See [this section](#subsection-to-link-to) Doesn't work :(
編輯:要明確的是 - 我的問題不是如何建立選項(xiàng)卡集,或如何建立內(nèi)部連結(jié)/錨點(diǎn),而是交集:如何建立到選項(xiàng)卡式部分的內(nèi)部連結(jié)。輸出應(yīng)如下圖所示:
我嘗試了一些替代錨點(diǎn)方法(例如命名要連結(jié)到的部分,並在連結(jié)中使用該名稱)。但沒有喜悅。該連結(jié)在輸出中突出顯示,表明它應(yīng)該可以工作,但單擊後卻不起作用。
我沒有發(fā)現(xiàn)任何內(nèi)容表明您無法連結(jié)選項(xiàng)卡式部分,因此我在這裡詢問是否有辦法,或者只是沒有辦法。
謝謝!
我剛剛遵循了這個(gè)答案。如果您想連結(jié)更大的部分(Section
),您可以使用:#section
。
程式碼:
--- title: "Untitled" output: html_document --- # Section {.tabset} ## Subsection to link to text and more ## Next subsection text and more # Next section See [this section](#section) This seems to work
要連結(jié)該小節(jié),如您所提到的,您可以使用:[本節(jié)](#subsection-to-link-to)
。
程式碼:
--- title: "Untitled" output: html_document --- # Section {.tabset} ## Subsection to link to text and more ## Next subsection text and more # Next section See [this section](#subsection-to-link-to) This seems to work
這似乎是一個(gè)標(biāo)記為無法修復(fù)的錯(cuò)誤。設(shè)計(jì)不支持,請(qǐng)參閱 GitHub 上的問題。