# Is there a way to "print" to pdf, html, or similar a copy of the code with syntax highlighting?

**URL:** https://discourse.julialang.org/t/is-there-a-way-to-print-to-pdf-html-or-similar-a-copy-of-the-code-with-syntax-highlighting/39290
**Category:** Juno
**Created:** [May 11, 2020, 3:13pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-print-to-pdf-html-or-similar-a-copy-of-the-code-with-syntax-highlighting/39290 "2020-05-11T15:13:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)
#### Post date: [May 11, 2020, 3:13pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-print-to-pdf-html-or-similar-a-copy-of-the-code-with-syntax-highlighting/39290/1 "2020-05-11T15:13:40Z")

</div>

This would be for sharing snippets or files with folks who do not have a Julia-enabled editor.

---

<div class="post-metadata">

### Author: ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)
#### Post date: [May 11, 2020, 4:34pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-print-to-pdf-html-or-similar-a-copy-of-the-code-with-syntax-highlighting/39290/2 "2020-05-11T16:34:35Z")

</div>

You may use pygments  
[https://pygments.org/demo/](https://pygments.org/demo/)  
Copy and paste your code and get the html file or use it within LaTeX to get pdf.

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [May 11, 2020, 5:27pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-print-to-pdf-html-or-similar-a-copy-of-the-code-with-syntax-highlighting/39290/3 "2020-05-11T17:27:38Z")

</div>

[carbon](https://carbon.now.sh/) is fun, too.
