降价未编号部分,但需要锚定 [英] Markdown unnumbered section but needs anchor

查看:35
本文介绍了降价未编号部分,但需要锚定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Markdown文档,在该文档中我希望某些部分没有编号.但我也想为这些部分创建锚点.这是一个示例:

I am working with a Markdown document where I would like to have some sections not be numbered. But I also want to create anchors for these sections. Here is an example:

# Appendix A: Methodology {-} {#methodology}

我不想给附录A编号,但是我仍然想使用锚点链接到它.

I want to have Appendix A not be numbered but I still want to link to it using the anchor.

理想情况下,该解决方案适用于LaTeX PDF和HTML.我已经弄清楚了如何关闭LaTeX的编号部分 ,但是它不起作用用于HTML.

Ideally, the solution would work for both LaTeX PDF and HTML. I have figured out how to turn off the numbered section thing for LaTeX but it's not working for HTML.

推荐答案

如果要同时指定目标名称(#... )和类(例如 .unnumbered )作为标题,您必须使用一组大括号和正确的顺序.对于HTML和PDF输出,以下对我有用:

If you want to specify both a target name (#...) and a class (like .unnumbered) for a heading you have to use a single set of braces and the correct order. The following works for me for both HTML and PDF output:

---
output:
  html_document:
    number_sections: yes
  pdf_document: default
---


# R Markdown

See the appendix on [methodology](#methodology).


# Appendix A: Methodology {#methodology -}

这篇关于降价未编号部分,但需要锚定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆