# Printing a Julia source with unicode from Atom

**URL:** https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869
**Category:** General Usage
**Created:** [April 1, 2020, 8:34pm UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869 "2020-04-01T20:34:53Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)
#### Post date: [April 1, 2020, 8:34pm UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/1 "2020-04-01T20:34:54Z")

</div>

Is there an accepted way to print a Julia source file keeping the Unicode intact? Thanks.

---

<div class="post-metadata">

### Author: ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)
#### Post date: [April 1, 2020, 10:06pm UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/2 "2020-04-01T22:06:03Z")

</div>

That sounds more like a font issue when printing…Can you change the font used in printing? I didn’t see a “print” option in atom did you install a package? Are you on Windows or Linux? Printing can be very OS specific.

---

<div class="post-metadata">

### Author: ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)
#### Post date: [April 1, 2020, 10:15pm UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/3 "2020-04-01T22:15:30Z")

</div>

I am on the mac. I installed PanDocs, which is supposed to convert to pdf via latex libraries. I do not have the stomach to do this, so I wanted a quick solution. It is hard to believe that a software as sophisticated as Atom is being used by developers who never print.

Thanks!

Gordon

---

<div class="post-metadata">

### Author: ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)
#### Post date: [April 1, 2020, 10:20pm UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/4 "2020-04-01T22:20:57Z")

</div>

Sorry, I don’t have a mac. My guess would be PanDocs is using a different font that the editor, and that font doesn’t have all the symbols you use in your source code.

---

<div class="post-metadata">

### Author: ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)
#### Post date: [April 1, 2020, 10:28pm UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/5 "2020-04-01T22:28:39Z")

</div>

I agree. Good guess. I have to believe that among this Julia group that some people own macs who print! Perhaps there is a better subgroup to post to.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [April 2, 2020, 7:19am UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/6 "2020-04-02T07:19:03Z")

</div>

> [@erlebach](#):
>
> I installed PanDocs

I wonder if you are talking about [pandoc](https://pandoc.org/). It is pretty easy to figure out if you follow the error messages: you have to use an engine other than `pdflatex`, and pick a font that has the desired characters. Eg the markdown with the YAML header

````markdown
---
mainfont: DejaVuSerif
sansfont: DejaVuSans
monofont: DejaVuSansMono
mathfont: TeXGyreDejaVuMath-Regular
---

# Test

```julia
α + Γ → κ
```

````

invoked with

```sh
pandoc -t latex --pdf-engine=lualatex -o test.pdf test.md

```

works fine for me.

**If it doesn’t, please provide an MWE and the error messages.** Strictly speaking you may get better support for this at the pandoc forums, but I guess it is fine to ask here.

---

<div class="post-metadata">

### Author: ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)
#### Post date: [April 2, 2020, 11:11am UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/7 "2020-04-02T11:11:50Z")

</div>

Great! I will certainly try this out.m Thanks!

---

<div class="post-metadata">

### Author: ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)
#### Post date: [April 2, 2020, 1:14pm UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/8 "2020-04-02T13:14:21Z")

</div>

Ok, the test, from the command line works. I note that you used a markdown file. But the files in Atom are jl files, and the unicode text are not contained within ``` symbols. So I would like a pandoc command line that operates directly on files that have the .jl extension.

No MWE yet. Or rather: any julia file. Your file without the triple quotes would do with the jl extension.

---

<div class="post-metadata">

### Author: ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)
#### Post date: [April 2, 2020, 1:28pm UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/9 "2020-04-02T13:28:12Z")

</div>

Last question for now: Pandoc converts different Markdown formats. Julia is not a markdown format. What am I missing as far as concepts? Thanks.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [April 2, 2020, 2:44pm UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/10 "2020-04-02T14:44:02Z")

</div>

> [@erlebach](#):
>
> No MWE yet. Or rather: any julia file. Your file without the triple quotes would do with the jl extension.

Unfortunately I don’t use Atom, so I cannot help you further with this. I hope someone will come along who can reproduce the error.

---

<div class="post-metadata">

### Author: ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)
#### Post date: [April 2, 2020, 4:54pm UTC](https://discourse.julialang.org/t/printing-a-julia-source-with-unicode-from-atom/36869/11 "2020-04-02T16:54:58Z")

</div>

Ok, I did it!! Literate was the key. But I also had to install the package “markdown-to-pdf” using Atom’s package installer.

Step 1: I created a small Julia program called:

```julia
using DataFrames
using Literate
Literate.markdown("covid_gordon.jl", "."; documenter=false)

```

Then, inside an Atom window, open up the markdown file “covid\_gordon.md”, and right-click to access the menu item “Convert to pdf” along with a shortcut key. The pdf then generates in your working directory.

Pandoc does not work because the Latex on my system cannot handle the unicode characters in the markdown file. I think Latex is overkill for this particular task.

Thank you for the help!
