Markdown 如何在标记标记中缩进几行?

Markdown 如何在标记标记中缩进几行?,markdown,Markdown,我想写几行文字。它们的格式应正常,但每行应从第6列开始。也就是说,我不希望代码块格式规则使这段文本看起来像代码,因为我将使用其他格式,如粗体等。如何在Markdown中做到这一点?在Markdown的本机功能中无法做到这一点。然而,markdown允许内联HTML,因此       This will appear with six space characters in front of

我想写几行文字。它们的格式应正常,但每行应从第6列开始。也就是说,我不希望代码块格式规则使这段文本看起来像代码,因为我将使用其他格式,如粗体等。如何在Markdown中做到这一点?

在Markdown的本机功能中无法做到这一点。然而,markdown允许内联HTML,因此

      This will appear with six space characters in front of it
This That And This That This And That 将产生:

这将在前面显示六个空格字符

如果您可以控制页面上的CSS,您还可以使用标签和样式,可以是内联的,也可以使用CSS规则。

无论哪种方式,markdown都不是用于布局的工具,而是用于简化web的编写过程,因此,如果您发现自己正在扩展其功能集以满足您的需要,您可能会看看是否使用了正确的工具。查看格鲁伯的文档:


一种方法是使用项目符号,它允许您指定多个缩进级别。使用两个空间的倍数插入项目符号,星形,另一个空间,例如:

this is a normal line of text
  * this is the first level of bullet points, made up of <space><space>*<space>
    * this is more indented, composed of <space><space><space><space>*<space>
这是一行普通的文本
*这是第一级要点,由*
*这是更加缩进的,由*
这种方法的最大优点是,当您查看原始文本时,它也是有意义的


如果您不想看到项目符号本身,您应该(取决于您使用markdown的位置)能够为整个标记区域向css添加
li{list style type:none;}

这是一个错误,但我认为markdown的blockquotes(“>”)最好是这样:

检查是否可以使用HTML标记。也许这适合你:

  • 列出一个条目


    缩进行




    还有一些
  • 第二项
    • 子条目


      你好

执行选项卡,然后是+符号,然后是空格,然后是您的内容

所以


*一级
+二级选项卡

如果您确实必须使用制表符,并且您不介意灰色背景色和填充,
标记可能会起作用(如果支持):

<pre>
This        That        And             This
That        This        And             That    
</pre>

这个,那个,还有这个
这个和那个
这个,那个,还有这个 这个和那个
一些降价实现似乎使用
~
字符进行缩进。

如何使用数学环境在段落开头放置一个确定的空格,如下所示:


$\qquad$我的文本行。。。


这对我有用,希望对你也有用。

另一种选择是使用像这样的标记编辑器。它在所见即所得编辑器中将html(或文本)转换为标记。您可以在编辑器中创建缩进、标题和列表,它将以标记格式显示相应的文本。然后,您可以保存、发布、共享或下载该文件。您可以访问它-无需下载

直接使用不间断空格
(与
!)不同)


(您可以插入HTML或一些深奥的标记代码,但我可以想出更好的理由来打破与标准标记的兼容性。)

回答MengLu和@lifebalance的问题,以回应SColvin的答案(我更喜欢它提供的控件的公认答案),在将显示设置为“无”时,似乎可以只针对列表的父元素,必要时添加周围元素。因此,如果我们假设我们这样做是为了一个目录,我们可以扩展SColvin的答案:

HTML

Line 1
> line 2 
>> line 3
查看此“>”是否有帮助:

请使用硬(不间断)空格 为什么要使用另一种标记语言?(我同意上面的@cz)。
标记的一个目标是使文档即使在纯文本编辑器中也可读

两种方法的结果相同 代码

## Option: Du Pont Ratio Concept - (ROE Decomposition)
### (Closed Quotes/Total Premium) = (Closed Quotes/Quotes Issued) X <br>
<h3 style="text-indent: 15em;">
 (Quotes Issued/Renewal Premium) X <br></h3>
<h3 style="text-indent: 15em;">
 (Renewal Premium/Total Premium)</h3>
结果

示例代码
在一个非常丑陋的代码中排名第五
清晰可读代码中的第5位
再次使用非中断空格:)

非中断空间(或硬空间)的可视表示形式通常为普通空间“”,但其Unicode表示形式为U+00A0。
普通空格的Unicode表示为U+0020(ASCII表中为32)。
因此,文本处理器的行为可能会有所不同,而视觉表示保持不变

插入硬空格 问题
一些文本编辑器可以在复制和粘贴操作中将硬空格转换为公共空格,因此请小心。

好的,在R代码中使用一点HTML,我执行了以下代码以在R标记中生成纯文本。
将文本缩进15个空格。对于原始问题,将15改为6

Nested deeper levels:
 ...Skip a line and indent eight spaces. (as said in the editor-help, just on this page)
* first level A item - no space in front the bullet character
 * second level Aa item - 1 space is enough
     * third level Aaa item - 5 spaces min
    * second level Ab item - 4 spaces possible too
* first level B item

        And there
        could be even more
        such octets of spaces.
##选项:杜邦比率概念-(ROE分解)
###(封闭报价/总溢价)=(封闭报价/已发行报价)X
(已发行报价/续期溢价)X
(续期保费/总保费)
因此,生成的代码给出了我想要的输出格式。我正在为降价文档使用制表符,并希望将有效的()文本对齐


对于引用/缩进的段落,此技巧可能有效(取决于渲染引擎):

其呈现为:


为了完整起见,更深的项目符号列表:

嵌套的更深层次:
----在这里留下一排空位
*第一级A项-项目符号字符前面没有空格
*二级Aa物品-1空间足够
*三级Aaa物品-最少5个空格
*二级Ab项目-也可能有4个空格
*第一级B项

嵌套的更深层次:

  • 第一级A项-项目符号字符前面没有空格
    • 二级Aa项目-1
      Sample code
      &nbsp;&nbsp;&nbsp;&nbsp;5th position in an really ugly code  
          5th position in a clear an readable code  
          Again using non-breaking spaces :)
      
      | OS        | Input method                      |
      |-----------| ----------------------------------|
      | macOS     | OPTION+SPACE (ALT+SPACE)          |
      | Linux     | Compose Space Space or AltGr+Space|
      | Windows   | Alt+0+1+6+0                       |
      
      Some text editor use Ctrl+Shift+Space.
      
      ## Option: Du Pont Ratio Concept - (ROE Decomposition)
      ### (Closed Quotes/Total Premium) = (Closed Quotes/Quotes Issued) X <br>
      <h3 style="text-indent: 15em;">
       (Quotes Issued/Renewal Premium) X <br></h3>
      <h3 style="text-indent: 15em;">
       (Renewal Premium/Total Premium)</h3>
      
      | | | |
      |-|-|-|
      |  | _"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."_ | |
      |
      
      Nested deeper levels:
       ...Skip a line and indent eight spaces. (as said in the editor-help, just on this page)
      * first level A item - no space in front the bullet character
       * second level Aa item - 1 space is enough
           * third level Aaa item - 5 spaces min
          * second level Ab item - 4 spaces possible too
      * first level B item
      
              And there
              could be even more
              such octets of spaces.
      
      <ul>
        <li>Coffee</li>
        <li>Tea
          <ul>
            <li>Black tea</li>
            <li>Green tea</li>
          </ul>
        </li>
        <li>Milk</li>
      </ul>
      
      Term 1
      : definition 1
      : definition 2
      
      Term 2
      : definition 1
      : definition 2
      
      <dl>
          <dt>Term 1</dt>
          <dd>definition 1</dd>
          <dd>definition 2</dd>
          <dt>Term 2</dt>
          <dd>definition 1</dd>
          <dd>definition 2</dd>
      </dl>
      
      &nbsp;
      : This is the text that I want indented.  All text on the same line as the preceding colon will be included in this definition.
      : If you include a second definition you'll get a new line; potentially separated by a space. <br />Some inline HTML may be supported within this too, allowing you to create new lines without spaces.
      : Support for other markdown syntax varies; e.g. we can add a bullet list, but each one's wrapped in a separate definition term, so the spacing may be out.
      : - item 1
      : - item 2
      : - item 3
      
      <ul>
      My indented text goes here, and it can be long and wrap if you like.
      And you can have multiple lines if you want.
      </ul>
      
      <div style="padding-left: 30px;">
      My text
      </div>