I will use this proof in manuscript. It is clearly plagiarism if I just write down the proof and do not cite the original content.

However, how do I cite an answer in StackExchange? It is neither a blog post, nor a text in a personal website. It is an answer to a question. Should I go with traditional style such as

[1] Gjergji Zaimi (stackexchange username) “Answer to Question 'Unique ways to keep N balls into K Boxes?' ” https://math.stackexchange.com/a/58756/130361. Aug 2011. Last accessed: 2017-02-12

or is there any formal method to do this?

  • Are you using a specific citation style? Feb 12, 2017 at 16:48
  • 19
    As a side comment, you should not cite this particular stackexchange answer unless you have a really good reason to cite it specifically. This is a standard topic in combinatorics ("compositions of n into k parts"), and it can be found in lots of textbooks. For example, it's in Section 1.2 of Stanley's Enumerative Combinatorics volume 1, as well as plenty of other books (where you can also find the proof given in the stackexchange answer, if you care about that specific proof). I can't think of any plausible circumstances in which this stackexchange answer would be the best source to cite. Feb 12, 2017 at 17:10
  • 8
    The same proof is given in the Handbook of Combinatorics (Volume II, Chapter 21, page 1026, which is the same as page 4 of the preprint www-math.mit.edu/~rstan/pubs/pubfiles/79.pdf). Feb 12, 2017 at 21:29
  • 3
    @padawan Even if the proof is good in your context, the source is not. In many subject areas internet souces are not considered good because of many factors (questionable site reputation, user generated, subject to edits/removal, not peer-reviewed, ...)
    – Ian
    Feb 13, 2017 at 7:43
  • 2
    Cited references are expected to be "reliable" and come in many ways: journal papers, conference papers, theses and books. Still, time changes! Some people started to cite blog, tweets, etc. In your situation, the problem is that the SO answer is not original but was more of a helper. You could cite the SO answer in the acknowledgments of the article, either with a URL in the text or with a citation to a "Misc" or "Electronic" item in bibtex, thus having a proper author and year for the citation. Feb 13, 2017 at 9:17

2 Answers 2


There is a link at the bottom that provides a citation in bibtex or amsrefs format;

citation link

Clicking on this particular link the bibtex citation generated is;

@MISC {58756, TITLE = {Unique ways to keep N balls into K Boxes?}, AUTHOR = {Gjergji Zaimi (https://math.stackexchange.com/users/14274/gjergji-zaimi)}, HOWPUBLISHED = {Mathematics Stack Exchange}, NOTE = {URL:https://math.stackexchange.com/q/58756 (version: 2011-08-21)}, EPRINT = {https://math.stackexchange.com/q/58756}, URL = {https://math.stackexchange.com/q/58756} }

You could put that in your .bib file. From that point, it really depends how the rest of your citations are being formated. You might get something like;

citation style

That seems like a pretty standardised way to do it.

  • 2
    How do I do this for other sites like stack overflow?
    – Pro Q
    Nov 11, 2018 at 21:38
  • 1
    @ProQ Well you could fill in equivalent details in the same form as auto generated for the sites that do support it?
    – Clumsy cat
    Nov 13, 2018 at 10:53

Here is another, more specific example:

Over on Mathematica.SE a rewrite of a minimization algorithm to save computational time helped the OP of this question to complete some data analysis and publish a paper. The reimplementation was cited in the paper as Ref. 35.

Not the answer you're looking for? Browse other questions tagged .