【问题标题】:Citing the author of a blockquote using Markdown syntax使用 Markdown 语法引用块引用的作者
【发布时间】:2010-01-04 20:45:03
【问题描述】:

我使用的是SymfonyCMS,它使用 Markdown 来写文章。我需要对来自Benjamin Franklin 的引用进行引用,并希望在引用后面加上引用,但现在它所做的只是引用整行。如何在 markdown 语法中做到这一点?

【问题讨论】:

  • 我希望答案会有所改变:``` @inproceedings{zhou2019objects, title={Objects as Points}, author={Zhou, Xingyi and Wang, Dequan and Kr{\"a }henb{\"u}hl, Philipp}, booktitle={arXiv preprint arXiv:1904.07850}, year={2019} } ``` 到 APA 或 IEEE 内联引文 + 参考书目。我希望....但这显然不是乳胶

标签: markdown citations


【解决方案1】:

Markdown 没有专门的引用语法。

你最好的选择是这样的:

> Quote here.
>
> -- <cite>Benjamin Franklin</cite>

导致:

在这里引用。

-- 本杰明·富兰克林

【讨论】:

  • 我会使用 —而不是两个连字符。
  • @Evan 风格完全取决于用户。我的 Markdown 安装包括 Smartypants,它变成了一个 emdash。
  • 引用不正确,用于标记人名。 dev.w3.org/html5/spec/single-page.html#the-cite-element
  • @Paul 在这种情况下,我很乐意忽略他们的建议。鉴于口头演讲,而不仅仅是出版物,通常可以在学术著作中被引用,我也很乐意将其称为网络引用。
  • 仅说明作者根据本文档似乎没有错误用法:w3.org/html/wg/drafts/html/master/…我引用:The cite element represents a reference to a creative work. It must include the title of the work or the name of the author(person, people or organization) or an URL reference, or a reference in abbreviated form as per the conventions used for the addition of citation metadata.
【解决方案2】:
> The secret to creativity is knowing how to hide your sources. 
> -- <cite>[Albert Einstein][1]</cite>

[1]: http://www.quotedb.com/quotes/2112

如果您有风格手册,请使用其指南来确定在何处放置引文等。

Markdown + Smartypants 以上的输出是

创造力的秘诀是知道如何隐藏你的来源。 -- Albert Einstein

【讨论】:

  • “我会使用 &amp;mdash; 而不是两个连字符。”, -- @Evan, stackoverflow.com/a/2002150/934739#comment1923634_2002150
  • 要将引用推送到换行符,请在前一行的末尾添加 2 个空格,例如在上面的“来源”之后添加 2 个空格。
  • “Smartypants”是一个严重超载的术语。在这种情况下它是什么?一些 JavaScript 库?你有参考吗(回复editing your answer,这里不在评论)?
  • @PeterMortensen 我认为他指的是阿尔伯特·爱因斯坦,但我可能错了。
【解决方案3】:
> Quote

— Benjamin Franklin

根据HTML Living Standard,引用的出处必须放在blockquote元素之外。

引用的属性(如果有)必须放在 blockquote 元素之外。

——HTML Standard: 4.4.4. The blockquote element

请注意,cite 元素代表作品的标题,不得用于标记人名。更多详情请查看HTML Standard: 4.5.6 The cite element

通常使用破折号 (U+2014) 而不是连字符。许多 Markdown 解析器支持 Unicode,这意味着您可以直接编写 em 破折号,而不是使用 HTML entities。直接编写这样的字符可以提高可读性,更多的工具会知道你想要什么而不会惊慌,而且你的文档可能更便携,因为你没有将自己限制在 HTML 中。

【讨论】:

  • 您在这里使用 HTML 标准进行降价?我认为这是一个非常巧妙的想法!我想没有生活降价标准,对吧?并感谢您的链接。
【解决方案4】:

在此处添加另一个示例以供参考。从https://en.wikipedia.org/wiki/Special:CiteThisPage生成

> Test-driven development (TDD) is a software development process that relies on the repetition of a very short development cycle: requirements are turned into very specific test cases, then the software is improved to pass the new tests, only. 
>
> --- [Test-driven development. (2016, November 20). In Wikipedia, The Free Encyclopedia. Retrieved 23:45, November 20, 2016](https://en.wikipedia.org/w/index.php?title=Test-driven_development&oldid=750634597)

产生以下内容:

测试驱动开发 (TDD) 是一个依赖于重复非常短的开发周期的软件开发过程:需求被转化为非常具体的测试用例,然后软件被改进以通过新的测试。

--- Test-driven development. (2016, November 20). In Wikipedia, The Free Encyclopedia. Retrieved 23:45, November 20, 2016

【讨论】:

    【解决方案5】:

    1.因为任何引用都应该有来源,即使它是未知的。

    2.自从降价 &gt; Quote 呈现为 &lt;blockquote&gt;&lt;p&gt;Quote&lt;/p&gt;&lt;/blockquote&gt;

    > Quote1
    >
    > Quote2
    

    呈现为

    <blockquote>
      <p>Quote1</p>
      <p>Quote2</p>
    </blockquote>
    

    我对此的解决方案总是将最后一个 &lt;p&gt;&lt;/p&gt; 作为源并通过 css 处理它(在我的情况下是 SCSS):

    blockquote {
        p {
            display: inline;
    
            &:first-of-type {
                quotes: '\201C' '\201D' '\2018' '\2019';
    
                &::before {
                    content: open-quote;
                    margin-right: 0.1rem;
                }
            }
    
            &:last-of-type {
                quotes: '\201C' '\201D' '\2018' '\2019';
                font-style: italic;
    
                &::before {
                    content: close-quote "\000A" "\2014" " ";
                    white-space: pre;
                    margin-left: 0.1rem;
                    font-style: normal;
                }
            }
    
            // In case of a quote without a source.
            &:only-of-type {
                font-style: normal;
                quotes: '\201C' '\201D' '\2018' '\2019';
    
                &::before {
                   content: open-quote;
                   margin-right: 0.1rem;
                }
    
                &::after {
                    content: close-quote;
                    margin-left: 0.1rem;
                }
            }
        }
    }
    

    \000Anew line unicode character css format,它有助于使源代码出现在下一行,如果您不想要,只需将其删除并在其中添加一些空格。其他也是unicode字符css格式。

    【讨论】:

      【解决方案6】:

      我个人更喜欢将块引用嵌套在块引用中。

      我喜欢这样做:

      > Quote here.
      >
      >> <cite>Benjamin Franklin</cite>
      

      输出因你对所有内容的样式而异,但使用普通的 `ol github 看起来像这样,我个人认为这看起来很棒!

      https://gist.github.com/nahtnam/63e3a14acd0f02313ec0

      【讨论】:

      • 虽然这在 Markdown 预览器中看起来不错,但这在语义上并不正确。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-04-28
      • 2013-06-14
      • 2021-03-12
      • 1970-01-01
      • 2012-10-03
      • 1970-01-01
      • 2017-01-20
      相关资源
      最近更新 更多