Skip to content
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

Merged
merged 2 commits into from
Aug 25, 2017
Merged

Conversation

wilx
Copy link
Contributor

@wilx wilx commented Aug 24, 2017

...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.

This resolves jgm/pandoc-templates#227.

...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`.
\usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
\setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
$endif$
\fi
\fi
Copy link
Owner

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).

@jgm
Copy link
Owner

jgm commented Aug 25, 2017

Great. Should the same changes be made to default.beamer?

@jgm
Copy link
Owner

jgm commented Aug 25, 2017

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.

@wilx
Copy link
Contributor Author

wilx commented Aug 25, 2017

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.

@jgm jgm merged commit c9be2de into jgm:master Aug 25, 2017
@adunning
Copy link
Contributor

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 hyperref independently. It would certainly be possible to merge the two templates together, but the result would be more complex.

ickc added a commit to ickc/pandoc that referenced this pull request Jul 31, 2024
when CJKmainfont is used with lualatex
C.f. jgm#3873
jgm pushed a commit that referenced this pull request Jul 31, 2024
when CJKmainfont is used with lualatex
C.f. #3873
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants