-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Available LaTeX fonts #65
Comments
Sure, you can load them the same way you would in LaTeX. But that needs a full TeXDocument. Ideally this would be automated from the fonts in the theme, but I don't have time to figure that out currently... |
I see. This is a great addition to Makie, thanks! |
Sorry -- to be clear, if I loaded in the font via a TeXDocument, would it apply to all fonts in the plot (e.g., for ticks, axis labels, titles, etc.)? |
This attempt does not seem to do anything to the fonts. Clearly I need to pass the tex doc somewhere but I don't know where.
|
You aren't using function num2tex(num)
return TeXDocument("""
\documentclass{standalone}
\usepackage{amsmath}
\begin{document}
\renewcommand{\familydefault}{\sfdefault}
$$\int x = dx$$
\end{document}
""")
end
fig = Figure()
ax1 = Axis(
fig[1, 1], ytickformat = x -> num2tex.(x), xtickformat = x -> num2tex.(x)
)
heatmap!(ax1, Makie.peaks())
fig It's been a while since I wrote TeX so that document might be wrong. But this is what you would do. |
I see, thanks. This attempt gives an error that I am having difficulty parsing. The TeX document compiles just fine on its own.
|
Ooh yeah I missed that you are using it like that. That doesn't work in recent versions of Makie unfortunately, because of changes to the way text is laid out. I want to change that at some point but it's a bit tough. If you need that specific font and have a file for it (.ttf, .otf, or whatever) then you could use Makie's native font capabilities to point to it (https://docs.makie.org/dev/explanations/fonts) and reserve MakieTeX for labels and other, larger text that you can create independent label blocks for. |
Okay, thanks. Using a .ttf file works fine for the most part. Perhaps it's worth keeping this issue open though? |
Yes, at some point I want to unify these two approaches. |
Is there any way to use other fonts offered in LaTeX -- in particular, computer modern sans serif?
Thanks
The text was updated successfully, but these errors were encountered: