# Printing specific unicode character in otf file using MathTeXEngine

**URL:** <https://discourse.julialang.org/t/printing-specific-unicode-character-in-otf-file-using-mathtexengine/113252>\
**Category:** Visualization\
**Created:** [April 19, 2024, 6:58pm UTC](https://discourse.julialang.org/t/printing-specific-unicode-character-in-otf-file-using-mathtexengine/113252 "2024-04-19T18:58:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxee](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxee/32/52904_2.png) [@maxee](https://discourse.julialang.org/u/maxee)\
**Post date:** [April 19, 2024, 6:58pm UTC](https://discourse.julialang.org/t/printing-specific-unicode-character-in-otf-file-using-mathtexengine/113252/1 "2024-04-19T18:58:59Z")

</div>

When using MathTeXEngine within Makie, I need to put a specific font for N in the graph. I am using \mathcal{N} within LaTeX, and would like an N which looks similar. I cannot change the font for the LaTeX font.

The mathcal{N} which MathTeXEngine chooses is shown below. I would like to use the N given by index 2775 in the same otf font file. Is there some way for me to accomplish this?

```julia
using MathTeXEngine
generate_tex_elements(L"\mathcal{N}")
    1-element Vector{Any}:
     (TeXChar '𝓝' [index 2823 in NewComputerModern Math - Regular], [0.0, 0.0], 1.0)

```

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [April 19, 2024, 8:59pm UTC](https://discourse.julialang.org/t/printing-specific-unicode-character-in-otf-file-using-mathtexengine/113252/2 "2024-04-19T20:59:46Z")

</div>

It looks like you can just add new Unicode characters to the font mapping in MathTeXEngine.jl and then use that Unicode directly in the LaTeX string (rather than `\mathcal`):

```julia
julia> MathTeXEngine._symbol_to_new_computer_modern['𝓝'] = ("NewComputerModern/NewCMMath-Regular.otf", 2775)
("NewComputerModern/NewCMMath-Regular.otf", 2775)

julia> generate_tex_elements("𝓝")
1-element Vector{Any}:
 (TeXChar '𝓝' [index 2775 in NewComputerModern Math - Regular], Float32[0.0, 0.0], 1.0)

```

This is just a hack, of course, from looking into the source code. I’m not sure if there is a documented/approved way to do this.
