210

I am using the Symfony CMS and it uses Markdown for article writing. I need to do a blockquote of a quote from Benjamin Franklin and would like to have the quote followed by a citation beneath it, but right now all it does is blockquote the whole line. How does one do this in markdown syntax?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
CMS Critic
  • 3,496
  • 4
  • 20
  • 13
  • I was hopiing the answer would something that change: ``` @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} } ``` To APA or IEEE inline citation + bibliography. I wish .... but this is not Latex apparently – Daniel Kurniadi May 08 '20 at 16:03

7 Answers7

266

Markdown has no dedicated citation syntax.

Your best bet is something like this:

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

which results in:

Quote here.

-- Benjamin Franklin

ceejayoz
  • 176,543
  • 40
  • 303
  • 368
  • 62
    I would use an — instead of two hyphens. – Evan Jan 05 '10 at 00:13
  • 10
    @Evan Style is entirely up to the user. My Markdown install includes Smartypants, which turns -- into an emdash. – ceejayoz Jan 05 '10 at 03:35
  • 10
    Cite is incorrect for marking person's name. http://dev.w3.org/html5/spec/single-page.html#the-cite-element – Atadj Sep 08 '12 at 12:48
  • 4
    @Paul This is a situation where I'm perfectly happy to ignore their recommendations. Given that spoken speeches, not just publications, can be typically cited in an academic work, I'm comfortable calling that a citation on the web too. – ceejayoz Sep 08 '12 at 16:43
  • 8
    Stating only the author doesn't seem to be incorrect usage according to this document: http://www.w3.org/html/wg/drafts/html/master/single-page.html#the-cite-element I quote: `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.` – Zelphir Kaltstahl Oct 31 '15 at 16:29
  • 3
    @Zelphir My primary answer would be "who cares?" My secondary answer would be that author-only seems fine from that wording, given that everything's joined by `or` not `and`. Title **or** author **or** URL **or** an abbreviated reference. – ceejayoz Nov 01 '15 at 00:04
  • @ceejayoz Haha, yes I also thought about the or connections there and decided to interpret them in that way :D I think I read that phrase three times or so – Zelphir Kaltstahl Nov 01 '15 at 09:59
123
> The secret to creativity is knowing how to hide your sources. 
> -- <cite>[Albert Einstein][1]</cite>

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

If you have a style manual, use its guidelines to determine exactly where to place the citation, etc.

Output of Markdown + Smartypants for the above is

The secret to creativity is knowing how to hide your sources. -- Albert Einstein

jcomeau_ictx
  • 37,688
  • 6
  • 92
  • 107
Darren Meyer
  • 2,251
  • 1
  • 14
  • 8
  • 9
    "I would use an `—` instead of two hyphens.", -- @Evan, http://stackoverflow.com/a/2002150/934739#comment1923634_2002150. – Gerard Roche Sep 10 '16 at 08:10
  • 3
    To push the citation to a newline add 2 spaces at the end of the preceding line e.g in the above add 2 spaces after "sources.". – Gerard Roche Sep 10 '16 at 08:19
  • "Smartypants" is a heavily overloaded term. What is it in this context? Some JavaScript library? Do you have a reference to it (respond by [editing your answer](https://stackoverflow.com/a/4810626), not here in comment)? – Peter Mortensen Mar 22 '20 at 21:53
  • 2
    @PeterMortensen I think he's referring to Albert Einstein, but I could be wrong. – Joshua Pinter May 11 '20 at 19:00
29
> Quote

— Benjamin Franklin

According to the HTML Living Standard, attribution for the quotation must be placed outside the blockquote element.

Attribution for the quotation, if any, must be placed outside the blockquote element.

HTML Standard: 4.4.4. The blockquote element

Note that the cite element represents the title of the work and must not be used to mark up people's names. For more detail check out HTML Standard: 4.5.6 The cite element.

Instead of the hyphen, it is common to use the em dash (U+2014). Many Markdown parsers support Unicode, which means you can write the em dash directly, instead of using HTML entities. Writing such characters directly improves readability, more tools will know what you want and not panic, and your document might be more portable as you are not bounding yourself to HTML.

touchmarine
  • 1,548
  • 9
  • 11
  • 2
    You used the HTML standard for markdown here? I think that is a pretty neat idea! I guess there is no living markdown standard, right? And thanks for the links. – winklerrr Oct 06 '21 at 08:51
7

Adding another sample here for reference. Generated from 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)

Produces the following:

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

Dilini Rajapaksha
  • 2,610
  • 4
  • 30
  • 41
4

Every pure markdown answer on this page adds a line between the quote and the citation:

Which looks something like this.

— 0x263a

Or they do:

Something like this. — 0x263a

But if you don't want that extra newline and you want the citation to appear on a separate line from the quote:

"Like this."
— 0x263a

You can add a \ to the end of your quote.

> "Quote."\
> — <cite>Author<cite>
0x263A
  • 1,807
  • 9
  • 22
2

1. Since any quote it is suppose to have a source, even if it is unknown.

2. Since a markdown > Quote is rendered as <blockquote><p>Quote</p></blockquote> and

> Quote1
>
> Quote2

is rendered as

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

My solution to this is always take the last <p></p> as source and handle it by css (in my case 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;
            }
        }
    }
}

The \000A it the new line unicode character css format, it help to make the source in appear in the next line, if you don't want, just remove it and add some spaces there. The others are also unicode character css format.

Undefined Behavior
  • 2,128
  • 4
  • 24
  • 34
-1

Personally I prefer nesting a blockquote in a blockquote.

Here is how I like doing it:

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

The output varies on how you style everything, but using plain `ol github look like this, which I personally think looks great!

enter image description here

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

nahtnam
  • 2,659
  • 1
  • 18
  • 31