-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Allow setting Japanese fonts when using LuaLaTeX #3873
Conversation
...by using the `luatexja-fontspec` and `luatexja-preset` packages. Use existing `CJKmainfont` and `CJKoptions` template variables. Add `luatexjafontspecoptions` for `luatexja-fontspec` and `luatexjapresetoptions` for `luatexja-preset`.
data/templates/default.latex
Outdated
\usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec} | ||
\setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} | ||
$endif$ | ||
\fi | ||
\fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, this way of doing it gives you
\ifxetex
\fi
\ifluatex
\fi
when the CJKmainfont and luatexjapresentoptions variables are not set (as is the default).
It would be better to make all of this conditional on CJKmainfont. (Or you might need two conditionals, one with CJKmainfont, one with luatexjapresetoptions.)
Note also that the writer tests may need updating (though the need for this will probably go away if you make these things conditional, since the writer tests don't set these variables).
Great. Should the same changes be made to default.beamer? |
Actually, I see that there are quite a few differences between default.beamer and default.latex. Perhaps we should try to integrate the two templates into one template with some conditionals. I can't recall why we had two in the first place. |
I am not sure. There seem to be various issues or were at least in the past with Beamer and fonts. I am not confident enough to modify the Beamer template. I do not use it. |
Thanks for sorting this! The reason for the separate Beamer template is that the package behaves a bit differently from the basic LaTeX document classes; most notably, it loads |
when CJKmainfont is used with lualatex C.f. jgm#3873
when CJKmainfont is used with lualatex C.f. #3873
...by using the
luatexja-fontspec
andluatexja-preset
packages. Useexisting
CJKmainfont
andCJKoptions
template variables. Addluatexjafontspecoptions
forluatexja-fontspec
andluatexjapresetoptions
for
luatexja-preset
.This resolves jgm/pandoc-templates#227.