We don't really know if Jesus ever put pen and ink to paper. No record exists that he ever wrote anything or kept a library of his own. We do know, however, that Jesus was immersed in Israel's Scriptures in a way that did not require him to carry a Torah scroll with him or keep a filing system. The text never disappeared from his memory, and the words that he spoke were so important that among tons of paper and gallons of ink ever used in history, they are the most important -- so much so that precious ink is still used to show them to the world. And perhaps none of those words are as important as those spoken by Jesus known to history as "The Great Commandment."
In Matthew's Gospel, this passage appears in a series of rapid-fire questions from the religious authorities who are grilling Jesus in the temple. The Pharisees maintained huge libraries of commentaries about the Torah and believed themselves to be experts in the law as it appeared on ink and paper. When they heard that Jesus had silenced the Sadducees, another religious literate group, they gathered together and had a lawyer among them ask Jesus a question designed to "test" him.