2

I am using MikTex 2.9 on a Windows system. I have a document I am compiling with LuaTex. I want to use a Japanese font called dmjhira (my collaborator has selected this font, and is able to use it on their machine, but does not remember how they got it set up). The only place I need to use this font is to define a single operator, as follows:

\font\maljapanese=dmjhira at 2ex 
\def\yo{\textrm{\maljapanese\char"48}}

In particular, I don't think it's necessary for me to be able to input Japanese in Unicode in my source file, which I think is the intention of the cjk package.

I think I have two issues:

  1. I'm not sure where to acquire the font dmjhira.

Since I am using LuaTex, I first tried to find the font dmjhira online to install it globally on my computer. But I can't seem to find any mention of this font except in TeX - related places. For instance, it seems to be used on p. 37 here. So I suspect there is a LaTeX-specific font package I'm supposed to install, but I can't for the life of me figure out what that is.

This leads to my second issue:

  1. Even if I could find the font dmjhira, I don't know how to install it using MikTex.

The only mention of fonts I can find in the MikTex documentation is here and whatever is being described there seems more advanced than what I'm trying to do. I found this handy guide, but unfortunately the MikTex instructions in there seem to be out of date (perhaps predating the MikTex Console?).

1 Answer 1

2

The font is in the cjk-fonts package. Install it with the miktex console if you haven't done it already. You will perhaps have to remake the font map files. This can done in the miktex console (user mode) with refresh font map files in the tasks menu.

Then it should work

\documentclass{book}

\begin{document}
abc
\font\maljapanese=dmjhira at 2ex 
\maljapanese \char"48

\end{document}

enter image description here

5
  • Thanks! MikTex Console says I installed cjk-fonts yesterday, which makes sense-- I did a big update then. But when I run your code in TeXstudio, the compilation fails. It refers me to two log files: ...\miktex-makemf.log and ...\miktex-makepk.log. The former tells me that miktex-makemf couldn't find the source file dmjhira, and the latter tells me that miktex-ttf2pk.exe couldn't create the font dmjhira. I tried adding \usepackge{cjk-fonts}, but then I get the error "cjk-fonts.sty not found". Is there some kind of post-processing I need to do to complete the cjk-fonts installation or something?
    – tcamps
    Commented Mar 24, 2020 at 15:44
  • 2
    Try in the miktex console (user mode) in the tasks menu the "refresh font map files". Commented Mar 24, 2020 at 15:50
  • the above code works for metoo
    – js bibra
    Commented Mar 24, 2020 at 15:50
  • Ah, great, that did the trick! Thank you so much!
    – tcamps
    Commented Mar 24, 2020 at 15:51
  • Hi, I am having the same error. I wish to use this symbol but my issue with TeXstudio isn't going away even after doing the refresh of font files. I am not able to figure out why. The code is compiling when I set my TeXstudio to compile with XeLaTeX but it does not work with LuaLaTeX or PdfLaTeX. I really wish to work with PdfLaTeX only.
    – Someone
    Commented Dec 1, 2022 at 3:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .