我想創(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!
就我而言,我想要鏈接到的部分是選項(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 :(
編輯:要明確的是 - 我的問(wèn)題不是如何創(chuàng)建選項(xiàng)卡集,或者如何創(chuàng)建內(nèi)部鏈接/錨點(diǎn),而是交集:如何創(chuàng)建到選項(xiàng)卡式部分的內(nèi)部鏈接。輸出應(yīng)如下所示:
我嘗試了一些替代錨點(diǎn)方法(例如命名要鏈接到的部分,并在鏈接中使用該名稱)。但沒(méi)有喜悅。該鏈接在輸出中突出顯示,表明它應(yīng)該可以工作,但單擊后卻不起作用。
我沒(méi)有發(fā)現(xiàn)任何內(nèi)容表明您無(wú)法鏈接選項(xiàng)卡式部分,因此我在這里詢問(wèn)是否有辦法,或者只是沒(méi)有辦法。
謝謝!
我剛剛遵循了這個(gè)答案。如果您想鏈接更大的部分(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é)](#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)記為無(wú)法修復(fù)的錯(cuò)誤。設(shè)計(jì)不支持,請(qǐng)參閱 GitHub 上的問(wèn)題。