I would like to quote from line 205 to 214 of a particular source code.

2 Answers 2


The Chicago Manual of Style doesn't seem to touch on this topic, but here are some links to questions asked regarding source code citations in other styles:

Perhaps you can combine the information in these links to come up with an acceptable solution.


The Chicago Manual of Style has an entire section on citing "Unpublished and Informally Published Material."

Section 14.243 on citing web sites and blogs would seem to pertain; the guidelines for citing web site content are particularly appropriate. I've noted what modifications that would pertain to citing source code:

For original content from online sources other than the types of formally published documents discussed elsewhere in this chapter, include as much of the following as can be determined:

  • the title or a description of the page [the filename]
  • the author of the content
  • the owner or sponsor of the site
  • a URL [of the source code repository]
  • a date of revision or modification [the commit hash for Git, the version for SVN]

So a sample source code citation might be

  1. glm/core/func_trigonometric.inl::radians, lines 36-45, Christophe Riccio, g-truc/glm, https://github.com/g-truc/glm/blob/0.9.5/glm/detail/func_trigonometric.inl, ccb25c84c7c53ccd78e1fb2951d335638bd3e417

This refers to the radians function that appears in lines 36-45 of the source file cited, in the version indexed by the SHA-1 hash in the citation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.