Search code examples
githubgithub-flavored-markdown

Cite a paper using github markdown syntax


I am coding a readme for a repo in github, and I want to add a reference to a paper. What is the most adequate way to code in the citation? e.g. As a blockquote, as code, as simple text, etc?

Suggestions?


Solution

  • I agree with Horizon_Net that it depends on personal preference. I like to have something which looks similar to LaTeX. An example is provided below. Note that it demonstrates a numeric citation style. Alphabetic or reading style are possible too. For numeric citation style, higher numbers should appear later in the text, and this can make satisfying numeric citation style cumbersome. To avoid this problem, I typically use an alphabetic citation style.

    "...the **go to** statement should be abolished..." [[1]](#1).
    
    ## References
    <a id="1">[1]</a> 
    Dijkstra, E. W. (1968). 
    Go to statement considered harmful. 
    Communications of the ACM, 11(3), 147-148.
    

    "...the go to statement should be abolished..." [1].

    References

    [1] Dijkstra, E. W. (1968). Go to statement considered harmful. Communications of the ACM, 11(3), 147-148.

    On GitHub flavored Markdown and most other Markdown flavors, you can actually click on [1] to jump to the reference. Apologies for taking Dijkstra his sentence out of context. The full sentence would make this example more difficult to read.

    EDIT: If the references all have a stable link, it is also possible to use those:

    The field of natural language processing (NLP) has become mostly dominated by deep learning approaches
    (Young et al., [2018](https://doi.org/10.1109/MCI.2018.2840738)).
    Some are based on transformer neural networks
    (e.g., Devlin et al, [2018](https://arxiv.org/abs/1810.04805)).
    

    The field of natural language processing (NLP) has become mostly dominated by deep learning approaches (Young et al., 2018). Some are based on transformer neural networks (e.g., Devlin et al, 2018).