# Publish code

**URL:** <https://discourse.julialang.org/t/publish-code/49195>\
**Category:** General Usage\
**Tags:** question, announcement\
**Created:** [October 28, 2020, 6:19pm UTC](https://discourse.julialang.org/t/publish-code/49195 "2020-10-28T18:19:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cadojo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cadojo/32/25328_2.png) [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Post date:** [October 28, 2020, 6:19pm UTC](https://discourse.julialang.org/t/publish-code/49195/1 "2020-10-28T18:19:35Z")

</div>

In addition to the documentation in the `docs/` directory, I would like to “publish” all Julia files in my Julia package to a PDF. Is there any common / preferred way to publish Julia code with syntax highlighting? I’m looking for something like Weave, but without actually running the code.

---

<div class="post-metadata">

**Author:** ![helgee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/helgee/32/2022_2.png) [@helgee](https://discourse.julialang.org/u/helgee)\
**Post date:** [October 28, 2020, 6:51pm UTC](https://discourse.julialang.org/t/publish-code/49195/2 "2020-10-28T18:51:21Z")

</div>

If you are willing to roll your own solution, LaTeX with the [Minted](http://tug.ctan.org/macros/latex/contrib/minted/minted.pdf) package works quite well.

---

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [October 28, 2020, 10:16pm UTC](https://discourse.julialang.org/t/publish-code/49195/3 "2020-10-28T22:16:43Z")

</div>

> [@cadojo](#):
>
> I’m looking for something like Weave, but without actually running the code.

The easiest solution meeting that requirement is just using Weave with the option `eval=false` set globally, see:

[http://weavejl.mpastell.com/stable/chunk\_options/#Default-Chunk-Options](http://weavejl.mpastell.com/stable/chunk_options/#Default-Chunk-Options)

---

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [October 28, 2020, 10:59pm UTC](https://discourse.julialang.org/t/publish-code/49195/4 "2020-10-28T22:59:32Z")

</div>

Some text editors/IDEs have ability to print with syntax highlighting. Can use that + print to PDF.  
Only one I know off the top of my head is Notepad++, but I would not be surprised if it was a really common feature.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [October 28, 2020, 11:57pm UTC](https://discourse.julialang.org/t/publish-code/49195/5 "2020-10-28T23:57:16Z")

</div>

Maybe this can help, that with a simple script would do the trick:

[https://github.com/m3g/jlcode\_example](https://github.com/m3g/jlcode_example)

---

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [October 29, 2020, 12:21am UTC](https://discourse.julialang.org/t/publish-code/49195/6 "2020-10-29T00:21:38Z")

</div>

gedit prints with syntax highlighting too. There are also extensions for that in VS Code ([VS Code Printing Free](https://marketplace.visualstudio.com/items?itemName=pdconsec.vscode-print), [PrintCode](https://marketplace.visualstudio.com/items?itemName=nobuhito.printcode), and maybe more).
